For the complete documentation index, see llms.txt. This page is also available as Markdown.

Keyword Rankings

API Playground is ScraperAPI's request builder for testing and configuring scraping requests. In this tutorial, you will use the API Playground to track Google Search rankings for any keyword list. By the end, you will have daily SERP snapshots with rank, SERP features, and metadata for every keyword you monitor, so you can catch rank drops and competitor moves in your own data pipeline.


Step 1: Configure the Google Search endpoint

Open the API Playground from the left sidebar.

  1. Select scraping method: Structured Data Endpoints.

  2. In the endpoint dropdown, select Google Search.

  3. Enter query best running shoes. Set Country code to us.

  4. Review the Summary panel on the right to understand the cost of the job before you run it.

  5. Scroll down to the generated code and click Try it.

The Playground runs the request and shows the response inline. Each entry in organic_results includes position, title, link, snippet, and displayed_link. The response also includes related_questions, related_searches, and pagination for deeper keyword analysis.

Use the language dropdown to switch to Python, Node.js, PHP, Ruby, or Java. Click Copy to clipboard to run the request in your own terminal instead.

Step 2: Additional options and filters

Use Additional options & filters to fine-tune your request. The Playground adds the relevant parameters to the generated code automatically.

  • Country code adds country_code. Targets a specific country's Google Search results.

  • Domain adds domain. Sets the Google domain to search (e.g. co.uk, com.au).

  • Time based search adds time_period. Filters results by recency — past 24 hours, past week, past month, or past year.

  • Output format adds output_format. Returns results as json (default) or markdown for LLM pipelines.

  • UULE adds uule. Encodes a specific city for local search results. Generate a UULE value using a UULE encoder tool.

  • Number of results adds num. Sets how many organic results to return per page.

  • Additional parameters adds any other supported ScraperAPI parameters, separated by &.

Some parameters increase the cost per request. Check the Summary panel before committing to a configuration at scale.

Step 3: Save snapshots with date prefixes

To track rankings over time, save each response as a dated file. This lets you load any two dates and diff the organic_results array by position.

Step 4: Batch across keywords and locations

Switch the scraping method to Async in the Playground and paste your queries as full structured endpoint URLs, one per line:

The response returns a statusUrl per job that you can use to track progress.

Step 5: Schedule daily snapshots

To run your batch automatically on a recurring schedule, add it to your crontab. The example below runs every day at 6am.


More API tutorials

Last updated