Sending keywords to crawl regular and local results and getting a task id for further queries

The tasks.addTask method allows sending keywords to crawl regular SERP and local results and get a task ID for further queries.

General request parameters and instructions for using Serpstat API

Request parameters for regular results
Parameter Description Type Optional Default value Value options
id Identifier of current request, can be set manually or automatically string no 1, test
method API method name string no   tasks.addTask
params Object with parameters object no
keywords Keywords for parsing string no
"iphone,iphone X,iphone 10"
seId

Search engine identifier

int no 1 — Google
countryId Country identifier
Country (for Google) is indicated in the document
int no 23 (USA)
regionId

Region or city identifier.
Region is indicated in the document

int yes  Google; 21176 (Texas)
langId

Language identifier.
Language is indicated in the document

int yes English by default 1 (English)
typeId

Device type identifier

int yes Desktop 1 — Desktop
2 — Mobile


Local results

There is a special block in Google SERP Local pack that usually consists of 3 results (sometimes there can be 4 results and the first one is ad). If you click on the "More places" button in the bottom of the Local pack block, you will see the Local results page that includes the same data as the Local pack but it has more results (up to 50 results for both desktop and mobile). To get this data, you need to add the following parameter in the query:

type

Type of Google results

string yes By default the parameter is "regular"; "local" — for local results local

The example of the request for Local results:
 {
   "id": "some_id",
    "method": "tasks.addTask",
    "params": {
        "keywords": "pizza, burger, iphone",
        "typeId": 1,
        "seId": 1,
        "countryId": 23,
        "regionId": 21176,
        "langId": 1,
        "type": "local"
    }
}

Response parameters
Parameter Description
id Identifiers of the current request
result Contains the answer
task_id
Crawling identifier
blocked_keywords Keywords with special symbols, which were rejected, credits won’t be charged

Errors
Error Description
You have no keywords after filtrating, blocked keywords: [list of blocked keywords] If all sent keywords sent are invalid
Required parameter '[parameter]' missed A parameter missed
Task (id=x) with such parameters has already been created today You have already created a task with such parameters
No such se_id Invalid se_id
device_type_id
Invalid type id value
Invalid type_id
Not enough money. You lack N$ When there's a lack of credits for such amount of keywords

Example Python
Request data:
{
    "id": "some_id",
    "method": "tasks.addTask",
    "params": {
        "keywords": "pizza, burger, iphone",
        "typeId": 1,
        "seId": 1,
        "countryId": 23,
        "regionId": 21176,
        "langId": 1
    }
}
Response data:
{
    "id": "some_id",
    "result": {
        "task_id": "2381968",
        "blocked_keywords": []
    }
}

Serpstat API request drafts: link

Share this article with your friends

Are you sure?

Introducing Serpstat

Find out about the main features of the service in a convenient way for you!

Please send a request, and our specialist will offer you education options: a personal demonstration, a trial period, or materials for self-study and increasing expertise — everything for a comfortable start to work with Serpstat.

Name

Email

Phone

We are glad of your comment
I agree to Serpstat`s Privacy Policy.

Thank you, we have saved your new mailing settings.

Open support chat