Skip to content
EN
Get API key
Browse documentation

Get started

Quickstart

Run your first Google search and get structured results for your app or AI agent.

Start with your AI agent

Give this prompt to an agent with terminal access. It sets up FlashData and runs one search.

Make your first API call

Prefer to write the code? Follow these three steps in your terminal.

  1. Get an API key

    Create an account, verify your email and create a key with Google Search permission. Already have a key? Use it here.

    Run this in your terminal and paste your key at the hidden prompt. Skip it if FLASHDATA_API_KEY is already set.

    Set your key
    # Bash: paste the key into a hidden prompt, not into this command.
    read -r -s -p "FlashData API key: " FLASHDATA_API_KEY
    printf '\n'
    export FLASHDATA_API_KEY
  2. Run a search

    Choose your language and run the example in the same terminal. Each run makes one search.

    Python 3.10+ · Save the example as quickstart.py.

    Install
    python -m pip install "flashdata==1.1.0"
    quickstart.py
    import json
    import os
    from flashdata import FlashData
    
    with FlashData(api_key=os.environ["FLASHDATA_API_KEY"]) as client:
        response = client.google.search("battery recycling research", num=5)
        if response["status"] != "done":
            raise RuntimeError(response)
        print(json.dumps(response, indent=2))
    Run
    python quickstart.py
  3. Check the result

    A successful response has status: done. Find sources in results[].organic and the credits charged in usage.credits.

    Example response (abbreviated)
    {
      "status": "done",
      "results": [
        {
          "organic": [
            {
              "title": "Battery recycling research",
              "link": "https://example.org/recycling",
              "snippet": "An example search excerpt."
            }
          ]
        }
      ],
      "usage": {
        "credits": 0.02
      }
    }

Try the console

  1. Create an account or sign in. Complete email verification and any account setup shown in the console.
  2. Open Google Search, select the Google Search source and Realtime mode, then enter battery recycling research. Expand Additional parameters and set Page size (num) to 5.
  3. Check the displayed request and available credits, then run the search once.
  4. Inspect the response and usage. Open a returned source to check its contents before citing more than its excerpt.

Build on your first result

If the first request fails

Missing FLASHDATA_API_KEY
Set the key in the same terminal or runtime as the example; .env files are not loaded by these snippets.
401 / 403
Check that the key or connection is active and has google_search permission.
402
Check available credits in Billing. Claim an existing trial when owner access is needed.
429
Respect Retry-After. Keep the same identity and registration proof; do not create another trial.
Timeout or unknown submission
Check the existing run before retrying. CLI users keep the same profile and run ID; SDK/API users preserve any returned job or request ID.