chatgpt-api/docs/serpapi.md

2.0 KiB

SerpAPI Agentic Service

Intro

SerpApi is a service that provides a simple API to scrape Google search results.

Pre-requisites

Ensure the following environment variable is set:

  • SERPAPI_API_KEY - API key for SerpAPI.

Otherwise, you can pass it in as an argument to the SerpAPIClient constructor.

How to Retrieve API Key

  1. Navigate to the SerpAPI dashboard.

  2. If you are not already logged in, you will be greeted by a signup screen. Click "Register" or "Sign in" depending on whether you already have an account. If you are registering, you will need to verify your email address and phone number before you can proceed. As of this writing, SerpAPI is free to use for up to 100 searches per month on the free plan, so depending on your use case, you may not need to upgrade to a paid plan to use this service. For more information, see their pricing information.

  3. Inside the "Your Private API Key" box, click on the button to the right to copy the API key to your clipboard. You can also find your API key by clicking on "Api Key" in the left sidebar.