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

# Run TinyAgent Across Multiple URLs

> Fire the same goal at many URLs instead of looping one run at a time

> [!NOTE]
>
> **Capability:** concurrent runs

Use this when you need the same extraction on a batch of pages — a product
catalog, a list of competitor sites, a set of search results — instead of
waiting on one run before starting the next.

```python Python theme={null}
import asyncio
from tinyfish import AsyncTinyFish

async def main():
    client = AsyncTinyFish()

    urls = [
        "https://scrapeme.live/shop/",
        "https://books.toscrape.com/",
    ]
    goal = "Extract the first 5 item names and prices. Return as JSON."

    runs = await asyncio.gather(
        *(client.agent.run(url=url, goal=goal) for url in urls)
    )

    for run in runs:
        print(run.result)

asyncio.run(main())
```

Each run is independent and billed separately — a failure on one URL doesn't
affect the others. For hundreds or thousands of URLs, submit with
`/run-async` and poll instead of holding every request open at once; see
[Async Bulk Requests](https://docs.tinyfish.ai/examples/bulk-requests-async.md).

> [!TIP]
>
> No code? The **Projects** area in the dashboard runs the same goal across a
> list of URLs from the UI. It's rolling out gradually — if you don't see it
> yet, the API pattern above works today.

## Common Mistakes

> [accordion] Treating one failed URL as a failed batch
>
> Each run in the batch is independent and billed separately. A failure on
> one URL doesn't cancel or affect the others — check each run's own
> `status` and `result` individually instead of assuming the whole batch
> failed because one `await` rejected.

> [accordion] Writing one goal that doesn't fit every URL
>
> The same `goal` string runs against every URL in the list, so phrasing
> that only makes sense for one site's layout will under-perform on the
> others. Keep the goal generic enough to apply site-agnostically — see the
> [Goal Prompting Guide](https://docs.tinyfish.ai/prompting-guide.md#single-runs-vs-batch-execution)
> for batch-specific wording.

## Related

> [card] [Concurrent Requests](https://docs.tinyfish.ai/examples/bulk-requests-sync.md)
>
> Full sync-API batch example with error handling

> [card] [Async Bulk Requests](https://docs.tinyfish.ai/examples/bulk-requests-async.md)
>
> Submit thousands of runs and poll for results

> [card] [Goal Prompting Guide](https://docs.tinyfish.ai/prompting-guide.md#single-runs-vs-batch-execution)
>
> Write goals that return a consistent shape across every run


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.