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-nodeyarn add @you-got-bud/google-custom-search-nodebun add @you-got-bud/google-custom-search-nodenpm i @you-got-bud/google-custom-search-node -Simport {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
)