---
title: "Quickstart"
description: "Solve a Cloudflare Turnstile challenge with one API request."
---

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

# Quickstart

This example sends a Turnstile task and reads the solved token from the
response.

1. **Get an API key**

   Create or copy a key from the
   [uncaptcha.io dashboard](https://uncaptcha.io/dashboard). Keep it on your
   server and load it through an environment variable.
2. **Collect the challenge data**

   Find the target page URL and Turnstile `sitekey`. If the widget supplies an
   `action` or `cData`, send those values too.
3. **Execute the task**

   Send the task to `POST /v1/task/execute`.

### cURL

```bash title="terminal"
curl --request POST \
  --url https://api.uncaptcha.io/v1/task/execute \
  --header "Content-Type: application/json" \
  --header "X-Api-Key: $UNCAPTCHA_API_KEY" \
  --data '{
"task_type": "turnstile",
"task_data": {
  "url": "https://example.com/",
  "sitekey": "0x4AAAAAABs37s-ih7Jepz0J",
  "proxy": "http://user:pass@203.0.113.10:8080"
}
  }'
```
### Python

```python title="solve.py"
import os
import requests

response = requests.post(
"https://api.uncaptcha.io/v1/task/execute",
headers={"X-Api-Key": os.environ["UNCAPTCHA_API_KEY"]},
json={
    "task_type": "turnstile",
    "task_data": {
        "url": "https://example.com/",
        "sitekey": "0x4AAAAAABs37s-ih7Jepz0J",
        "proxy": "http://user:pass@203.0.113.10:8080",
    },
},
timeout=35,
)
response.raise_for_status()
token = response.json()["data"]["solution"]["token"]
```
### Node.js

```javascript title="solve.mjs"
const response = await fetch(
  "https://api.uncaptcha.io/v1/task/execute",
  {
method: "POST",
headers: {
  "Content-Type": "application/json",
  "X-Api-Key": process.env.UNCAPTCHA_API_KEY,
},
body: JSON.stringify({
  task_type: "turnstile",
  task_data: {
    url: "https://example.com/",
    sitekey: "0x4AAAAAABs37s-ih7Jepz0J",
    proxy: "http://user:pass@203.0.113.10:8080",
  },
}),
signal: AbortSignal.timeout(35_000),
  },
);

if (!response.ok) throw new Error(await response.text());
const token = (await response.json()).data.solution.token;
```
### Go

```go title="main.go"
payload := strings.NewReader(`{
  "task_type": "turnstile",
  "task_data": {
"url": "https://example.com/",
"sitekey": "0x4AAAAAABs37s-ih7Jepz0J",
"proxy": "http://user:pass@203.0.113.10:8080"
  }
}`)

req, err := http.NewRequest(
http.MethodPost,
"https://api.uncaptcha.io/v1/task/execute",
payload,
)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-Api-Key", os.Getenv("UNCAPTCHA_API_KEY"))

client := &http.Client{Timeout: 35 * time.Second}
resp, err := client.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
```

## Successful response

```json
{
  "success": true,
  "data": {
"solution": {
  "token": "0.AuR5g8kP..."
}
  }
}
```

Use `data.solution.token` wherever the target flow expects the Turnstile
response.

> **Set a client timeout**
>
> API task execution is capped at 30 seconds. Set your HTTP client's timeout a
> little higher—about 35 seconds—so the API can return a structured `504`
> response instead of your client disconnecting first.

Source: https://docs.uncaptcha.io/getting-started/quickstart/index.mdx
