New Year Offers: Up to 75% OFF + 100% Top-Up BONUS! SEO Deals TopUp Deals

API PHP Examples

PHP example codes

Order example

Example code
$url = 'http://1billionlinks.com/api/api.php';
$api_key = 'Your API Key';
$email = 'Your email';

$data = Array(
'api_key'=>$api_key,//must included in every request
'email'=>$email,//must included in every request
'action'=>'order',//action must included in every request
'project_name'=>'my_project_name',//optional
'plan_id'=>'1',//must included with action: order
'links'=>"http://link1.com\r\nhttp://link2.com",//must included with action: order
'keywords'=>'keyword1,keyword2,keyword3'//must included with action:order
);

if (is_array($data)) $dataString = http_build_query($data, '', '&');

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)');
$result = curl_exec($ch);
curl_close($ch);
Example response
{
"order": 269013
}

Order details example

Example code
$url = 'http://1billionlinks.com/api/api.php';
$api_key = 'Your API Key';
$email = 'Your email';

$data = array(
	'api_key'=>$api_key,//must included in every request
	'email'=>$email,//must included in every request
	'action'=>'order_details',//action must included in every request
	'order_id'=>'45759'//request id must included with action: order_details
);
if (is_array($data)) $dataString = http_build_query($data, '', '&');

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)');
$result = curl_exec($ch);
curl_close($ch);
Example response
{
"order_id": "269013",
"project_name": "my_project_name",
"links": "http:\/\/link1.com\r\nhttp:\/\/link2.com",
"keywords": "keyword1,keyword2,keyword3",
"quantity": "2",
"price": "510",
"date": "2016-06-18 13:04:11"
}

Order status example

Example code
$url = 'http://1billionlinks.com/api/api.php';
$api_key = 'Your API Key';
$email = 'Your email';

$data = Array(
'api_key'=>$api_key,//must included in every request
'email'=>$email,//must included in every request
'action'=>'order_status',//action must included in every request
'order_id'=>'269013'//request id must included with action: order_status
);

if (is_array($data)) $dataString = http_build_query($data, '', '&');

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)');
$result = curl_exec($ch);
curl_close($ch);
Example response
{
"order_id": "269013",
"status": "Pending"
}
{
"order_id": "269013",
"status": "Processing"
}
{
"order_id": "269013",
"status": "Completed"
}
{
"order_id": "269013",
"status": "Canceled"
}

Report example

Example code
$url = 'http://1billionlinks.com/api/api.php';
$api_key = 'Your API Key';
$email = 'Your email';

$data = Array(
'api_key'=>$api_key,//must included in every request
'email'=>$email,//must included in every request
'action'=>'report',//action must included in every request
'order_id'=>'269013'//request id must included with action: report
);

if (is_array($data)) $dataString = http_build_query($data, '', '&');

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)');
$result = curl_exec($ch);
curl_close($ch);
Example response
{
"order_id": "268999",
"report": "https:\/\/ses-rpts.s3.amazonaws.com\/reports\/AAA\/11-22\/269013.zip"
}

Report request example

Example code
$url = 'http://1billionlinks.com/api/api.php';
$api_key = 'Your API Key';
$email = 'Your email';

$data = Array(
'api_key'=>$api_key,//must included in every request
'email'=>$email,//must included in every request
'action'=>'report_request',//action must included in every request
'order_id'=>'269013'//request id must included with action: report
);

if (is_array($data)) $dataString = http_build_query($data, '', '&');

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)');
$result = curl_exec($ch);
curl_close($ch);
Example response
{
"notify": "waiting... , Your download request is in progress, please wait..."
}

Balance example

Example code
$url = 'http://1billionlinks.com/api/api.php';
$api_key = 'Your API Key';
$email = 'Your email';

$data = Array(
'api_key'=>$api_key,//must included in every request
'email'=>$email,//must included in every request
'action'=>'balance'//action must included in every request
);

if (is_array($data)) $dataString = http_build_query($data, '', '&');

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)');
$result = curl_exec($ch);
curl_close($ch);
Example response
{
"balance": "10000"
}