### Query with Localization Example Source: https://help.netnut.io/netnut-documentation/~/revisions/opZiiwKf3Lsw9UUdqX4a/netnut-scraper-apis/serp-api/google-search/api-example/query-with-localization.md This example demonstrates how to make a GET request to the SERP API with localization parameters to specify the Google domain, country, and language for search results. ```APIDOC ## GET /search ### Description Fetches search results tailored to specific localization settings, including Google domain, country, and language. ### Method GET ### Endpoint /search ### Query Parameters - **q** (string) - Required - The search query. - **gl** (string) - Optional - The country code for the Google search (e.g., `us`, `uk`, `fr`). - **hl** (string) - Optional - The language code for the Google search (e.g., `en`, `es`, `fr`). - **googleDomain** (string) - Optional - The Google domain to use (e.g., `www.google.com`). - **device** (string) - Optional - The device type for the search (e.g., `desktop`). ### Request Example ```bash curl -L 'https://serp-api.netnut.io/search?device=desktop&q=news&gl=us&hl=en' \ -H 'Accept: application/json' \ -H 'Authorization: Basic base64(username:password)' ``` ### Response #### Success Response (200) - **search_parameters** (object) - Contains the parameters used for the search. - **organic_results** (array) - A list of organic search results. - **related_searches** (array) - A list of related searches. ``` -------------------------------- ### Dynamic Documentation Query Example Source: https://help.netnut.io/netnut-documentation/netnut-proxies/mobile-proxies/curl-request-parameters.md Demonstrates how to query the documentation dynamically using an HTTP GET request with 'ask' and optional 'goal' query parameters. This is useful for retrieving information not explicitly present on the page. ```http GET https://help.netnut.io/netnut-documentation/netnut-proxies/mobile-proxies/curl-request-parameters.md?ask=&goal= ``` -------------------------------- ### Example GET Request for AI Query Source: https://help.netnut.io/netnut-documentation/~/revisions/opZiiwKf3Lsw9UUdqX4a/netnut-scraper-apis/serp-api/google-search/api-example/query-with-pagination.md Demonstrates the structure of an HTTP GET request to query the Netnut documentation. Use the 'ask' parameter for your specific question and the optional 'goal' parameter to guide the AI's response. ```http GET https://help.netnut.io/netnut-documentation/~/revisions/opZiiwKf3Lsw9UUdqX4a/netnut-scraper-apis/serp-api/google-search/api-example/query-with-pagination.md?ask=&goal= ``` -------------------------------- ### Querying Documentation with `ask` and `goal` Parameters Source: https://help.netnut.io/netnut-documentation/netnut-scraper-apis/serp-api/google-scraper/google-flights/response-fields.md Perform an HTTP GET request to query the documentation dynamically. Use the `ask` parameter for specific questions and the optional `goal` parameter to guide the AI towards a broader objective. ```bash GET https://help.netnut.io/netnut-documentation/netnut-scraper-apis/serp-api/google-scraper/google-flights/response-fields.md?ask=&goal= ``` -------------------------------- ### Python Example: Using Callback URL for Google Search Source: https://help.netnut.io/netnut-documentation/~/revisions/opZiiwKf3Lsw9UUdqX4a/netnut-scraper-apis/serp-api/google-search/api-example/callback-mechanism.md This Python snippet demonstrates how to initiate a Google search and specify a callback URL to receive the results. Ensure you have the necessary libraries installed and replace placeholders with your actual values. ```python import requests import json # --- Configuration --- API_KEY = "YOUR_API_KEY" SEARCH_QUERY = "netnut" CALLBACK_URL = "YOUR_CALLBACK_URL" # --- API Endpoint --- url = "https://serpapi.com/search.json" # --- Parameters --- params = { "q": SEARCH_QUERY, "api_key": API_KEY, "output": "json", "callback": CALLBACK_URL } # --- Make the request --- try: response = requests.get(url, params=params) response.raise_for_status() # Raise an exception for bad status codes # The response itself might not contain the results directly when using callback # It usually confirms the request was received. print("Search request submitted successfully.") print(f"Callback URL: {CALLBACK_URL}") print(f"Response Status Code: {response.status_code}") # print(f"Response Body: {response.text}") # Uncomment to see the confirmation response except requests.exceptions.RequestException as e: print(f"An error occurred: {e}") # --- Expected Callback Handling (on your server) --- # Your server needs to be set up to listen for POST requests at YOUR_CALLBACK_URL. # Example structure of the POST data received by your callback URL: # { # "search_id": "some_unique_id", # "query": "netnut", # "results": { # "organic_results": [ # { ... }, # { ... } # ], # "... other sections ..." # } # } ``` -------------------------------- ### Example cURL Request with Callback Source: https://help.netnut.io/netnut-documentation/netnut-scraper-apis/serp-api/google-scraper/google-search/callback-mechanism.md This example demonstrates how to make a request using cURL, including the `callbackUrl` parameter and authorization header. ```bash curl --location 'https://serp-api.netnut.io/search?hl=en&gl=us&q=netnut&callbackUrl=https://my-api.com' \ --header 'Authorization: Basic base64(username:password)' ``` -------------------------------- ### Query Documentation with GET Request Source: https://help.netnut.io/netnut-documentation/netnut-scraper-apis/serp-api/google-scraper/google-places/response-fields.md Use this GET request to ask questions about the documentation. Include your specific question in the 'ask' parameter and an optional broader goal in the 'goal' parameter. ```bash GET https://help.netnut.io/netnut-documentation/netnut-scraper-apis/serp-api/google-scraper/google-places/response-fields.md?ask=&goal= ``` -------------------------------- ### Query Documentation with GET Request Source: https://help.netnut.io/netnut-documentation/netnut-scraper-apis/website-unblocker.md Perform an HTTP GET request to query the documentation dynamically. Use the `ask` parameter for your question and optionally the `goal` parameter to tailor the answer. ```http GET https://help.netnut.io/netnut-documentation/netnut-scraper-apis/website-unblocker.md?ask=&goal= ``` -------------------------------- ### Query Documentation with GET Request Source: https://help.netnut.io/netnut-documentation/netnut-scraper-apis/serp-api/google-scraper/google-shopping/search-with-shoprs.md Use this GET request to query the documentation dynamically. Include your specific question in the 'ask' parameter and an optional broader goal in the 'goal' parameter. ```http GET https://help.netnut.io/netnut-documentation/netnut-scraper-apis/serp-api/google-scraper/google-shopping/search-with-shoprs.md?ask=&goal= ``` -------------------------------- ### Query Documentation with GET Request Source: https://help.netnut.io/netnut-documentation/netnut-scraper-apis/llm-scraper/google-ai-mode/response-fields.md Use this GET request to ask questions about the documentation. Include your specific question in the 'ask' parameter and an optional broader goal in the 'goal' parameter. ```http GET https://help.netnut.io/netnut-documentation/netnut-scraper-apis/llm-scraper/google-ai-mode/response-fields.md?ask=&goal= ``` -------------------------------- ### Querying Documentation with GET Request Source: https://help.netnut.io/netnut-documentation/netnut-scraper-apis/serp-api/baidu-search/api-example.md Use this GET request to query the documentation dynamically. Include your question in the 'ask' parameter and optionally specify your broader goal in the 'goal' parameter. ```http GET https://help.netnut.io/netnut-documentation/netnut-scraper-apis/serp-api/baidu-search/api-example.md?ask=&goal= ``` -------------------------------- ### Ruby Example: Setting up a Callback URL Source: https://help.netnut.io/netnut-documentation/~/revisions/opZiiwKf3Lsw9UUdqX4a/netnut-scraper-apis/serp-api/google-search/api-example/callback-mechanism.md This Ruby example demonstrates how to use the `callback_url` parameter with the Google Search API. This enables asynchronous retrieval of search results by sending them to a predefined endpoint. ```ruby require 'google_search_results' params = { "q" => "Top 10 Anime", "location" => "India", "google_domain" => "google.co.in", "callback_url" => "https://example.com/my_callback_endpoint", "api_key" => "YOUR_SERPAPI_KEY", } search = GoogleSearchResults.new(params) results = search.get_hash ``` -------------------------------- ### Query Documentation with Agent Instructions Source: https://help.netnut.io/netnut-documentation/netnut-scraper-apis/serp-api/google-scraper/google-search.md Use this GET request to ask questions about the documentation. The 'ask' parameter contains your specific question, and the optional 'goal' parameter provides context for the desired outcome. ```http GET https://help.netnut.io/netnut-documentation/netnut-scraper-apis/serp-api/google-scraper/google-search.md?ask=&goal= ``` -------------------------------- ### API Request with Pagination Source: https://help.netnut.io/netnut-documentation/~/revisions/opZiiwKf3Lsw9UUdqX4a/netnut-scraper-apis/serp-api/google-search/api-example/query-with-pagination.md This example demonstrates how to send a GET request to the SERP API for a news-related query with pagination parameters like 'num' and 'start'. ```APIDOC ## GET /search ### Description Sends a GET request to the SERP API to retrieve search results with pagination. ### Method GET ### Endpoint /search ### Query Parameters - **device** (string) - Optional - Specifies the device type (e.g., desktop). - **q** (string) - Required - The search query. - **num** (integer) - Optional - Defines the result offset, skipping the given number of results. Used for pagination. For example, num=10 will skip the first 10 results. - **start** (integer) - Optional - 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. ### Request Example ```bash 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)' ``` ### Response #### Success Response (200) - **currentPage** (integer) - The current page of results. - **nextPage** (string) - Information about the next page of results. - **nextPageLink** (string) - The URL for the next page of results. - **nextPageStart** (integer) - The starting position for the next page of results. #### Response Example ```json { "search_parameters": { "q": "news", "num": 10, "start": 10 }, "search_information": { "total_results": "1,234,567", "time_taken_displayed": 0.50, "total_time_taken": 0.75, "spelling_fix": "news" }, "organic_results": [ { "position": 11, "title": "News Article 1", "link": "http://example.com/news1", "snippet": "This is a snippet for news article 1." }, { "position": 12, "title": "News Article 2", "link": "http://example.com/news2", "snippet": "This is a snippet for news article 2." } ], "pagination": { "current_page": 2, "next_page": "https://serp-api.netnut.io/search?q=news&num=10&start=20", "next_page_start": 20 } } ``` ``` -------------------------------- ### Example Google Hotels Search Request Source: https://help.netnut.io/netnut-documentation/netnut-scraper-apis/serp-api/google-scraper/google-hotels.md An example GET request to the Google Hotels API with specified search parameters. ```http https://serp-api.netnut.io/search?hl=en&q=uk&gl=us&engine=google_hotels&adults=1&checkInDate=2026-03-26&checkOutDate=2026-03-28 ``` -------------------------------- ### Basic Callback Mechanism Example Source: https://help.netnut.io/netnut-documentation/~/revisions/opZiiwKf3Lsw9UUdqX4a/netnut-scraper-apis/serp-api/google-search/api-example/callback-mechanism.md This example demonstrates how to set up a basic callback mechanism for receiving Google Search API results. Ensure you have the necessary parameters like `callback_url` and `callback_method` configured. ```bash curl "https://serpapi.com/search.json?q=google+search+api&location=Paris&callback_url=http://example.com/callback&callback_method=POST" ``` -------------------------------- ### Google Flights API Example Request Source: https://help.netnut.io/netnut-documentation/netnut-scraper-apis/serp-api/google-scraper/google-flights.md An example GET request demonstrating how to query the Google Flights API with various parameters. ```url https://serp-api.netnut.io/search?engine=google_flights&flightFrom=ny&flightTo=lax&departureTime=2026-06-01&returnTime=2026-06-05&adults=1&hl=en&gl=us ``` -------------------------------- ### Node.js Example: Setting up a Callback URL Source: https://help.netnut.io/netnut-documentation/~/revisions/opZiiwKf3Lsw9UUdqX4a/netnut-scraper-apis/serp-api/google-search/api-example/callback-mechanism.md This Node.js example demonstrates how to set up an Express server to handle incoming callback requests from the Google Search API. The server listens for POST requests on the '/callback' endpoint and logs the received JSON data. ```javascript const express = require('express'); const app = express(); const port = 3000; app.use(express.json()); app.post('/callback', (req, res) => { console.log(req.body); res.sendStatus(200); }); app.listen(port, () => { console.log(`Callback server listening at http://localhost:${port}`); }); ``` -------------------------------- ### Query Search API Example Source: https://help.netnut.io/netnut-documentation/~/revisions/opZiiwKf3Lsw9UUdqX4a/netnut-scraper-apis/serp-api/google-search/api-example/query-search.md This snippet demonstrates how to make a GET request to the SERP API for a news-related query and includes an example of the expected JSON response. ```APIDOC ## GET /search ### Description Sends a GET request to the SERP API to retrieve search results for a given query. ### Method GET ### Endpoint https://serp-api.netnut.io/search ### Parameters #### Query Parameters - **device** (string) - Optional - Specifies the device type (e.g., desktop). - **q** (string) - Required - The search query. #### Request Headers - **Accept**: application/json - **Authorization**: Basic base64(username:password) ### Response #### Success Response (200) Returns a JSON object containing search results, general information, and input details. #### Response Example { "url": "https://www.google.com/search?q=news", "general": { "searchEngine": "google", "resultsCount": 25270000000, "searchTime": 0.39, "mobile": false, "searchType": "text", "pageTitle": "news - Google Search", "timestamp": "2023-10-01T08:20:04.683Z" }, "input": { "originalUrl": "https://www.google.com/search?q=news", "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": "8c84df48-472c-413a-ab5e-e27064396ed5" }, "organic": [ { "title": "Google News", "description": "3 hours ago — Comprehensive up-to-date news coverage, aggregated from sources all over the world by Google News.", "link": "https://news.google.com/", "displayLink": "https://news.google.com", "rank": 1, "globalRank": 1 } ] } ``` -------------------------------- ### Python Example: Setting up a Callback URL Source: https://help.netnut.io/netnut-documentation/~/revisions/opZiiwKf3Lsw9UUdqX4a/netnut-scraper-apis/serp-api/google-search/api-example/callback-mechanism.md This Python code snippet illustrates how to set up a callback URL for receiving Google Search API results asynchronously. Ensure your server is configured to handle POST requests at the specified callback endpoint. ```python import requests # Your Netnut API key api_key = "YOUR_API_KEY" # Target URL for Google Search API url = "https://api.netnut.io/v1/google/search" # Parameters for the search query params = { "api_key": api_key, "query": "best python ide", "callback": "YOUR_CALLBACK_URL" # Replace with your actual callback URL } # Send the request to the API response = requests.post(url, json=params) # Check the response status if response.status_code == 200: print("Request successful. Results will be sent to your callback URL.") else: print(f"Error: {response.status_code}") print(response.text) ``` -------------------------------- ### Python Example: Setting up a Callback URL Source: https://help.netnut.io/netnut-documentation/~/revisions/opZiiwKf3Lsw9UUdqX4a/netnut-scraper-apis/serp-api/google-search/api-example/callback-mechanism.md This Python snippet demonstrates how to configure a callback URL when making a request to the Netnut API. The API will send the search results to this specified URL upon completion. ```python import requests api_key = "YOUR_API_KEY" search_query = "netnut scraper api" callback_url = "YOUR_CALLBACK_URL" url = f"https://api.netnut.io/v1/google/search?api_key={api_key}&query={search_query}&callback_url={callback_url}" response = requests.get(url) if response.status_code == 200: print("Request successful. Results will be sent to your callback URL.") else: print(f"Error: {response.status_code} - {response.text}") ``` -------------------------------- ### Baidu Search with Localization Example Source: https://help.netnut.io/netnut-documentation/netnut-scraper-apis/serp-api/baidu-search/api-example/query-with-localization.md This example demonstrates how to make a GET request to the SERP API to perform a Baidu search with a specified interface language using the `ct` parameter. ```APIDOC ## GET /search/get-html ### Description Performs a Baidu search and allows localization of the interface language. ### Method GET ### Endpoint `/search/get-html` ### Parameters #### Query Parameters - **siteType** (string) - Required - Specifies the search engine, should be `baidu`. - **wd** (string) - Required - The search query. - **ct** (integer) - Optional - Controls the UI language for the Baidu search. - `0`: All languages (default) - `1`: Simplified Chinese - `2`: Traditional Chinese - **rawHtml** (integer) - Optional - Set to `1` to receive raw HTML in the response. #### Request Body This endpoint does not accept a request body. ### Request Example ```bash curl --location 'https://serp-api.netnut.io/search/get-html?siteType=baidu&wd=%E6%B6%88%E6%81%AF&ct=1&rawHtml=1' \ --header 'Authorization: Basic base64(username:password)' ``` ### Response #### Success Response (200) Returns a JSON object containing search results, input parameters, and optionally raw HTML. - **url** (string) - The URL of the Baidu search results page. - **engine** (string) - The search engine used (e.g., `baidu`). - **general** (object) - General information about the search. - **id** (string) - Unique identifier for the search. - **timestamp** (string) - The time the search was performed. - **baidu_url** (string) - The specific Baidu URL generated for the search. - **resultscount** (integer) - The total number of results found. - **input** (object) - The input parameters used for the search. - **wd** (string) - The search query. - **ct** (string) - The localization parameter used. - **device** (string) - The device type used for the search. - **engine** (string) - The search engine used. - **organic_results** (array) - A list of organic search results. - **position** (integer) - The position of the result on the page. - **title** (string) - The title of the search result. - **snippet** (string) - A short description of the search result. - **link** (string) - The URL of the search result. - **displayed_link** (string) - The displayed URL in the search results. - **tracking_link** (string) - A tracking link for the result. - **thumbnail** (string) - A thumbnail image URL for the result. - **pagination** (object) - Pagination information for the search results. - **current** (integer) - The current page number. - **next** (string) - The URL for the next page of results. - **other_pages** (object) - Links to other pages of results. - **html** (string) - The raw HTML of the search results page, if `rawHtml` parameter is set to `1`. #### Response Example ```json { "url": "https://www.baidu.com/s?wd=%E6%B6%88%E6%81%AF&ct=1", "engine": "baidu", "general": { "id": "string", "timestamp": "2025-08-20 14:16:24 UTC", "baidu_url": "https://www.baidu.com/s?wd=%E6%B6%88%E6%81%AF&ct=1", "resultscount": 0 }, "input": { "wd": "消息", "ct": "1", "device": "desktop", "engine": "baidu" }, "organic_results": [ { "position": 1, "title": "string", "snippet": "string", "link": "string", "displayed_link": "string", "tracking_link": "string", "thumbnail": "string" } ], "pagination": { "current": 1, "next": "string", "other_pages": { "2": "string", "3": "string" } }, "html": "string" } ``` ``` -------------------------------- ### PHP Example: Setting up a Callback URL Source: https://help.netnut.io/netnut-documentation/~/revisions/opZiiwKf3Lsw9UUdqX4a/netnut-scraper-apis/serp-api/google-search/api-example/callback-mechanism.md This PHP code illustrates how to create a simple callback endpoint to receive and process data from the Google Search API. It reads the raw POST data, decodes it from JSON, and outputs it. ```php ``` -------------------------------- ### cURL Setup with Country Targeting Source: https://help.netnut.io/netnut-documentation/netnut-proxies/residential-proxies/initial-setup.md Specify a country for your proxy by appending its two-letter code to the username. For example, 'nl' for the Netherlands. ```bash curl -x USERNAME-res-nl:PASSWORD@gw.netnut.net:5959 "example.site.com" ``` -------------------------------- ### Pagination Navigation Data Example Source: https://help.netnut.io/netnut-documentation/netnut-scraper-apis/serp-api/google-scraper/google-news/response-fields.md Navigation data for moving between pages of results, including links, start offsets, and page numbers. ```json "pagination": { "nextPageLink": "https://www.google.com/search?q=ai&tbm=nws&start=10", "nextPageStart": 10, "currentPage": 1, "nextPage": 2, "otherPages": { "2": "https://www.google.com/search?q=ai&tbm=nws&start=10", "3": "https://www.google.com/search?q=ai&tbm=nws&start=20" } } ``` -------------------------------- ### Query Documentation with Ask and Goal Parameters Source: https://help.netnut.io/netnut-documentation/~/revisions/opZiiwKf3Lsw9UUdqX4a/netnut-scraper-apis/website-unblocker.md Use this GET request to ask questions about the documentation. The 'ask' parameter is for your specific question, and 'goal' is optional for broader context. ```http GET https://help.netnut.io/netnut-documentation/~/revisions/opZiiwKf3Lsw9UUdqX4a/netnut-scraper-apis/website-unblocker.md?ask=&goal= ``` -------------------------------- ### Google Places API Example Request Source: https://help.netnut.io/netnut-documentation/netnut-scraper-apis/serp-api/google-scraper/google-places.md Demonstrates a basic GET request to the Google Places API endpoint with essential parameters. ```http https://serp-api.netnut.io/search?engine=google_places&q=coffee&gl=us&hl=en ``` -------------------------------- ### Google News API Example Request Source: https://help.netnut.io/netnut-documentation/netnut-scraper-apis/serp-api/google-scraper/google-news.md Demonstrates a typical GET request to the Google News API endpoint with common parameters. ```http https://serp-api.netnut.io/search?engine=google_news&q=ai&hl=en&gl=us&start=20&rawHtml=1 ``` -------------------------------- ### Python Example: Setting up a Callback URL Source: https://help.netnut.io/netnut-documentation/~/revisions/opZiiwKf3Lsw9UUdqX4a/netnut-scraper-apis/serp-api/google-search/api-example/callback-mechanism.md This Python code demonstrates how to set up a callback URL when making a request to the Google Search API. The `callback_url` parameter specifies the endpoint where the search results will be sent. ```python from serpapi import GoogleSearch params = { "q": "Top 10 Anime", "location": "India", "google_domain": "google.co.in", "callback_url": "https://example.com/my_callback_endpoint", "api_key": "YOUR_SERPAPI_KEY" } search = GoogleSearch(params) results = search.get_dict() ``` -------------------------------- ### Google News Pagination Example Source: https://help.netnut.io/netnut-documentation/netnut-scraper-apis/serp-api/google-scraper/google-news/features.md Control the page of results with the 'start' parameter. Google News typically returns 10 results per page. ```http https://serp-api.netnut.io/search?engine=google_news&q=ai&start=10 ``` -------------------------------- ### Input Information Example Source: https://help.netnut.io/netnut-documentation/netnut-scraper-apis/serp-api/google-scraper/google-flights/response-fields.md Demonstrates the 'input' object, which holds details about the original API request. ```json "input": { "originalUrl": "https://www.google.com/travel/flights/search?hl=en&gl=US&tfs=CBwQAhor...", "jobId": "203e0593-8bfd-49ea-a75c-8136da9d04b5" } ``` -------------------------------- ### API Request with resultsNum Source: https://help.netnut.io/netnut-documentation/netnut-scraper-apis/serp-api/google-scraper/google-search/resultsnum.md This example demonstrates how to make a GET request to the Google SERP API, specifying the `resultsNum` parameter to retrieve a specific number of organic results. ```APIDOC ## API Request with `resultsNum` ### Description This endpoint allows you to specify the total number of organic results you wish to receive in a single combined response by using the `resultsNum` query parameter. ### Method GET ### Endpoint `https://serp-api.netnut.io/search` ### Parameters #### Query Parameters - **q** (string) - Required - The search query. - **device** (string) - Optional - The device to simulate (e.g., 'desktop', 'mobile'). - **resultsNum** (integer) - Optional - The total number of **organic results** you wish to receive in one combined response. Accepts values between 10 and 100. - **gl** (string) - Required - The Google country domain to use (e.g., 'us'). - **hl** (string) - Required - The language to use for the Google query (e.g., 'en'). - **Authorization** (string) - Required - Basic authentication header in the format `Basic `. ### Request Example ```bash curl --location 'https://serp-api.netnut.io/search?q=news&device=desktop&resultsNum=50&gl=us&hl=en' \ --header 'Authorization: Basic ' ``` ### Response #### Success Response (200) - **url** (string) - The URL of the Google search results page. - **general** (object) - General information about the search. - **searchEngine** (string) - The search engine used. - **resultsCount** (integer) - The total number of results found. - **searchTime** (float) - The time taken for the search in seconds. - **language** (string) - The language of the search results. - **device** (string) - The device used for the search. - **searchType** (string) - The type of search performed. - **pageTitle** (string) - The title of the search results page. - **timestamp** (string) - The timestamp of the search. - **render** (boolean) - Indicates if rendering was performed. - **input** (object) - Information about the API request input. - **originalUrl** (string) - The original URL of the request. - **jobId** (string) - A unique identifier for the search job. - **organic** (array) - An array of organic search results. - **title** (string) - The title of the organic result. - **description** (string) - The description of the organic result. - **link** (string) - The URL of the organic result. - **displayLink** (string) - The display URL of the organic result. - **timeSince** (string) - Time since the result was published. - **rank** (integer) - The rank of the organic result. - **pagination** (object) - Pagination information. - **currentPage** (integer) - The current page number. - **nextPage** (integer) - The next page number. - **otherPages** (object) - Other available page numbers. - **pagesProcessed** (integer) - The number of pages actually processed. #### Response Example ```json { "url": "https://www.google.com/search?q=news&hl=en&gl=US&start=30&pageIndex=4&totalPages=5", "general": { "searchEngine": "google", "resultsCount": 9810000000, "searchTime": 0.46, "language": "en", "device": "desktop", "searchType": "text", "pageTitle": "news - Google Search", "timestamp": "2025-10-09T07:13:05.054Z", "render": false }, "input": { "originalUrl": "https://www.google.com/search?q=news&hl=en&gl=US&start=30&pageIndex=4&totalPages=5", "jobId": "4f198c74-307b-4eed-961e-45fd12f92302" }, "organic": [ { "title": "Google News", "description": "3 hours ago — Read full articles...", "link": "https://news.google.com/", "displayLink": "https://news.google.com", "timeSince": "3 hours ago", "rank": 1 }, { "title": "NBC News – Breaking Headlines …", "description": "7 hours ago — Go to NBCNews.com for breaking news…", "link": "https://www.nbcnews.com/", "displayLink": "https://www.nbcnews.com", "timeSince": "7 hours ago", "rank": 2 }, { "title": "Fox News - Breaking News Updates", "description": "2 hours ago — Breaking news, latest headlines…", "link": "https://www.foxnews.com/", "displayLink": "https://www.foxnews.com", "timeSince": "2 hours ago", "rank": 3 } ], "pagination": { "currentPage": 1, "nextPage": 2, "otherPages": {} }, "pagesProcessed": 5 } ``` ### Notes - Usage of `gl` and `hl` is mandatory; otherwise, you will receive a 400 error. - The `organic` array contains merged results from all internally fetched pages, ranked continuously. - If a paginated shard fails, shards after it are not fetched, and only results from succeeded shards appear. - `pagesProcessed` indicates how many page-requests were actually completed. - Requesting all 10 pages at once (`resultsNum=100`) will result in all 10 pages being sent concurrently, and all requests are billable regardless of the actual number of results returned. ``` -------------------------------- ### Query NetNut Documentation Dynamically Source: https://help.netnut.io/netnut-documentation/~/revisions/opZiiwKf3Lsw9UUdqX4a/netnut-scraper-apis/serp-api/google-search.md Use this HTTP GET request to ask questions about the documentation. Include your question in the 'ask' parameter and an optional broader goal in the 'goal' parameter. ```bash GET https://help.netnut.io/netnut-documentation/~/revisions/opZiiwKf3Lsw9UUdqX4a/netnut-scraper-apis/serp-api/google-search.md?ask=&goal= ``` -------------------------------- ### Get Unblocker Usage Source: https://help.netnut.io/netnut-documentation/resources/customers-api/unblocker.md Retrieves the usage data for a Website Unblocker package. This endpoint requires a JSON payload containing the start date, end date, and plan status. ```APIDOC ## POST /unblocker/usage ### Description Get Website Unblocker package usage data. ### Method POST ### Endpoint /unblocker/usage ### Parameters #### Request Body - **start_date** (string) - Required - start date of the plan - **end_date** (string) - Required - end date of the plan - **plan_status** (string) - Required - the status of the plan (active, inactive, standby) ### Request Example ```json { "start_date": "2023-01-01", "end_date": "2023-12-31", "plan_status": "active" } ``` ### Response #### Success Response (200) - **display_name** (string) - display name of the plan - **end_date** (string) - end date of the plan - **plan_status** (boolean) - the status of the plan (active, inactive, standby) - **start_date** (string) - start date of the plan - **total_requests_used** (number) - usage of the plan in requests (will be only if the plan is in requests) - **request_plan_size_M** (number) - request plan size in millions (will be only if the plan is in requests) - **total_gb_used** (number) - usage of the plan in GB (will be only if the plan is in GB) - **gb_plan_size** (number) - GB plan size in GB (will be only if the plan is in GB) #### Response Example ```json { "display_name": "Basic Plan", "end_date": "2023-12-31", "plan_status": true, "start_date": "2023-01-01", "total_requests_used": 15000, "request_plan_size_M": 20, "total_gb_used": null, "gb_plan_size": null } ``` #### Error Response (400) - **success** (boolean) - is success - **message** (string) - message #### Error Response Example ```json { "success": false, "message": "Invalid date format" } ``` ``` -------------------------------- ### Python Example: Setting up a Callback URL Source: https://help.netnut.io/netnut-documentation/~/revisions/opZiiwKf3Lsw9UUdqX4a/netnut-scraper-apis/serp-api/google-search/api-example/callback-mechanism.md This Python code snippet shows how to configure a callback URL for receiving Google Search API results. Ensure the callback URL is accessible and correctly configured to handle POST requests. ```python from flask import Flask, request app = Flask(__name__) @app.route('/callback', methods=['POST']) def callback(): data = request.get_json() print(data) return 'Success', 200 if __name__ == '__main__': app.run(port=5000) ``` -------------------------------- ### Google SERP API Request with Pagination Source: https://help.netnut.io/netnut-documentation/netnut-scraper-apis/serp-api/google-scraper/google-search/pagination.md Use this cURL command to send a GET request to the SERP API for a news query with pagination. The 'start' parameter controls the offset for results. ```bash curl --location 'https://serp-api.netnut.io/search?q=news&device=desktop&start=10' \ --header 'Authorization: Basic ' ``` -------------------------------- ### Baidu Search Request with Localization Source: https://help.netnut.io/netnut-documentation/netnut-scraper-apis/serp-api/baidu-search/api-example/query-with-localization.md This example demonstrates how to make a GET request to the SERP API to search Baidu with a specific interface language (Simplified Chinese) by including the `ct=1` parameter. ```bash curl --location 'https://serp-api.netnut.io/search/get-html?siteType=baidu&wd=%E6%B6%88%E6%81%AF&ct=1&rawHtml=1' \ --header 'Authorization: Basic base64(username:password)' ``` -------------------------------- ### Query Documentation with Ask and Goal Parameters Source: https://help.netnut.io/netnut-documentation/netnut-proxies/residential-proxies.md Use this HTTP GET request to query the documentation dynamically. Include your specific question in the 'ask' parameter and an optional broader goal in the 'goal' parameter for tailored answers. ```HTTP GET https://help.netnut.io/netnut-documentation/netnut-proxies/residential-proxies.md?ask=&goal= ``` -------------------------------- ### Query Netnut Documentation Source: https://help.netnut.io/netnut-documentation/~/revisions/opZiiwKf3Lsw9UUdqX4a/netnut-scraper-apis/serp-api/google-search/api-example/callback-mechanism.md Perform an HTTP GET request to query the Netnut documentation. Use the `ask` parameter for specific questions and the optional `goal` parameter to guide the AI's response. ```bash GET https://help.netnut.io/netnut-documentation/~/revisions/opZiiwKf3Lsw9UUdqX4a/netnut-scraper-apis/serp-api/google-search/api-example/callback-mechanism.md?ask=&goal= ``` -------------------------------- ### PHP Example: Setting up a Callback URL Source: https://help.netnut.io/netnut-documentation/~/revisions/opZiiwKf3Lsw9UUdqX4a/netnut-scraper-apis/serp-api/google-search/api-example/callback-mechanism.md This PHP code snippet shows how to implement the callback mechanism for the Google Search API. By providing a `callback_url`, you can have the search results delivered to your specified endpoint. ```php "Top 10 Anime", "location" => "India", "google_domain" => "google.co.in", "callback_url" => "https://example.com/my_callback_endpoint", "api_key" => "YOUR_SERPAPI_KEY", ]; $search = new GoogleSearch($params); $results = $search->get_dict(); print_r($results); ?> ``` -------------------------------- ### Get Website Unblocker Package Usage Data Source: https://help.netnut.io/netnut-documentation/resources/customers-api/unblocker.md Use this endpoint to retrieve usage data for your Website Unblocker package. Requires a JSON payload with start date, end date, and plan status. ```json { "openapi": "3.0.1", "info": { "title": "Customers api", "version": "1.0" }, "tags": [ { "name": "Unblocker" } ], "servers": [ { "url": "https://customers-api.netnut.io/v1" } ], "security": [ { "bearerAuth": [] } ], "components": { "securitySchemes": { "bearerAuth": { "type": "apiKey", "name": "Authorization", "in": "header" } }, "schemas": { "UnblockerPlansInput": { "required": [ "end_date", "plan_status", "start_date" ], "type": "object", "properties": { "start_date": { "type": "string", "description": "start date of the plan" }, "end_date": { "type": "string", "description": "end date of the plan" }, "plan_status": { "type": "string", "description": "the status of the plan (active, inactive, standby)" } } }, "UnblockerPlanSuccess": { "required": [ "display_name", "end_date", "plan_status", "start_date" ], "type": "object", "properties": { "end_date": { "type": "string", "description": "end date of the plan" }, "start_date": { "type": "string", "description": "start date of the plan" }, "plan_status": { "type": "boolean", "description": "the status of the plan (active, inactive, standby)" }, "display_name": { "type": "string", "description": "display name of the plan" }, "total_requests_used": { "type": "number", "description": "usage of the plan in requests (will be only if the plan is in requests)" }, "request_plan_size_M": { "type": "number", "description": "request plan size in millions (will be only if the plan is in requests)" }, "total_gb_used": { "type": "number", "description": "usage of the plan in GB (will be only if the plan is in GB)" }, "gb_plan_size": { "type": "number", "description": "GB plan size in GB (will be only if the plan is in GB)" } } }, "ErrorResponse": { "type": "object", "properties": { "success": { "type": "boolean", "description": "is success" }, "message": { "type": "string", "description": "message" } } } } }, "paths": { "/unblocker/usage": { "post": { "tags": [ "Unblocker" ], "summary": "Get Website Unblocker package usage data", "operationId": "getUnblockerUsage", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UnblockerPlansInput" } } }, "required": false }, "responses": { "200": { "description": "Array of Plans", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UnblockerPlanSuccess" } } } }, "400": { "description": "fail", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } } } } ``` -------------------------------- ### Google SERP API Request with Pagination (Bash) Source: https://help.netnut.io/netnut-documentation/~/revisions/opZiiwKf3Lsw9UUdqX4a/netnut-scraper-apis/serp-api/google-search/api-example/query-with-pagination.md Use this cURL command to send a GET request to the SERP API with pagination parameters. The 'num' parameter skips results, and 'start' defines the number of results to return. ```bash 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)' ``` -------------------------------- ### Java Example: Setting up a Callback URL Source: https://help.netnut.io/netnut-documentation/~/revisions/opZiiwKf3Lsw9UUdqX4a/netnut-scraper-apis/serp-api/google-search/api-example/callback-mechanism.md This Java code snippet illustrates the use of the `callback_url` parameter for asynchronous result delivery with the Google Search API. The specified URL will receive the search results once processed. ```java import com.google.api.client.googleapis.json.GoogleJsonResponseModel; import com.google.api.client.util.Key; import java.util.Map; public class SerpApiCallback { public static void main(String[] args) { Map params = Map.of( "q", "Top 10 Anime", "location", "India", "google_domain", "google.co.in", "callback_url", "https://example.com/my_callback_endpoint", "api_key", "YOUR_SERPAPI_KEY" ); // Assuming you have a SerpApiClient class to handle the request // SerpApiClient client = new SerpApiClient(); // GoogleJsonResponseModel results = client.search(params); // System.out.println(results); } } ``` -------------------------------- ### Query Documentation Dynamically Source: https://help.netnut.io/netnut-documentation/resources/customers-api.md Perform an HTTP GET request to query the documentation. Use the `ask` parameter for your question and optionally the `goal` parameter to tailor the response. ```http GET https://help.netnut.io/netnut-documentation/resources/customers-api.md?ask=&goal= ``` -------------------------------- ### Python Example: Setting up a Callback URL Source: https://help.netnut.io/netnut-documentation/~/revisions/opZiiwKf3Lsw9UUdqX4a/netnut-scraper-apis/serp-api/google-search/api-example/callback-mechanism.md This Python code snippet shows how to configure the Google Search API client to use a callback URL for receiving search results. Ensure the callback URL is accessible and can handle POST requests. ```python from serpapi import GoogleSearch params = { "q": "Netnut", "location": "United States", "google_domain": "google.com", "api_key": "YOUR_API_KEY", "callback": "https://example.com/my_callback_endpoint" } search = GoogleSearch(params) results = search.get_dict() ``` -------------------------------- ### Using the `uule` parameter with a generated UULE value Source: https://help.netnut.io/netnut-documentation/netnut-scraper-apis/serp-api/google-scraper/google-search/geo-location.md This example demonstrates how to make a GET request to the SERP API, specifying a geographic location using a pre-generated `uule` parameter. This is useful for obtaining precise location-based search results. ```APIDOC ## GET /search ### Description Performs a Google search with a specified geographic location using a pre-generated UULE parameter. ### Method GET ### Endpoint /search ### Parameters #### Query Parameters - **device** (string) - Optional - Specifies the device type (e.g., desktop, mobile). - **q** (string) - Required - The search query. - **uule** (string) - Optional - The Google-encoded location (UULE) for the search. - **Authorization** (string) - Required - Basic authentication header (username:password). ### Request Example ```bash curl -L 'https://serp-api.netnut.io/search?device=desktop&q=news&uule=w+CAIQICIFcGFyaXM' \ -H 'Accept: application/json' \ -H 'Authorization: Basic base64(username:password)' ``` ### Response #### Success Response (200) - **url** (string) - The Google search URL used. - **general** (object) - Contains general search information. - **searchEngine** (string) - The search engine used (e.g., google). - **resultsCount** (integer) - The total number of search results. - **searchTime** (float) - The time taken for the search in seconds. - **mobile** (boolean) - Indicates if the search was performed on a mobile device. - **searchType** (string) - The type of search performed (e.g., text). - **pageTitle** (string) - The title of the Google search results page. #### Response Example ```json { "url": "https://www.google.com/search?q=news&uule=w+CAIQICIFcGFyaXM", "general": { "searchEngine": "google", "resultsCount": 25270000000, "searchTime": 0.3, "mobile": false, "searchType": "text", "pageTitle": "news - Google Search" } } ``` ``` -------------------------------- ### General Metadata Example Source: https://help.netnut.io/netnut-documentation/netnut-scraper-apis/serp-api/google-scraper/google-flights/response-fields.md Illustrates the 'general' object, containing metadata about the search environment and configuration. ```json "general": { "searchEngine": "google_flights", "language": "en", "device": "desktop", "searchType": "text", "pageTitle": "New York to Los Angeles | Google Flights", "timestamp": "2026-06-01T16:02:22.487780767Z", "render": false } ```