Web search API

Send a search query and get the results as clean JSON: position, title, address and snippet of every result, plus related searches and questions where there are any. Add scrape, and every result comes back as Markdown too.

Start with 50 free creditsOpen playground

You send

POST /v1/search
{
  "query": "best trail running shoes",
  "limit": 10,
  "language": "en",
  "scrape": {
    "format": "markdown",
    "main_content": true
  }
}
Endpoint
POST /v1/search
Cost
About 1 credit per results page; each fetched result like a single request
Plans
All plans, Free included
Failed requests
Not charged
Documentation
Step-by-step guide

Reading search results yourself means a parser that breaks with every layout change, and a second round of fetching for every result you actually want to read.

How VirginProxy helps

  • POST /v1/search with a query – the web search runs on DuckDuckGo, up to 50 results, numbered by position.
  • Language, country of the results, time range (day, week, month or year) and up to 20 domains to include or exclude.
  • "scrape" fetches every result with the options of a single request – Markdown, main content, extraction – in the same call.
  • Related searches and questions come back as lists of their own when the results page shows them.

How it works, step by step

  1. Write the query

    POST /v1/search with query (up to 400 characters); the web search runs on DuckDuckGo.

  2. Narrow the results

    limit (1 to 50), language, the country of the results, time_range, and up to 20 domains in include_domains or exclude_domains.

  3. Read the results if you want them

    scrape takes the options of a single request – such as {"format": "markdown"} – and fetches every result in the same call.

  4. Use the JSON

    Each result has position, title, url and snippet, and with scrape a page with its body, tokens and credits.

Example request

Ten web search results for a query, each result page as clean Markdown of its main content – ready for an AI agent or a research step.

curl https://api.virginproxy.com/v1/search \
  -H "Authorization: Bearer $VP_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "best trail running shoes",
    "limit": 10,
    "language": "en",
    "scrape": {
      "format": "markdown",
      "main_content": true
    }
  }'
import os, requests

r = requests.post(
    "https://api.virginproxy.com/v1/search",
    headers={"Authorization": "Bearer " + os.environ["VP_KEY"]},
    json={
        "query": "best trail running shoes",
        "limit": 10,
        "language": "en",
        "scrape": {
            "format": "markdown",
            "main_content": True
        }
    },
    timeout=150,
)
data = r.json()
print(len(data["results"]), data["credits"])
const res = await fetch("https://api.virginproxy.com/v1/search", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.VP_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "query": "best trail running shoes",
    "limit": 10,
    "language": "en",
    "scrape": {
      "format": "markdown",
      "main_content": true
    }
  }),
});
const data = await res.json();
console.log(data.results.length, data.credits);
$ch = curl_init("https://api.virginproxy.com/v1/search");
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("VP_KEY"),
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => json_encode([
        "query" => "best trail running shoes",
        "limit" => 10,
        "language" => "en",
        "scrape" => [
            "format" => "markdown",
            "main_content" => true,
        ],
    ]),
    CURLOPT_TIMEOUT => 150,
]);
$data = json_decode(curl_exec($ch), true);
echo count($data["results"]), " ", $data["credits"];
body := strings.NewReader(`{
  "query": "best trail running shoes",
  "limit": 10,
  "language": "en",
  "scrape": {
    "format": "markdown",
    "main_content": true
  }
}`)
req, _ := http.NewRequest("POST", "https://api.virginproxy.com/v1/search", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("VP_KEY"))
req.Header.Set("Content-Type", "application/json")

res, err := http.DefaultClient.Do(req)
if err != nil {
	log.Fatal(err)
}
defer res.Body.Close()
var data map[string]any
json.NewDecoder(res.Body).Decode(&data)
fmt.Println(len(data["results"].([]any)), data["credits"])

Documentation for this feature · API reference

What comes back

Numbered results, with each result page already fetched as Markdown:

{
  "query": "best trail running shoes",
  "engine": "duckduckgo",
  "results": [
    {
      "position": 1,
      "title": "The 10 best trail running shoes",
      "url": "https://magazine.example/trail-shoes",
      "snippet": "We tested 40 pairs on rock, mud and forest paths …",
      "page": { "status": 200, "format": "markdown", "body": "# The 10 best trail running shoes\n…", "tokens": 2410, "credits": 1 }
    }
  ],
  "related": [ "trail running shoes for beginners" ],
  "questions": [ "Are trail shoes good on roads?" ],
  "credits": 11
}

What it costs

A results page usually costs 1 credit, and ten results usually fit on one page. With scrape, every fetched result costs like a request of its own – ten results with their pages as Markdown are usually about 11 credits. max_credits caps the whole call.

Pricing and cost examples

Good to know

  • Without scrape you get the results list alone – the cheapest way to track positions.
  • include_domains keeps the search to the sites you trust; exclude_domains leaves out the ones you never want.
  • Add main_content to scrape, so every page comes back without menus and footers.
  • AI agents can use search as an MCP tool through your account, with the same prices.

Questions

What does a search cost?

A results page usually costs 1 credit. With scrape, every fetched result costs like a request of its own. max_credits caps the whole call.

What if a search cannot be completed?

Then the call ends with search_failed; an answer that did come back is charged like any request – try again later. A result that cannot be fetched with scrape gets its own error; the other results still come back.

Can I choose the country?

You choose the country and language of the results the engine shows; it is a search setting, not the place the request comes from.

Are related searches included?

Yes, as related and questions, whenever the results page shows them.

What happens with results that cannot be fetched?

They keep their place in the list with an error in page; the other results come back as usual.

Try it with 50 free credits

Pick up where you left off

No card needed. Your first request takes two minutes.

Your credits, keys and recent requests are waiting in the dashboard.

Start with 50 free creditsGo to dashboard