SERP and On-Page Data API

Samuel Schmitt

Looking for a SERP and On-Page API returning: 

You are at the right place. 

With thruuu, you have an

You can now automate your SERP Analysis with an awesome SERP API.

Getting Started with the thruuu SERP API

In this guide, we’ll cover how to access the SERP API endpoints, make API calls, and work with the returned data.

Note: If you don’t yet have an account and API key, please read this page first.

Request Builder

Within the API dashboard, you’ll find the Request Builder, a helpful tool to structure your API requests correctly.

We recommend using it as you familiarize yourself with the API to ensure proper setup.

Making Your First Call to the SERP API

The SERP API endpoint returns a comprehensive Google SERP, including statistics and on-page data for each result. To retrieve the data, you’ll need to set up a webhook endpoint in your application.

To call the endpoint, make the following HTTP request:

POST https://api.thruuu.com/api/v2/serps

Request Headers:

{
    "Content-Type": "application/json",
    "Authorization": "Bearer YOUR_API_TOKEN"
}

Request Body:

{
    "keywords": ["seo", "seo tool"],
    "parameters": {
        "search_engine": "google.com",
        "location": null,
        "country": "US",
        "language": "en",
        "device": "desktop",
        "search_volume": true,
        "num": 20,
        "analyze_content": false,
        "analyze_headings": false,
        "analyze_top_topics": false
    },
    "reference": null,
    "minified_response": false
}

Explanation of Key Parameters:

API Response

Upon successfully initiating a bulk request, you’ll receive the following response:

{
   "message": "Bulk API initiated successfully",
   "success": true,
   "id": "670a7acabcfc2555366172ea",
   "credits": {
       "free": 5,
       "paid": 0,
       "sub": 500
   }
}

Since the process can take longer than 30 seconds, the thruuu API will notify your webhook endpoint with a JSON object containing the results.

Setting Up a Webhook Endpoint

Below is an example in NodeJS to configure an HTTP POST endpoint to receive data from the thruuu API.

const express = require('express');
const app = express();
 
// Match the raw body to content type application/json
// If you are using Express v4 - v4.16 you need to use body-parser, not express, to retrieve the request body

app.post('/test-webhook', express.json({ type: 'application/json', limit: '50MB' }), async (req, res) => {
 console.log('request from thruuu is coming');
 if (req.body !== undefined && req.body.data !== undefined) {
   console.log(`event type:${req.body.data.eventType}`);
   console.log(`data: ${req.body.data}`);
 }
 // Return a response to acknowledge receipt of the event
 res.json({ received: true });
});
 
app.listen(8000, () => console.log('Running on port 8000'));

Results

Once your webhook receives a notification, you’ll get a response with the data in the following format:

{
    "eventType": "bulk-scrape",
    "id": "670a7acabcfc2555366172ea",
    "reference": "YOUR REF",
    "serps": [
        { /* Data for keyword 1 */ },
        { /* Data for keyword 2 */ }
    ]
}

Key elements:

Detailed SERP Data Object

Each object in serps includes:

{
  "id": "SERP_RESULT_ID",
  "query": "KEYWORD",
  "search_url": "Google Search URL",
  "device": "desktop",
  "hl": "en",
  "gl": "us",
  "search_engine": "google",
  "number_of_results": 11500000,
  "related_searches": [ /* Related searches */ ],
  "result": [ /* SERP results */ ],
  "keywords_title": [ /* Keywords in title */ ],
  "keywords_description": [ /* Keywords in description */ ],
  "similar_questions": { /* Similar questions */ },
  "similar_headings": [ /* Common headings */ ],
  "search_volume": { /* Search volume info */ }
}

For more details, see the documentation on individual fields.

The SERP API offers additional endpoints to retrieve all the SERP analysis and get a SERP by Id

Get List of SERPs

Endpoint

Description

This endpoint returns a list of SERP results with their basic metadata, including each SERP’s query, unique ID, and other summary details.

You can use the page and itemsPerPage parameters to paginate through the list of SERPs, allowing efficient handling of large datasets.

Query Parameters

Example Request

GET https://api.thruuu.com/api/v2/serps?page=1&itemsPerPage=50


Get Single SERP by ID

Endpoint

Description

This endpoint retrieves the detailed information for a single SERP by its unique ID.

The response includes all associated metadata, on-page details, and any analysis available for the specific SERP result.

Path Parameter

Example Request

GET https://api.thruuu.com/api/v2/serps/<ID>

Get started with the thruuu SERP API 

With thruuu, you will save a lot of time analyzing the SERP and get better SEO results by crafting the perfect content.
Don’t miss this opportunity.