How do I get a screenshot of a SERP page? – DataForSEO

How do I get a screenshot of a SERP page?

Using the SERP API Page Screenshot endpoint, you can capture a screenshot of any SERP page.

1 Call the endpoint.

POST https://api.dataforseo.com/v3/serp/screenshot

2 Specify the ID of the task for which you would like to receive a screenshot in the task_id field.

That should be enough to send a basic POST request. Structure it as in the following example:

[\
    {\
        "task_id": "07181408-2806-0139-0000-6c377ba904f5"\
    }\
]

You can also use additional POST parameters to receive more specific results:

In the API response, you will receive the URL to a high-quality page screenshot on the DataForSEO storage.

Example API response

{  
    "version": "0.1.20220627",  
    "status_code": 20000,  
    "status_message": "Ok.",  
    "time": "2.9924 sec.",  
    "cost": 0.004,  
    "tasks_count": 1,  
    "tasks_error": 0,  
    "tasks": [  
        {  
            "id": "07181411-2806-0454-0000-02a53fd86515",  
            "status_code": 20000,  
            "status_message": "Ok.",  
            "time": "2.9350 sec.",  
            "cost": 0.004,  
            "result_count": 1,  
            "path": [  
                "v3",  
                "serp",  
                "screenshot"  
            ],  
            "data": {  
                "api": "serp",  
                "function": "screenshot",  
                "task_id": "07181408-2806-0139-0000-6c377ba904f5"  
            },  
            "result": [  
                {  
                    "items_count": 1,  
                    "items": [  
                        {  
                            "image": "https://api.dataforseo.com/cdn/s/beb24f74-aabc-4f00-9bc3-9445ca70bc3a"  
                        }  
                    ]  
                }  
            ]  
        }  
    ]  
}

Embed DataForSeo widget on your website

Width:

Height:

Embed code:

Copy Code

Preview: