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

# Example: single URL extraction

> This example shows the simplest useful Titan workflow: scrape one page once and export the result.

## Scenario

You want to extract a small structured record from a single product URL and verify that your API integration is working end to end.

## Architecture

```mermaid theme={null}
sequenceDiagram
    participant You
    participant TaskService as Task Service
    participant Worker
    You->>TaskService: Create task with one URL
    You->>TaskService: Run task
    TaskService->>Worker: Dispatch
    Worker->>TaskService: Return result
    You->>TaskService: Export result
```

## Recommended request flow

| Step | API call                                    |
| ---- | ------------------------------------------- |
| 1    | `POST /api/v1/tasks`                        |
| 2    | `POST /api/v1/tasks/:id/run`                |
| 3    | `GET /api/v1/executions/:id`                |
| 4    | `GET /api/v1/executions/:id/results/export` |

## Step 1: create the task

```bash theme={null}
curl -X POST "$TITAN_API_URL/api/v1/tasks" \
  -H "Authorization: Bearer $TITAN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Single URL test",
    "urls": ["https://example.com/product/123"],
    "objective": "Extract the product name and price",
    "output_schema": {
      "type": "object",
      "properties": {
        "product_name": { "type": "string" },
        "price": { "type": "string" }
      }
    },
    "execution_type": "single"
  }'
```

## Step 2: run the task

```bash theme={null}
curl -X POST "$TITAN_API_URL/api/v1/tasks/$TASK_ID/run" \
  -H "Authorization: Bearer $TITAN_TOKEN"
```

## Step 3: poll for completion

```bash theme={null}
curl "$TITAN_API_URL/api/v1/executions/$EXECUTION_ID" \
  -H "Authorization: Bearer $TITAN_TOKEN"
```

Continue polling until the execution reaches `completed`.

## Step 4: export the result

```bash theme={null}
curl "$TITAN_API_URL/api/v1/executions/$EXECUTION_ID/results/export" \
  -H "Authorization: Bearer $TITAN_TOKEN"
```

## Why this example matters

This flow validates the full user path:

* Authentication
* Task creation
* Execution lifecycle
* Result retrieval

It is the best first test before moving to scheduled or media-aware tasks.

## Next steps

* [Quickstart: run your first task](/get-started/quickstart-run-your-first-task)
* [Example: scheduled monitoring workflow](/examples/example-scheduled-monitoring-workflow)
* [Use the Task Service API](/use-the-platform/use-the-task-service-api)
