Skip to main content

Search overview

Getting Started

Authentication

Before making any requests, you'll need an API key. Include it in all requests as a header:

X-API-Key: your_api_key_here

Making Search Requests

The simplest way to use the API is to perform a basic Google search:

GET https://app.serpextractor.com/api/google?query=tesla cars

To get results for a specific country or language, combine location parameters:

GET https://app.serpextractor.com/api/google?query=restaurants&google_domain=google.fr&gl=fr&hl=fr

This will:

  • Use Google France
  • Show results relevant to France
  • Display results in French

Image Search Example

To search for images instead of web pages:

GET https://app.serpextractor.com/api/google?query=sunset&search_type=images

Best Practices

Location Handling

  1. First, use the locations endpoint to find the correct location identifier:
GET https://app.serpextractor.com/api/locations?location_contains=paris
  1. Then use the returned location in your search:
GET https://app.serpextractor.com/api/google?query=restaurants&location=Paris,Paris,Ile-de-France,France

Pagination

When you need more than the first page of results:

GET https://app.serpextractor.com/api/google?query=python programming&page=2

Note:

  • Start from page 1
  • Maximum of 100 pages, but depending on your query there may be less results
  • Google's 1000-result limit applies

Mobile-Specific Results

To get results as seen on mobile devices:

GET https://app.serpextractor.com/api/google?query=responsive websites&device=mobile

Usage Monitoring

Track Your Usage

Monitor your API usage with the daily requests endpoint:

GET https://app.serpextractor.com/api/daily-requests?start_date=2023-01-01&end_date=2023-01-31

Check Subscription Status

Verify your subscription details and how many requests you have left:

GET https://app.serpextractor.com/api/subscription

You can also check this information directly from your dasbhboard

Tips for Optimal Results

  1. Combine Location Parameters

    • Get the location using our location api before using it, otherwhise you may get invalid results if it's not in the format we provide with our locatiosn api
    • Alsonside the location parameter, you should:
      • Use a google domain from the same country if available, if not use the default google.com
      • Use gl with hl for better localization
      • Add cr and lr for more precise targeting
  2. Search Type Selection

    • Use main for general web results
    • Use news for recent articles
    • Use images for visual content
    • Use video for video content
  3. Device Optimization

    • Test across different devices if your use case requires it
    • Mobile results can differ significantly from desktop
  4. Rate Limiting

    • Monitor your daily usage
    • Stay within your subscription limits
    • Use pagination wisely

Common Use Cases

GET https://app.serpextractor.com/api/google?query=coffee shops&location=New York,New York,United States&device=mobile&search_type=main

News Monitoring

GET https://app.serpextractor.com/api/google?query=your-compnay-name&search_type=news&gl=us&hl=en

Image Research

GET https://app.serpextractor.com/api/google?query=product design&search_type=images&device=desktop

Error Handling

  • Always check HTTP status codes
  • Monitor your rate limits through the daily requests endpoint
  • Keep your API key secure

Support

If you need to check available locations or have issues with search results:

  1. Use the locations endpoint to verify location data
  2. Ensure your API key is valid
  3. Check your subscription status for any limitations

This API is designed to provide flexible access to Google search results while respecting various location and device contexts. Start with basic queries and gradually incorporate more parameters as needed for your specific use case.