Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Scrape google search results without an API key with javascript/typescript.

License

NotificationsYou must be signed in to change notification settings

typicalninja/google-sr

Repository files navigation

Scrape google search results without an API key with javascript/typescript.

testing workflowGitHub Repo starsDiscordMonthly downloadsCodeFactorcodecov

Install

Runtime Support

google-sr does not support web environments, but it has been tested and confirmed to work on the following runtimes:

To get started, you can installgoogle-sr using your preferred package manager:

npm install google-sr# For pnpm/yarn/bun:pnpm/yarn/bun add google-sr# For Deno, either use the npm: specifier# or import from esm.sh# https://esm.sh/google-sr

Usage

This example demonstrates some of the features ofgoogle-sr. For a bare minimum setup, refer to theexamples/basic file.

import{search,OrganicResult,// Import the result types you needDictionaryResult,ResultTypes,// Import to filter results by type}from"google-sr";constqueryResult=awaitsearch({query:"nodejs",// Specify the result types explicitly ([OrganicResult] is the default, but it is recommended to always specify the result type)resultTypes:[OrganicResult,DictionaryResult],// Optional: Customize the request using AxiosRequestConfig (e.g., enabling safe search)requestConfig:{params:{safe:"active",// Enable "safe mode"},},});// will return a SearchResult[]console.log(queryResult);console.log(queryResult[0].type===ResultTypes.OrganicResult);// true

Note: By default, only results of typeResultTypes.OrganicResult are returned. Use theresultTypes option to customize the output.

Monorepo

Welcome to the 📦 monorepo of GSR Project.

🏠 This is the home to google-sr and its related packages & applications.

google-sr

npm downloads for google-srNPM license for google-srnpm version for google-sr

google-sr-selectors

npm downloads for google-sr-selectorsNPM license for google-sr-selectorsnpm version for google-sr-selectors

google-that

npm downloads for google-thatNPM license for google-thatnpm version for google-that

This monorepo is managed withturborepo and usespnpm workspaces.

Disclaimer

This is not sponsored, supported, or affiliated with Google.

The source code within this repository is intended solely foreducational & research purposes.The author (typicalninja) & contributors takesNO responsibility for any issues that arise from its use, such as IP blocking by Google. Your discretion in usage is advised.

Mirror

GSR project has a mirror repository on codebergYou can find ithere

  • All issues and discussion are limited to github & discord

Tests

Tests are written usingvitest and can be run by using thetest script.

Weekly tests are executed using a github action to ensure compatibility and catch breakage due to google changes

pnpm runtest

License

This repository and the code inside it is licensed under the Apache-2.0 License. ReadLICENSE for more information.


[8]ページ先頭

©2009-2025 Movatter.jp