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

# Fetch

> Use the Browserbase Fetch skill to retrieve page HTML or JSON, inspect HTTP status and headers, and follow redirects from your coding agent.

The `fetch` skill teaches your coding agent to retrieve a URL through the Browserbase Fetch API. Use it for page content, JSON responses, status codes, or headers when you don't need a browser to render JavaScript or interact with the page.

## Install

Set `BROWSERBASE_API_KEY` in your environment, then install the skill for your coding agent:

```bash theme={null}
npx skills add browserbase/skills --skill fetch
```

The skill can call Fetch with `curl` or the Browserbase SDK. It doesn't require the Browse CLI or a browser session.

## Retrieve a page

```text theme={null}
Use the fetch skill to retrieve https://example.com. Follow redirects,
report the HTTP status and content type, and summarize the page content.
```

Your agent receives the response body, HTTP status, headers, content type, and encoding. It can inspect these before deciding whether to retry or use a browser.

## When to use a browser

If the response lacks content that the site renders with JavaScript, use the [Browse CLI skill](/integrations/skills/browse-cli). Use a browser for clicking, filling forms, and navigating authenticated workflows too.

For redirects, ask your agent to enable `allowRedirects`. Check the returned HTTP status before treating the content as a successful result.

## Further reading

<CardGroup cols={2}>
  <Card title="Fetch API" icon="download" href="/platform/fetch/overview">
    Explore request options and API examples.
  </Card>

  <Card title="Skill source" icon="github" href="https://github.com/browserbase/skills/tree/main/skills/fetch">
    View setup, examples, and error handling.
  </Card>
</CardGroup>


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