> ## 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.

# Search, Then Fetch Full Page Content

> Find pages with TinySearch, then read their full content as markdown with TinyFetch

> [!NOTE]
>
> **Capability:** TinySearch + TinyFetch

Use this when snippets are not enough. TinySearch finds the pages, then TinyFetch returns the full extracted content of the top results.

```python Python theme={null}
from tinyfish import TinyFish

client = TinyFish()

results = client.search.query(query="TinyFish web agent", location="US")
top_urls = [r.url for r in results.results[:3]]

pages = client.fetch.get_contents(urls=top_urls, format="markdown")
for page in pages.results:
    print(f"## {page.title}")
    print(page.text[:200], "\n")
```

```typescript TypeScript theme={null}
import { TinyFish } from "@tiny-fish/sdk";

const client = new TinyFish();

const results = await client.search.query({
  query: "TinyFish web agent",
  location: "US",
});
const topUrls = results.results.slice(0, 3).map((r) => r.url);

const pages = await client.fetch.getContents({
  urls: topUrls,
  format: "markdown",
});
for (const page of pages.results) {
  console.log(`## ${page.title}`);
  console.log(page.text.slice(0, 200), "\n");
}
```

See [TinyFetch](https://docs.tinyfish.ai/tinyfetch.md) for the options you can pass to `get_contents`.

## Common Mistakes

> [accordion] Passing every result to Fetch
>
> A single Fetch request accepts at most 10 URLs. A search page returns up to 10 results, but you usually only need the top few. Slice the list, as the samples above do.

> [accordion] Treating a failed page as a failed batch
>
> Fetch returns a `results` list and an `errors` list. A page that could not be fetched appears in `errors` while the others still come back, so check both.

## Related

> [card] [TinyFetch](https://docs.tinyfish.ai/tinyfetch.md)
>
> Extract page content from URLs

> [card] [TinySearch API Reference](https://docs.tinyfish.ai/tinysearch/reference)
>
> Every parameter, accepted value, and error code


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