API

Your api key: your_account_key_here_32_bytes_long
PHP example | PYTHON example


Content:


Methods


addurl: add new task with urls to the service

This method add new tasks with urls like we do manually here

Method address: http://bulkaddurl.com/api/addurl

Request format: POST

Response format: JSON

Request parameters:

Parameter Type Required Purpose
apikey String Yes Client authorization key. Your api key (32 bytes long) can be found here
urls String Yes Text with a list of urls you want to submit. You should use newline character to delimiter multiple urls.
name String No Task name
date_ot_print String No Date of "When addurl starts (start)". Format: "year-month-day hours:minutes" (for example "2016-02-16 12:53"). If you send nothing, we will take current time.
date_do_print String No Date of "When addurl starts (finish)". Format: "year-month-day hours:minutes" (for example "2016-02-16 12:53"). If you send nothing, we will take current time.
shuffle String No Should we submit your urls in random order? Possible values:
  • 0 (default) : no shuffle
  • 1 : shuffle
queue_type String No Type of queue. Possible values:
  • normal (default) : general queue, after any VIP url.
  • vip : before any url in Normal queue.
    The price of one addUrl will be little higher than in normal mode.
    Use vip if you can't wait for general queue. For example if the size of general queue is some thousands links you want to index your urls as quickly as possible.
check_already_added String No Addurl only new urls that we have not already addurled? Possible values:
  • 1 (default) : Yes. Check and add only urls that we have to added yet.
  • 0 : No. Add all urls. Special for ReIndexation
    Use if you want to reindex your page or actualizate cache of page in Google.
send_email_on_finish String No Receive email after the task is finished? Possible values:
  • 0 (default) : No. You will not receive email.
  • 1 : Yes. You'll receive email.

Response structure:

Parameter Type Purpose
taskId Integer Task ID for future use in getTask method.
taskPrice Float How much did you pay for that task
taskCountUrls Integer How many urls were added
taskUrlsAdded List Urls that were added
errorId Integer Error identificator.
  • 0 : no errors, the task has been successfully created, task ID located in taskId property
  • >1 : error identificator. Error code and short information transferred in errorCode and errorDescription properties
errorCode String Error code. Check out errors list.
errorDescription String Short information describing error
errorDetails String Details about error
status String Status success means that everything is ok, urls are added (in this case you'll find id of the task in the message field.
Status error means that there was some error, you'll find the reason in the message field.
message String Details of the operation.

Response example:

{
	"taskId":925856,
	"taskPrice":0.006,
	"taskCountUrls":3,
	"taskUrlsAdded":["http:\/\/random-9964.com","http:\/\/random-1812.com","http:\/\/random-5968.com"],
	"status":"success",
	"message":"task_id:925856",
	"errorId":0
}

getBalance: retrieve account balance

This method returns account balance

Method address: http://bulkaddurl.com/api/getBalance

Request format: POST

Response format: JSON

Request parameters:

Parameter Type Required Purpose
apikey String Yes Client authorization key. Your api key (32 bytes long) can be found here

Response structure:

Parameter Type Purpose
balance Float Account balance value.
errorId Integer Error identificator.
  • 0 : no errors, the task has been successfully created, task ID located in taskId property
  • >1 : error identificator. Error code and short information transferred in errorCode and errorDescription properties
errorCode String Error code. Check out errors list.
errorDescription String Short information describing error
errorDetails String Details about error

Response example:

{
    "balance":12.3456
    "errorId":0,
}

checkTaskStatus: check task status

This method returns task status

Method address: http://bulkaddurl.com/api/checkTaskStatus

Request format: POST

Response format: JSON

Request parameters:

Parameter Type Required Purpose
id Integer Yes Task id
apikey String Yes Client authorization key. Your api key (32 bytes long) can be found here

Response structure:

Parameter Type Purpose
status String Status of your task
Possible values:
  • processing : task is not ready yet
  • ready : task complete
errorId Integer Error identificator.
  • 0 : no errors, the task has been successfully created, task ID located in taskId property
  • >1 : error identificator. Error code and short information transferred in errorCode and errorDescription properties
errorCode String Error code. Check out errors list.
errorDescription String Short information describing error
errorDetails String Details about error

Response example:

{
	"status":"processing",
	"errorId":0
}

Response example with error:

{
	"errorId":301,
	"errorCode":"ERROR_NO_SUCH_TASK",
	"errorDescription":"No task with such id",
	"errorDetails":"searching for id 1000"
}

checkTasksStatuses: check tasks statuses for multiple tasks

This method returns tasks statuses for multiple tasks

Method address: http://bulkaddurl.com/api/checkTasksStatuses

Request format: POST

Response format: JSON

Request parameters:

Parameter Type Required Purpose
ids String Yes Tasks ids delimited by ,, for example 128,129,205
apikey String Yes Client authorization key. Your api key (32 bytes long) can be found here

Response structure:

Parameter Type Purpose
statuses Dictionary Dictinary of Statuses for your tasks in format {id=>"status"}
Possible status values:
  • processing : task is not ready yet
  • ready : task complete
errorId Integer Error identificator.
  • 0 : no errors, the task has been successfully created, task ID located in taskId property
  • >1 : error identificator. Error code and short information transferred in errorCode and errorDescription properties
errorCode String Error code. Check out errors list.
errorDescription String Short information describing error
errorDetails String Details about error

Response example:

{
	"statuses":
		{
		"128":"ready",
		"129":"processing"
		},
	"errorId":0
}

Response example with error:

{
	"errorId":301,
	"errorCode":"ERROR_NO_SUCH_TASK",
	"errorDescription":"No task with such id",
	"errorDetails":"searching for id 1000"
}

Errors

ID Code Description
0 SUCCESS operation finished successfully
1000 ERROR_NO_SUCH_METHOD Request to API made with method which does not exist
1001 ERROR_IMPOSSIBLE_PARAMETER Parameter with such value is impossible
1002 ERROR Some error
1100 ERROR_MYSQL_QUERY Mysql error
200 ERROR_KEY_DOES_NOT_EXIST Account authorization key not found in the system
201 ERROR_KEY_IS_NOT_SENT You have not sent Account authorization key
202 ERROR_KEY_BAD Account authorization key is bad
301 ERROR_NO_SUCH_TASK No task with such id
302 ERROR_WRONG_OWNER You are not owner of this task
303 ERROR_NO_TASK_ID You have not sent task id
304 ERROR_UNKNOWN_STATUS Unknown task status
305 ERROR_NO_UNIQUE_URLS No unique urls in task after checking hashes
101 ERROR_SERVICE_UNDER_CONSTRUCTION Service temporarily under construction


PHP example

<?php

//your api key , take it at http://bulkaddurl.com/user/api/
$apikey = 'your_account_key_here_32_bytes_long';

//your urls that you want to submit to google
$urls = array(
	'http://google1.com',
	'https://ru.wikipedia.org/wiki/%D0%9A%D1%80%D0%B0%D1%81%D0%BE%D1%82%D0%B0',
	'http://google.ru/спасибо мир',
	'http://гугл.рф',
);

header('Content-Type: text/html; charset=utf-8');
$r = send_to_bulkaddurl($apikey, $urls);
print 'Result:<pre>';
print_r( $r );

###########################################################main function
function send_to_bulkaddurl($apikey, $urls) {
	$url_api = 'http://bulkaddurl.com/api';

	$urls = implode(PHP_EOL, $urls);

	$fields = array(
			'urls'=>$urls,
			'apikey'=>$apikey,

			'queue_type'=>'vip',

			'name'=>'Adding task with api',
		);

	$fields_string = http_build_query($fields);

	//open connection
	$ch = curl_init();

	//set the url, number of POST vars, POST data
	curl_setopt($ch,CURLOPT_URL,$url_api);
	curl_setopt($ch,CURLOPT_POST, count($fields));
	curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

	//execute post
	$result = curl_exec($ch);
	//print $result;
	//die();

	$result = json_decode($result, true);
	return $result;
}
?>

PYTHON 2.7 example

#!/usr/bin/python
# -*- coding: utf-8 -*-
import requests

apikey = 'your_account_key_here_32_bytes_long'

url_api = 'http://bulkaddurl.com/api'


urls = [
	'http://google1.com',
	'https://ru.wikipedia.org/wiki/%D0%9A%D1%80%D0%B0%D1%81%D0%BE%D1%82%D0%B0',
	'http://google.ru/спасибо мир',
	'http://гугл.рф',
]

urls_txt = '\n'.join(urls)

data = {
	'name':'Adding task with api through python',
	'urls':urls_txt,
	'apikey':apikey,

	'queue_type':'vip',

	'check_already_added':0,
}

resp = requests.post(url_api, data=data)

code = resp.status_code
answer = resp.text

print 'code:', code
print 'answer:', answer

#code: 200
#answer: {"status":"success","message":"task_id:1234567"}


3=0/0.75