> ## Documentation Index
> Fetch the complete documentation index at: https://docs.context.dev/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Setting up Context.dev for a user? Follow https://docs.context.dev/agent-quickstart.md. MCP clients sign in with OAuth and need no API key; application code reads CONTEXT_DEV_API_KEY.

# Answers

> Research a question and receive structured JSON with source URLs.

Give Answers a task and the service finds relevant web evidence. Name a domain or page URL to have it read that site before searching.

## Ask a question

<CodeGroup>
  ```typescript TypeScript theme={null}
  import ContextDev from "context.dev";

  const client = new ContextDev({ apiKey: process.env.CONTEXT_DEV_API_KEY });

  const response = await client.web.answers({
    mode: "fast",
    task: "Find the pricing page URL and plan names for context.dev.",
    json_format: {
      pricing_page_url: "",
      plans: [{ name: "" }],
    },
    timeoutOpts: { milliseconds: 30000, behavior: "return-partial" },
  });

  console.log(response.json_content, response.sources, response.partial ?? false);
  ```

  ```python Python theme={null}
  import os
  from context.dev import ContextDev

  client = ContextDev(api_key=os.environ["CONTEXT_DEV_API_KEY"])

  response = client.web.answers(
      mode="fast",
      task="Find the pricing page URL and plan names for context.dev.",
      json_format={"pricing_page_url": "", "plans": [{"name": ""}]},
      timeout_opts={"milliseconds": 30000, "behavior": "return-partial"},
  )

  print(response.json_content, response.sources, response.partial or False)
  ```

  ```ruby Ruby theme={null}
  require "context_dev"

  client = ContextDev::Client.new(api_key: ENV.fetch("CONTEXT_DEV_API_KEY"))

  response = client.web.answers(
    mode: "fast",
    task: "Find the pricing page URL and plan names for context.dev.",
    json_format: {pricing_page_url: "", plans: [{name: ""}]},
    timeout_opts: {milliseconds: 30000, behavior: "return-partial"}
  )

  pp response.json_content, response.sources, response.partial
  ```

  ```go Go theme={null}
  package main

  import (
  	"context"
  	"fmt"
  	"os"

  	contextdev "github.com/context-dot-dev/context-go-sdk/v2"
  	"github.com/context-dot-dev/context-go-sdk/v2/option"
  )

  func main() {
  	client := contextdev.NewClient(option.WithAPIKey(os.Getenv("CONTEXT_DEV_API_KEY")))

  	response, err := client.Web.Answers(context.Background(), contextdev.WebAnswersParams{
  		Mode: contextdev.WebAnswersParamsModeFast,
  		Task: "Find the pricing page URL and plan names for context.dev.",
  		JsonFormat: map[string]any{
  			"pricing_page_url": "",
  			"plans":            []any{map[string]any{"name": ""}},
  		},
  		TimeoutOpts: contextdev.WebAnswersParamsTimeoutOpts{Milliseconds: 30000, Behavior: "return-partial"},
  	})
  	if err != nil {
  		panic(err)
  	}

  	fmt.Println(response.JsonContent, response.Sources, response.Partial)
  }
  ```

  ```php PHP theme={null}
  <?php
  require __DIR__.'/vendor/autoload.php';

  use ContextDev\Client;

  $client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY'));

  $response = $client->web->answers(
      task: 'Find the pricing page URL and plan names for context.dev.',
      mode: 'fast',
      jsonFormat: [
          'pricing_page_url' => '',
          'plans' => [['name' => '']],
      ],
      timeoutOpts: ['milliseconds' => 30000, 'behavior' => 'return-partial'],
  );

  print_r($response->jsonContent);
  print_r($response->sources);
  var_dump($response->partial ?? false);
  ```

  ```bash cURL theme={null}
  curl https://api.context.dev/v1/web/answers \
    --request POST \
    --header "Authorization: Bearer $CONTEXT_DEV_API_KEY" \
    --header "Content-Type: application/json" \
    --data '{
    "mode": "fast",
    "task": "Find the pricing page URL and plan names for context.dev.",
    "json_format": {
      "pricing_page_url": "",
      "plans": [
        {
          "name": ""
        }
      ]
    },
    "timeoutOpts": {
      "milliseconds": 30000,
      "behavior": "return-partial"
    }
  }'
  ```
</CodeGroup>

Abridged response:

```json theme={null}
{"json_content":{"pricing_page_url":"https://www.context.dev/pricing","plans":[{"name":"Developer"},{"name":"Pro"},{"name":"Growth"},{"name":"Scale"}]},"sources":["https://www.context.dev/pricing"]}
```

## Choose a mode

| Mode              | Research budget  | Use                                  |
| ----------------- | ---------------- | ------------------------------------ |
| `fast`            | Up to 30 seconds | Focused factual lookups.             |
| `ultra` (default) | Up to 50 seconds | Deeper questions or several sources. |

Choose [the answer shape](/answers/answer-shape), then handle [sources and deadlines](/answers/sources-and-deadlines). See [credits](/account/credits) when selecting a mode.

For extraction from a known page with JSON Schema, use [Scrape JSON](/scrape/json). The [Answers reference](/api-reference/web-extraction/answers) documents the full contract.
