TrackSERPs
Log in

API Quickstart

Start tracking search rankings and managing your keyword portfolios programmatically in under 5 minutes.

1. Create your API Key

Log into the TrackSERPs console and navigate to Settings → API → Keys (Owner or Admin role required). Click Create Key, select your desired scopes and restrictions, and copy your newly generated token.

Key prefixes: Live keys start with ts_live_ and interact with real search data and credit balances. Test keys start with ts_test_ and read synthetic demo data with zero credit consumption.

2. First Request with cURL

Make your first HTTP call to the /account endpoint to verify your token:

cURL
curl -X GET "https://api.trackserps.com/v1/account" \
  -H "Authorization: Bearer ts_live_your_api_key_here" \
  -H "Accept: application/json"

A successful response returns your account identifier, team name, active plan, and timezone:

Response (200 OK)
{
  "id": "acc_demo123",
  "name": "Acme Agency",
  "plan": "growth",
  "timezone": "America/New_York"
}

3. First Request with TypeScript / Node.js SDK

Install the official @trackserps/sdk package (zero runtime dependencies beyond Node 18+):

Terminal
pnpm add @trackserps/sdk

Use the typed client with automatic pagination and retry support:

index.ts
import { TrackSERPs } from "@trackserps/sdk";

const client = new TrackSERPs({
  apiKey: process.env.TRACKSERPS_API_KEY || "ts_live_your_api_key_here",
});

async function main() {
  // 1. Fetch account profile
  const account = await client.account.get();
  console.log(`Logged in as ${account.name} (Plan: ${account.plan})`);

  // 2. Fetch projects with auto-pagination
  for await (const project of client.projects.list()) {
    console.log(`Project: ${project.name} (${project.domain}) - ${project.keywords_count} keywords`);
  }
}

main().catch(console.error);

4. First Request with Python

Call the API from Python using standard requests:

trackserps_quickstart.py
import os
import requests

API_KEY = os.environ.get("TRACKSERPS_API_KEY", "ts_live_your_api_key_here")
BASE_URL = "https://api.trackserps.com/v1"

headers = {
    "Authorization": f"Bearer {API_KEY}",
    "Accept": "application/json",
}

# 1. Fetch account information
response = requests.get(f"{BASE_URL}/account", headers=headers)
response.raise_for_status()
account = response.json()
print(f"Logged in as {account['name']} (Plan: {account['plan']})")

# 2. Fetch projects
projects_res = requests.get(f"{BASE_URL}/projects", headers=headers)
projects_res.raise_for_status()
for project in projects_res.json()["projects"]:
    print(f"- {project['name']} ({project['domain']}): {project['keywords_count']} keywords")

Next Steps

API Quickstart · TrackSERPs API Docs