{"id":21130473,"url":"https://github.com/serpapi/google-search-results-nodejs","last_synced_at":"2025-10-12T22:54:08.427Z","repository":{"id":29356849,"uuid":"120655984","full_name":"serpapi/google-search-results-nodejs","owner":"serpapi","description":"SerpApi client library for Node.js. Previously: Google Search Results Node.js.","archived":false,"fork":false,"pushed_at":"2024-08-24T00:26:53.000Z","size":111,"stargazers_count":89,"open_issues_count":11,"forks_count":28,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-09-11T14:55:33.217Z","etag":null,"topics":["javascript","json","nodejs","seotools","serp","serp-api","serpapi","webscraping"],"latest_commit_sha":null,"homepage":"https://serpapi.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serpapi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-07T18:43:49.000Z","updated_at":"2025-09-09T03:45:28.000Z","dependencies_parsed_at":"2024-06-18T15:24:38.229Z","dependency_job_id":"1079ff66-3363-47f6-8281-d9ca80f57d6c","html_url":"https://github.com/serpapi/google-search-results-nodejs","commit_stats":{"total_commits":52,"total_committers":7,"mean_commits":7.428571428571429,"dds":0.2692307692307693,"last_synced_commit":"d066ecd92c4b3a1c16da6dd4dc75e780c5aceea5"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/serpapi/google-search-results-nodejs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serpapi%2Fgoogle-search-results-nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serpapi%2Fgoogle-search-results-nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serpapi%2Fgoogle-search-results-nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serpapi%2Fgoogle-search-results-nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serpapi","download_url":"https://codeload.github.com/serpapi/google-search-results-nodejs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serpapi%2Fgoogle-search-results-nodejs/sbom","scorecard":{"id":812771,"data":{"date":"2025-08-11","repo":{"name":"github.com/serpapi/google-search-results-nodejs","commit":"f6d03fc95a35ed71f1a655d0ac0720632b4ce80b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.1,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":1,"reason":"Found 4/22 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/serpapi/google-search-results-nodejs/node.js.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/serpapi/google-search-results-nodejs/node.js.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   1 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/node.js.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 13 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":3,"reason":"7 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-qrpm-p2h7-hrv2","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T13:33:32.787Z","repository_id":29356849,"created_at":"2025-08-23T13:33:32.787Z","updated_at":"2025-08-23T13:33:32.787Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279013281,"owners_count":26085250,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","json","nodejs","seotools","serp","serp-api","serpapi","webscraping"],"created_at":"2024-11-20T05:34:02.596Z","updated_at":"2025-10-12T22:54:08.393Z","avatar_url":"https://github.com/serpapi.png","language":"JavaScript","readme":"# Google Search Node.js\n\n[![npm version](https://badge.fury.io/js/google-search-results-nodejs.svg)](https://badge.fury.io/js/google-search-results-nodejs)\n![test](https://github.com/serpapi/google-search-results-nodejs/workflows/test/badge.svg)\n\n`google-search-results-nodejs` is a MIT-licensed [Node.js](https://nodejs.org/en/) package that meant to [scrape](https://en.wikipedia.org/wiki/Web_scraping) search results from Google, Bing, Baidu, Yahoo and [10+ more search engines](#supported-engines) with a [SerpApi](https://serpapi.com/) backend. SerpApi provides a [Playground](https://serpapi.com/playground) to get you started quickly by testing API interactively.\n\nFind SerpApi documentation at: https://serpapi.com/search-api\n\nFind SerpApi package at: https://www.npmjs.com/package/google-search-results-nodejs\n\n\n\u003cdetails\u003e\n\u003csummary\u003eTable of Contents\u003c/summary\u003e\n\n- [Requirements](#requirements) \n- [Installation](#installation) \n- [Quick Start](#quick-start) \n- [How SerpApi backend works](#how-serpapi-backend-works) \n- [How to set SerpApi key](#how-to-set-serpapi-key) \n- [Google Search API Capability](#google-search-api-capability) \n- [Supported Engines](#supported-engines) \n- [Example by Specification](#example-by-specification) \n- [Extra APIs](#extra-apis)\n  - [Location API](#location-api)\n  - [Search Archive API](#search-archive-api)\n  - [Account API](#account-api)\n- [Promise and Callback](#promise-and-callback)\n- [Coding Style](#coding-style)\n- [Run Regression](#run-regression)\n- [Error Management](#error-management)\n- [Changelog](#change-log)\n\u003c/details\u003e\n\n## Requirements\n\n- ES6 basic understanding\n- Node 7+ and [NPM installed](https://www.npmjs.com/package/npm)\n\n## Installation\n\n```bash\n$ npm install google-search-results-nodejs\n```\n\n## Quick start\n\nThe following example runs a search for `\"coffee\"` using your secret API key which you can find at [SerpApi Dashboard](https://serpapi.com/manage-api-key) page. \n\n[Open in the online IDE](https://replit.com/@serpapi/google-search-results-nodejs-quick-start?v=1) (Replit).\n\n```javascript\nconst SerpApi = require('google-search-results-nodejs')\nconst search = new SerpApi.GoogleSearch(\"\u003cyour-serpapi-api-key\u003e\")\n\nsearch.json({\n q: \"Coffee\", \n location: \"Austin, TX\"\n}, (result) =\u003e {\n  console.log(result)\n})\n ```\n\n### How SerpApi backend works\n\n![image](https://user-images.githubusercontent.com/78694043/192951614-81ea265f-a8d4-49eb-9b51-10b09868b875.png)\n\n## How to set SerpApi key\n\n`api_key` can be set globally using a singleton pattern:\n\n```javascript\n// https://serpapi.com/manage-api-key\nconst SerpApi = require(\"google-search-results-nodejs\")\nconst search = new SerpApi.GoogleSearch(\"\u003cyour-serpapi-api-key\u003e\")\n```\n\n`api_key` can be [read from the environment variable](https://nodejs.dev/en/learn/how-to-read-environment-variables-from-nodejs/):\n\n```javascript\nconst search = new SerpApi.GoogleSearch(process.env.API_KEY);\n```\n\n`api_key` can be provided for each request:\n\n```javascript\nconst SerpApi = require(\"google-search-results-nodejs\")\nconst search = new SerpApi.GoogleSearch()\n\nlet result = search.json({\n api_key: \"\u003cyour-serpapi-api-key\u003e\", // https://serpapi.com/manage-api-key\n q: \"Coffee\",                       // search query\n location: \"Austin, TX\",            // location of the search\n}, (data) =\u003e {\n  console.log(data)\n})\n```\n\n## Google Search API Capability\n\n```javascript\nconst SerpApi = require(\"google-search-results-nodejs\")\nconst search = new SerpApi.GoogleSearch()\n\nquery_params = {\n    api_key: \"asdewqe1231241asm\",              // Your SerpApi API key, https://serpapi.com/manage-api-key                                                                             \n    q: \"coffee\",                               // Search query.                                                                                     \n    google_domain: \"google.com\",               // Google domain to use.                                                                             \n    location: \"Austin, Texas, United States\",  // Location requested for the search.                                                                \n    uule: \"w+CAIQICINVW5pdGVkIFN0YXRlcw\",      // Google encoded location you want to use for the search.                                           \n    ludocid: \"CID ID\",                         // ID (CID) of the Google My Business listing you want to scrape.\n    lsig: \"AB86z5W5r155sIcs3jqfYkm9Y8Fp\",      // Force the knowledge graph map view to show up.\n    device: \"desktop|mobile|tablet\",           // Device used when making a search.                                                                 \n    hl: \"en\",                                  // Language of the search.                                                                           \n    gl: \"gl\",                                  // Country of the search.                                                                            \n    lr: \"lang_en|lang_fr\",                     // One or multiple languages to limit the search to.                                                 \n    safe: \"active|off\",                        // Level of filtering for adult content.                                                             \n    nfpr: \"1|0\",                               // Exclusion of results from an auto-corrected query that is spelled wrong.                          \n    num: \"100\",                                // Number of results per page.                                                                       \n    start: \"20\",                               // Pagination offset.                                                                                \n    ijn:\"1\",                                   // Page number for Google Images.                                                                    \n    tbm: \"nws|isch|shop|lcl|vid\",              // Type of search: news, images, shopping. local, video results.                                                         \n    tbs: \"custom to be search criteria\",       // Advanced search for patents, dates, news, videos, images, apps, or text contents                  \n    async: True|False,                         // Allow async request.\n    no_cache: True|False                       // Force SerpApi to fetch the Google results even if a cached version is already present             \n}\n\nconst callback = (data) =\u003e {\n console.log(data)                                // create a callback\n}\n                                                 \nsearch.json(query_params, callback)              // Show result as JSON\nsearch.html(query_params, callback)              // Show result as HTML file\n```\n\n## Supported Engines\n\n\u003cdetails\u003e\n\u003csummary\u003eGoogle Search and 20+ other engines 👇\u003c/summary\u003e\n\n| Engine                                                                       | Class name              |\n|------------------------------------------------------------------------------|-------------------------|\n| [Google Search Engine](https://serpapi.com/search-api)                       | `GoogleSearch()`        |\n| [Google Maps](https://serpapi.com/google-maps-api)                           | `GoogleSearch()`        |\n| [Google Jobs](https://serpapi.com/google-jobs-api)                           | `GoogleSearch()`        |\n| [Google Trends](https://serpapi.com/google-trends-api)                       | `GoogleSearch()`        |\n| [Google Autocomplete](https://serpapi.com/google-autocomplete-api)           | `GoogleScholarSearch()` |\n| [Google About This Result](https://serpapi.com/google-about-this-result)     | `GoogleSearch()`        |\n| [Google Lens](https://serpapi.com/google-lens-api)                           | `GoogleSearch()`        |\n| [Google Finance](https://serpapi.com/google-finance-api)                     | `GoogleSearch()`        |\n| [Google Related Questions](https://serpapi.com/google-related-questions-api) | `GoogleScholarSearch()` |\n| [Google Scholar](https://serpapi.com/google-scholar-api)                     | `GoogleScholarSearch()` |\n| [Google Play Store](https://serpapi.com/google-play-api)                     | `GoogleSearch()`        |\n| [Google Product](https://serpapi.com/google-product-api)                     | `GoogleSearch()`        |\n| [Google Immersive Product](https://serpapi.com/google-immersive-product-api) | `GoogleSearch()`        |\n| [Google Reverse Image](https://serpapi.com/google-reverse-image)             | `GoogleSearch()`        |\n| [Google Events](https://serpapi.com/google-events-api)                       | `GoogleSearch()`        |\n| [Google Local Services](https://serpapi.com/google-local-services-api)       | `GoogleSearch()`        |\n| [Bing](https://serpapi.com/bing-search-api)                                  | `BingSearch()`          |\n| [Baidu](https://serpapi.com/baidu-search-api)                                | `BaiduSearch()`         |\n| [DuckDuckGo](https://serpapi.com/duckduckgo-search-api)                      | `DuckDuckGoSearch()`    |\n| [Yahoo](https://serpapi.com/yahoo-search-api)                                | `YahooSearch()`         |\n| [Yandex](https://serpapi.com/yandex-search-api)                              | `YandexSearch()`        |\n| [eBay](https://serpapi.com/ebay-search-api)                                  | `EbaySearch()`          |\n| [Youtube](https://serpapi.com/youtube-search-api)                            | `YoutubeSearch()`       |\n| [Walmart](https://serpapi.com/walmart-search-api)                            | `WalmartSearch()`       |\n| [HomeDepot](https://serpapi.com/home-depot-search-api)                       | `HomeDepotSearch()`     |\n| [Apple App Store](https://serpapi.com/apple-app-store)                       | `AppleAppStoreSearch()` |\n| [Naver](https://serpapi.com/naver-search-api)                                | `NaverSearch()`         |\n| [Yelp](https://serpapi.com/yelp-search-api)                                  | `YelpSearch()`          |\n\n\u003c/details\u003e\n\n## Example by specification\n\nWe love open source, continuous integration and [Test Driven Development](https://en.wikipedia.org/wiki/Test-driven_development) (TDD). We are using [Mocha](https://mochajs.org/) to test [our infrastructure around the clock](https://travis-ci.org/serpapi/google-search-results-nodejs) to achieve the best [Quality of Service](https://en.wikipedia.org/wiki/Quality_of_service) (QoS).\n\nThe directory `test/` includes specification/examples.\n\nSet your API key:\n\n```bash\nexport API_KEY=\"\u003cyour-serpapi-api-key\u003e\"\n```\n\nRun all tests: \n\n```bash\nnpm test\n```\n\n## Extra APIs\n\n### Location API\n\n```javascript\nconst search = new SerpApi.GoogleSearch(\"\u003cyour-serpapi-api-key\u003e\")\n\nsearch.location(\"Austin\", 3, (data) =\u003e {\n  console.log(data)\n})\n```\n\nPrints the first three (3) locations matching Austin (Texas, Texas, Rochester)\n\n```javascript\n[\n   {\n      \"id\":\"585069bdee19ad271e9bc072\",\n      \"google_id\":200635,\n      \"google_parent_id\":21176,\n      \"name\":\"Austin, TX\",\n      \"canonical_name\":\"Austin,TX,Texas,United States\",\n      \"country_code\":\"US\",\n      \"target_type\":\"DMA Region\",\n      \"reach\":5560000,\n      \"gps\":[\n         -97.7430608,\n         30.267153\n      ],\n      \"keys\":[\n         \"austin\",\n         \"tx\",\n         \"texas\",\n         \"united\",\n         \"states\"\n      ]\n   }, ... other results\n]\n```\n\n### Search Archive API\n\nThe first search result returns a `search_id` which can be provided to get the search result from the archive. The following code will print the search from the archive.\n\n```javascript\nvar search = new SerpApi.GoogleSearch(\"\u003cyour-serpapi-api-key\u003e\")\n\nsearch.json({q: \"Coffee\", location: \"Portland\" }, (search_result) =\u003e {\n  // search in archive for the search just returned\n  search.search_archive(search_result.search_metadata.id, (archived_search) =\u003e {\n    console.log(archived_search)\n  })\n})\n```\n\n### Account API\n\nThe following code snippet will print your account information.\n\n```javascript\nconst search = new SerpApi.GoogleSearch(\"\u003cyour-serpapi-api-key\u003e\")\n\nsearch.account((data) =\u003e {\n  console.log(data)\n})\n```\n\n## Promise and callback\n\nThis API was developped using basic callback to handle response. Exception are just throw away with interceptor.\n\nIf you want to take advantage of the promise to block the request, here is how we'll do:\n\n```javascript\nconst util = require('util')\n\nfunction getJson(parameter, resolve, reject) {  \n  const search = new SerpApi.GoogleSearch(\"\u003cyour-serpapi-api-key\u003e\")\n  try {\n    search.json(parameter, resolve)\n  } catch (e) {\n    reject(e)\n  }\n}\n\nconst blockFn = util.promisify(getJson)\nblockFn[util.promisify.custom](parameter).then((data) =\u003e {\n  expect(data.local_results[0].title.length).toBeGreaterThan(5)\n  done()\n}).catch((error) =\u003e {\n  console.error(error)\n  done()\n})\n```\n\u003cdetails\u003e\n\u003csummary\u003ePractical code example using Google Images API\u003c/summary\u003e\n\n  [Open in the online IDE](https://replit.com/@serpapi/google-search-results-nodejs-practical-code-example?v=1) (Replit)\n\n  ```javascript\n  const SerpApi = require(\"google-search-results-nodejs\");\n  const search = new SerpApi.GoogleSearch(process.env.API_KEY); // your serpapi API key, https://serpapi.com/manage-api-key\n\n  const searchQuery = \"coffee\";\n\n  const params = {\n    q: searchQuery,   // what we want to search\n    engine: \"google\", // parsing engine\n    hl: \"en\",         // parameter defines the language to use for the Google search\n    gl: \"us\",         // parameter defines the country to use for the Google search\n    tbm: \"isch\",      // parameter defines the type of search you want to do (isch - Google Images)\n  };\n\n  const getJson = () =\u003e {\n    return new Promise((resolve) =\u003e {\n      search.json(params, resolve);\n    });\n  };\n\n  const getResults = async () =\u003e {\n    const imagesResults = [];\n\n    while (true) {\n      const json = await getJson();\n      if (json.images_results) {\n        imagesResults.push(...json.images_results);\n        params.ijn ? (params.ijn += 1) : (params.ijn = 1);\n      } else break;\n    }\n    return imagesResults;\n  };\n\n  getResults().then((result) =\u003e console.dir(result, { depth: null }));\n  ```\n\u003c/details\u003e\n\nReference:\n * test: `test/ExampleSpec.js`\n * documentation: https://nodejs.org/docs/latest-v8.x/api/util.html#util_util_promisify_original\n\n## Coding style\n\nThis API is using callback to run in non-blocking code. Here we are trying to follow the spirit of NodeJS. \n\nReference:\n * https://nodejs.org/en/docs/guides/blocking-vs-non-blocking/\n * https://nodejs.org/en/docs/guides/dont-block-the-event-loop/\n\nFor pratical example, you can see the test located under `test/` folder.\n\n## Run regression\n\nTo run the regression suite.\n```bash\nexport API_KEY=\"your api key\"\nmake test\n```\n\n## Error Management\n\nSerpApi keeps error management simple:\n1. backend service error or search fail.\n2. client error.\n\nIf it's a backend error, a simple error message is returned as string in the server response. If it's a client error, then a `SerpApiClientException` is raised.\n\n## Change log\n\n * 2.1 \n   * add support for Naver, HomeDepot, AppleStoreApp, DuckDuckGo\n   * defeature location if it is not supported by the search engine\n * 2.0.1 \n  * fix classes loading.\n * 2.0\n   * Refractor class name: SearchResult -\u003e Search\n * 1.2\n   * stable version to support all the basic search API.\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserpapi%2Fgoogle-search-results-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserpapi%2Fgoogle-search-results-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserpapi%2Fgoogle-search-results-nodejs/lists"}