Doc categories

Rank Checker

API Integration (Open API)

This document describes the SerpUpdate Open APIs in detail for customers who want to integrate. You can use these APIs to create keyword rank-checking tasks, look up location and language codes, and automatically receive results via Webhook.

General Information

  • Base URL: https://app.serpupdate.com
  • API Version: v1.2

1. Workflow

  1. Call the Get Locations and Get Languages APIs to obtain the locationCode and languageCode.
  2. Call the Create Task API with the keyword, location, and language information to receive a taskId.
  3. Wait for the system to process. When the result is ready, the system will call Ping Back (Webhook) to your server. Alternatively, you can proactively call the Get Task Result API with the taskId to retrieve the result.

2. Authentication

All requests must include the API Key in the header. Customers create an account on app.serpupdate.com. An API Key is issued individually for each account.

Required header:
X-API-KEY: <your_api_key>

Security

Never share your API Key with any third party. Contact support if you need it reissued.

3. Common Response Structure

All APIs return the same outer JSON wrapper structure:

Field Type Description
isSuccess Boolean Overall status of the request (true/false)
errorCode String | null Error code (null on success)
message String | null Detailed error message (null on success)
content Object | null Returned data (varies by API)

Error Codes

HTTP errorCode Description
200 null Success
400 BAD_REQUEST Invalid request data (missing required field, wrong format)
401 UNAUTHORIZED API Key is invalid or was not provided
429 RATE_LIMIT Request limit exceeded
500 INTERNAL_ERROR System error, please try again later

4. Endpoints


API #1: Create Task

Creates a task to check keyword rankings on a search engine. Each request can submit multiple keywords at once.

Endpoint: POST /api/v1/open-api/create-task

Request Body

Parameter Type Required Description
deviceCode String ✔ Yes Device code. E.g. desktop, mobile, tablet
locationCode Number ✔ Yes Location code (obtained from the Get Locations API)
languageCode String ✔ Yes Language code (obtained from the Get Languages API). E.g. vi, en
searchEngineCode String ✔ Yes Search engine code. E.g. GOOGLE, BING
keywords Array ✔ Yes List of keywords to check (see the Keyword Object table)

Keyword Object

Parameter Type Required Description
cstmKeywordId String ✔ Yes A customer-defined keyword ID (used to reconcile results)
keyword String ✔ Yes The keyword whose ranking is being checked

Response, content.tasks[]

Field Type Description
taskId Number The task ID (used for the Get Task Result API or received via Ping Back)
cstmKeywordId String The keyword ID submitted by the customer
keyword String The submitted keyword
isSuccess Boolean Task creation status for this keyword (true/false)

cURL & Response Example

curl --location 'https://app.serpupdate.com/api/v1/open-api/create-task'
  --header 'X-API-KEY: <your_api_key>'
  --header 'Content-Type: application/json'
  --data '{
    "deviceCode": "desktop",
    "locationCode": 2704,
    "languageCode": "vi",
    "searchEngineCode": "GOOGLE",
    "keywords": [
      { "cstmKeywordId": "1", "keyword": "Dien thoai gia re" },
      { "cstmKeywordId": "2", "keyword": "Dien thoai dep" }
    ]
  }'
{
  "errorCode": null,
  "content": {
    "tasks": [
      { "taskId": 4, "cstmKeywordId": "1", "keyword": "Dien thoai gia re", "isSuccess": true },
      { "taskId": 5, "cstmKeywordId": "2", "keyword": "Dien thoai dep", "isSuccess": true }
    ]
  },
  "message": null,
  "isSuccess": true
}

API #2: Get Locations

Looks up the list of locations supported by the system. Results are paginated and support open search by name.

Endpoint: POST /api/v1/open-api/locations

Request Body

Parameter Type Description
name String Optional. The location name to search for (e.g. “Ho Chi” returns “Ho Chi Minh,Vietnam”)
page Number Optional. Page number (starting from 0). Default: 0
size Number Optional. Number of results per page. Default: 10

Response, content.content[] (Location Object)

Field Type Description
locationCode Number Location code (used for locationCode in Create Task)
locationName String Location name. E.g. “Vietnam”, “An Giang,Vietnam”
locationCodeParent Number | null Parent location code (null if it is a country)
countryIsoCode String ISO country code (VN, US, JP, …)
locationType String Type: Country, Province, City, …

Response Example

{
  "errorCode": null,
  "content": {
    "content": [
      {
        "locationCode": 2704,
        "locationName": "Vietnam",
        "locationCodeParent": null,
        "countryIsoCode": "VN",
        "locationType": "Country"
      }
    ],
    "totalElements": 245,
    "totalPages": 25,
    "numberOfElements": 10
  },
  "message": null,
  "isSuccess": true
}

API #3: Get Languages

Retrieves the list of supported language codes. No parameters are required.

Endpoint: POST /api/v1/open-api/languages

curl --location --request POST 'https://app.serpupdate.com/api/v1/open-api/languages'
  --header 'X-API-KEY: <your_api_key>'
  --header 'Content-Type: application/json'
  --data ''

API #4: Get Task Result

Retrieves the SERP ranking results of a created task using its taskId.

Endpoint: POST /api/v1/open-api/task-result

Request Body

You must pass the required parameter: { "taskId": 4 }

Response, content

Field Type Description
taskId Number The task ID
serpItems Array List of SERP results (SerpItem Object)
aiOverview Object | null AI Overview content from Google (AiOverview Object). Null if not present.

SerpItem Object (serpItems)

Field Type Description
rank Number The ranking of the result on the SERP (1, 2, 3…)
url String The full URL of the result
domain String Domain name. E.g. “tiki.vn”
title String The title of the result
description String The snippet description of the result

AiOverview Object

Field Type Description
markdown String AI Overview content in Markdown format
references Array List of referenced sources (same structure as the SerpItem Object)

Response Example

{
  "errorCode": null,
  "content": {
    "taskId": 4,
    "serpItems": [
      {
        "rank": 1,
        "url": "https://www.thegioididong.com/dtdd",
        "domain": "thegioididong.com",
        "title": "Dien thoai gia re - The Gioi Di Dong",
        "description": "Danh sach dien thoai gia re..."
      }
    ],
    "aiOverview": {
      "markdown": "## Dien thoai gia re tot nhat...",
      "references": [
        { "rank": 1, "url": "https://...", "domain": "...", "title": "...", "description": "..." }
      ]
    }
  },
  "message": null,
  "isSuccess": true
}

If the task is not yet complete, serpItems may be empty. Please try again later or use the Webhook Ping Back to receive an automatic notification.


API #5: Ping Back (Webhook)

Instead of continuously polling Get Task Result, you can register an Endpoint (callback URL) with the SerpUpdate team.

As soon as a task completes, the system automatically makes an HTTP POST call to deliver the result to your server.

Requirements on Your Server

  • Provide an HTTP POST endpoint that can receive a JSON body.
  • The endpoint must return HTTP 200 OK to confirm that the data was received. Otherwise, the system may retry.

Payload the System Sends to You

The JSON data sent directly to you has exactly the same structure as the content section of the Get Task Result API.

POST https://your-server.com/your-callback-endpoint
Content-Type: application/json

{
  "taskId": 4,
  "serpItems": [
    {
      "rank": 1,
      "url": "https://...",
      "domain": "...",
      "title": "...",
      "description": "..."
    }
  ],
  "aiOverview": {
    "markdown": "## ...",
    "references": []
  }
}

Handling Example (Java Spring Boot)

@PostMapping("/your-callback-endpoint")
public ResponseEntity receivePingBack(@RequestBody TaskOpenApiResponse payload) {
    // Process the data: payload.getTaskId(), payload.getSerpItems()...
    log.info("Received task result: {}", payload);

    // Return 200 OK so the system records it as successful
    return ResponseEntity.ok().build();
}

See also