POST /v1/search

Runs a Google search and scrapes each result, returning clean Markdown for every page. One API call gives your LLM full web context for any query.

Cost: 2 credits per result

Request

curl -X POST https://www.webglean.com/v1/search \
  -H "Authorization: Bearer wg_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "best web scraping libraries 2025",
    "numResults": 5
  }'

Body parameters

ParameterTypeDefaultDescription
querystringrequiredThe search query
numResultsnumber5Number of results to scrape (1–10)

Response

{
  "success": true,
  "data": [
    {
      "url": "https://example.com/scraping-guide",
      "title": "Top 10 Web Scraping Libraries in 2025",
      "snippet": "A rundown of the best scraping libraries...",
      "markdown": "# Top 10 Web Scraping Libraries\n\n...",
      "error": null
    },
    {
      "url": "https://another.com/article",
      "title": "Web Scraping in Python: Complete Guide",
      "snippet": "Everything you need to know about scraping in Python...",
      "markdown": null,
      "error": "Page failed to load"
    }
  ]
}

If Serper returns zero results for the query, data is an empty array and you are not charged.

Use cases

  • Give your LLM current web context before answering a question
  • Build a research agent that searches and synthesizes web content
  • Monitor competitor mentions across the web
  • Gather data from multiple sources in one call

Notes

  • Search results come from Google via Serper.dev
  • Results are scraped in parallel — total latency is roughly 1 result's scrape time, not N × scrape time
  • If a result page fails to scrape, its markdown is null and error explains why — it still appears in data and still counts toward your credit charge, since you're charged per search result returned, not per successful scrape
  • You're only charged for results Serper actually returns, not the numResults you requested — if you ask for 10 and only get 6, you're charged for 6

Errors

CodeReason
401Invalid API key
402Insufficient credits for the requested number of results
429Rate limit exceeded
400Missing or empty query
502Search provider (Serper) error
504Search timed out — try again
500Search failed