« Back to Documentation OverviewlistGrowthHistory – v1.2
listGrowthHistory(string apikey, string id)
Access the Growth History by Month for a given list.
| Parameters | mcapi_listGrowthHistory.php| apikey | a valid API Key for your user account. Get by visiting your API dashboard |
| id | the list id to connect to. Get by calling lists() |
| Returns | | array |
array of months and growth |
| Returned Fields | string | month | The Year and Month in question using YYYY-MM format | integer | existing | number of existing subscribers to start the month | integer | imports | number of subscribers imported during the month | integer | optins | number of subscribers who opted-in during the month |
Examples (1)
download example code
[1] mcapi_listGrowthHistory.php
<?php
// Include the MailChimp API code. Do Not Edit This!
require_once 'inc/MCAPI.class.php';
require_once 'inc/config.inc.php'; //contains apikey
$api = new MCAPI($apikey);
$history = $api->listGrowthHistory($listId);
if ($api->errorCode){
} else {
foreach($history as $h){
echo "\tExisting=".$h['existing']."\n"; echo "\tImports=".$h['imports']."\n"; echo "\tOptins=".$h['optins']."\n"; }
}
?>