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

# Fetch content via API

> Get your API token and retrieve your content using the ButterCMS REST API

With your content published, it's time to retrieve it using the ButterCMS API. In this step, you'll get your API token and learn how to fetch your content.

## Get your API token

Before making API calls, you need your API token. You can find it in your account settings:

<Steps>
  <Step title="Open Settings">
    Hover over your profile icon in the top-right corner and select **Settings** from the popout menu.
  </Step>

  <Step title="Copy Your Read API Token">
    Your **Read API Token** is displayed in the API section. Click to copy it.
  </Step>
</Steps>

### API token types

| Token type          | Purpose                           | Client-side safe? |
| ------------------- | --------------------------------- | :---------------: |
| **Read API Token**  | Fetch draft and published content |         ✅         |
| **Write API Token** | Create and update content         |         ❌         |

For this Quickstart, you only need the **Read API Token**.

<Warning>
  Never hardcode your API token directly in your source code. Always use environment variables or your hosting platform's secrets management system.
</Warning>

## Understanding the API endpoint

ButterCMS uses a REST API with a simple URL structure. For Pages, the basic GET endpoint is:

```text theme={null}
https://api.buttercms.com/v2/pages/{page_type}/{page_slug}/?auth_token={your_token}
```

For the landing page you created:

* **Page Type**: `landing-page`
* **Page Slug**: `homepage`

You can test your API connection with a simple cURL request:

```bash theme={null}
curl "https://api.buttercms.com/v2/pages/landing-page/homepage/?auth_token=YOUR_API_TOKEN"
```

Or try it directly in your browser by replacing `YOUR_API_TOKEN` with your actual token.

## Understanding the response

The API returns your content as structured JSON:

```json theme={null}
{
  "data": {
    "slug": "homepage",
    "name": "Homepage",
    "page_type": "landing-page",
    "fields": {
      "headline": "Welcome to Our Amazing Product",
      "hero_image": "https://cdn.buttercms.com/your-image-url",
      "body_content": "<p>Your rich text content here...</p>",
      "cta_button_text": "Start For Free",
      "cta_button_link": "/signup"
    }
  }
}
```

<Tip>
  For a description of what attributes are available in the JSON response, check out our [API Docs](../api-reference/pages/get-multiple-pages).
</Tip>

## What you've accomplished

<Check>
  You've successfully fetched your first page from the ButterCMS API!
</Check>

You now know how to:

* ✅ Locate your API token
* ✅ Construct API requests to fetch page content
* ✅ Parse the JSON response

## Next step

<Card icon="rocket" href="./next-steps" title="Next steps & resources">
  Explore advanced features and continue your ButterCMS journey.
</Card>
