This is a simple wrapper for the Google Custom Search API. It allows you to search the web for images, web pages, and more. Built with TypeScript and 0 external dependencies.
pnpm add @you-got-bud/google-custom-search-node
yarn add @you-got-bud/google-custom-search-node
bun add @you-got-bud/google-custom-search-node
npm i @you-got-bud/google-custom-search-node -S
import {search, Google} from '@you-got-bud/google-custom-search-node'
const GOOGLE_CX = '<GOOGLE SEARCH ENGINE ID>'
const GOOGLE_API_KEY = '<GOOGLE API KEY>'
const searchParameters = {
safe: 'active',
} satisfies Google.SearchParameters
const results = await search(
'cats',
{
cx: GOOGLE_CX,
key: GOOGLE_API_KEY,
},
searchParameters
)