Query with Pagination

This documentation provides an example of how to send a GET request to the SERP API with pagination parameters and interpret the response.

API Request with Pagination

To send a GET request to the SERP API for a news-related query with pagination, you can use the following:

  • Bash

  • Javascript

  • Python

  • Go

curl -L 'https://serp-api.netnut.io/search?device=desktop&q=news&num=10&start=10' \
-H 'Accept: application/json' \
-H 'Authorization: Basic base64(username:password)'

In this request, we've added two pagination parameters:

  • num: This optional parameter defines the result offset, skipping the given number of results. It's used for pagination. For example, num=10 will skip the first 10 results.

  • start: This optional parameter defines the maximum number of results to return. For example, to return the second page, start=10 will return 10 results starting from the 11th result.

API Response

The API will respond with a JSON object containing the search results for the specified pagination parameters. Here is an example of the response for the second page of results (skipping the first 10 results):

n the response, you'll see that the currentPage indicates the current page of results, and the nextPage and nextPageLink provide information about the next page of results. The nextPageStart parameter specifies the starting position for the next page of results.

This demonstrates how to use the num and start parameters for pagination in the SERP API. You can adjust these parameters in your GET request to retrieve the desired page of results.

{
    "url": "https://www.google.com/search?q=news&num=10&start=10",
    "general": {
        "searchEngine": "google",
        "resultsCount": 25270000000,
        "searchTime": 0.38,
        "mobile": false,
        "searchType": "text",
        "pageTitle": "news - Google Search",
        "timestamp": "2023-10-01T12:21:09.363Z"
    },
    "input": {
        "originalUrl": "https://www.google.com/search?q=news&num=10&start=10",
        "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36",
        "jobId": "3282d83a-7ec9-4a51-b49f-107519ea5f5a"
    },
    "organic": [
        {
            "title": "Yahoo News - Latest News & Headlines",
            "description": "7 hours ago — The latest news and headlines from Yahoo! News. Get breaking news stories and in-depth coverage with videos and photos.",
            "link": "https://news.yahoo.com/",
            "displayLink": "https://news.yahoo.com",
            "rank": 1,
            "globalRank": 1
        },
        {
            "title": "U.S. and World News Headlines",
            "description": "7 minutes ago — NPR news, audio, and podcasts. Coverage of breaking stories, national and world news, politics, business, science, technology, and extended coverage of ...",
            "link": "https://www.npr.org/sections/news/",
            "displayLink": "https://www.npr.org › sections › news",
            "rank": 2,
            "globalRank": 2
        },
        {
            "title": "Home - BBC News",
            "description": "Visit BBC News for up-to-the-minute news, breaking news, video, audio and feature stories. BBC News provides trusted World and UK news as well as local and ...",
            "link": "https://www.bbc.com/news",
            "displayLink": "https://www.bbc.com › news",
            "rank": 3,
            "globalRank": 3
        },
        {
            "title": "6abc Action News - WPVI Philadelphia, Pennsylvania, New ...",
            "description": "5 hours ago — Action News and 6abc.com are Philadelphia's source for breaking news, weather and video, covering Philadelphia, Pa., NJ, and Delaware.",
            "link": "https://6abc.com/",
            "displayLink": "https://6abc.com",
            "rank": 4,
            "globalRank": 4
        },
        {
            "title": "Reuters | Breaking International News & Views",
            "description": "4 hours ago — Find latest news from every corner of the globe at Reuters.com, your online source for breaking international news coverage.",
            "link": "https://www.reuters.com/",
            "displayLink": "https://www.reuters.com",
            "rank": 5,
            "globalRank": 5
        },
        {
            "title": "FOX 29 News Philadelphia",
            "description": "9 hours ago — Philadelphia news, weather, traffic and sports from FOX 29, serving Pennsylvania, New Jersey and Delaware. Watch breaking news live or see the latest videos ...",
            "link": "https://www.fox29.com/",
            "displayLink": "https://www.fox29.com",
            "rank": 6,
            "globalRank": 6
        },
        {
            "title": "Inquirer.com: Philadelphia local news, sports, jobs, cars, homes",
            "description": "6 hours ago — Keep reading by creating a free account or signing in. Sign in/Sign up; Subscribe; Support local news.",
            "link": "https://www.inquirer.com/",
            "displayLink": "https://www.inquirer.com",
            "rank": 7,
            "globalRank": 7
        },
        {
            "title": "The Washington Post - Breaking news and latest headlines ...",
            "description": "6 hours ago — Breaking news, live coverage, investigations, analysis, video, photos and opinions from The Washington Post. Subscribe for the latest on U.S. and ...",
            "link": "https://www.washingtonpost.com/",
            "displayLink": "https://www.washingtonpost.com",
            "rank": 8,
            "globalRank": 8
        },
        {
            "title": "UN News | Global perspective Human stories",
            "description": "UN News produces daily news content in Arabic, Chinese, English, French ... news features and analyses on a variety of social, political, economic ...",
            "link": "https://news.un.org/en/",
            "displayLink": "https://news.un.org › ...",
            "rank": 9,
            "globalRank": 9
        },
        {
            "title": "The New York Times - Breaking News, US News, World News ...",
            "description": "11 hours ago — Live news, investigations, opinion, photos and video by the journalists of The New York Times from more than 150 countries around the world.",
            "link": "https://www.nytimes.com/",
            "displayLink": "https://www.nytimes.com",
            "rank": 10,
            "globalRank": 10
        }
    ]
}

Last updated

Copyright NetNut LTD