Skip to main content
Use a current Node.js runtime with native fetch and AbortSignal.timeout. Select JavaScript below, save as search.mjs, replace the key, and run node search.mjs.

Keep requests on the server

Call LangSearch from a server route or backend service. Do not embed your real key in a public browser bundle.

Select source context

Keep the URLs with the context so your model can cite its sources. For failures, inspect HTTP status and the error body before deciding whether to retry.