Get access to 30+ marketing and SEO tools. analyze competitors, keywords, and backlinks for free..
Sign in Sign Up

We use cookies to make Serpstat better. By clicking "Accept cookies", you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. Learn more

Getting the raw SERP in HTML format (tasks.getKeywordSerp)

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

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

Request data:
    "id": 1,
    "method": "tasks.getKeywordSerp",
    "params": {
        "taskId": 2071486,
        "keywordId": 469482008
Response data: