Getting the raw SERP in HTML format
The tasks.getKeywordSerp method returns the raw SERP in HTML format using task ID and keyword ID.
General request parameters and instructions for using Serpstat API
Request parameters | ||||
---|---|---|---|---|
Parameter | Description | Type | Optional | Value options |
id | Identifier of a current request, can be set manually or automatically | string | no | 1, test |
method | API method name | string | no | tasks.getKeywordSerp |
params | Object with parameters | object | no | |
taskId | Id number from SERP crawling — the same id, which you are using to get a result for SERP crawling (from methods: tasks.addTask или tasks.addKeywordList) | int | no | 2071486 |
keywordId | Id number of a required keyword for getting a raw SERP (you can get it in the SERP crawling response from the method tasks.getTaskResult) | int | no | 469482008 |
Response parameters | |
Parameter | Description |
id | Identifiers of the current request |
result | Contains the answer |
date | SERP date |
serp | A raw SERP in HTML format |
Errors | |
Error | Description |
Task not found | Incorrect task ID |
Keyword not found | Wrong keyword ID |
Keyword not parsed yet | No SERP in HTML yet |
SERP for keyword not found | HTML SERP was deleted, and no longer exists |