URL: https://docs.prepr.io/graphql-api/get-started

# Getting started with the Prepr GraphQL API

*This guide shows you how to make your first request to fetch data from the Prepr GraphQL API in three easy steps.*

## Making your first API request

### Sign up for a Prepr account

Go to [signup.prepr.io](https://signup.prepr.io/?plan=free) to create your free account in seconds and you can start exploring Prepr.
After your account is created, you'll be prompted to [add an environment](https://docs.prepr.io/project-setup/setting-up-environments).
Choose to load demo data to get you going quickly.

### Get your API URL

Now you have a Prepr account with a demo environment, but before you can make any API requests, you need the API endpoint and access token.
The API endpoint is a specific URL that allows you to access a service provided by the API, while the access token grants permission to the API services.

When you add an environment, Prepr provides two API endpoints by default, *GraphQL Production* and *GraphQL Preview*.
Each of these has a unique access token with their relevant [permission scope](https://docs.prepr.io/graphql-api/authorization).

![Access tokens](https://assets-site.prepr.io/3kdyjg8srggm//prepr-generated-access-tokens.png)

To get an *API URL*, click the icon and choose the **Access tokens** option and click to open the *GraphQL Production* access token.

![GraphQL production access token example](https://assets-site.prepr.io/nl31q4rdm7c//graphql-api-token-example.png)

> **Note:**
>
> Typically, you'd use the **GraphQL Production** endpoint for your live web app to show only published content, while **GraphQL Preview** is for preview or test versions of the web app to allow editors to preview content that is not ready for production.

### Send your first API request

Now you're ready to make your first basic request. You can use the *API Explorer* to test your API requests directly in Prepr before adding them to your front-end application.

To open the *API Explorer*, simply click the **Open in API Explorer ->** link just below the *API URL* field in the **GraphQL Production** access token page.

You’ll be redirected to the *API Explorer* interface which connects to the *GraphQL Production* endpoint automatically.

![API Explorer](https://assets-site.prepr.io/w_1920/4a8b15d16z4t-api-explorer.png)

For your first query, retrieve all published blog posts available in the demo data like in the list below.

![published blog posts](https://assets-site.prepr.io/71qf0is5g8yk//published-blog-posts.png)

Copy and paste the following query to the **Operation** pane and click the **Run** button.

**REQUEST**

```graphql copy
query {
  Posts {
    items {
      _id
      title
    }
  }
}
```

**RESPONSE**

```json copy
{
  "data": {
    "Posts": {
      "items": [
        {
          "_id": "74ca82e9-85cc-4d13-a931-d1a40e90c5fd",
          "title": "Why Electric Cars Are the Future: Benefits, Technology & What’s Next𝅹‍𝅸⁠⁠⁠⁢‍‍⁡𝅸"
        },
        {
          "_id": "728f92f5-ed83-4a71-b8e5-37a005c4d62f",
          "title": "Business Car Leasing: The Ultimate Guide for Entrepreneurs & SMEs𝅸"
        },
        {
          "_id": "9e11147f-19f0-472c-864c-8418db5fa240",
          "title": "Electric Vehicle Leasing: Is It the Smart Choice in 2025?⁡𝅶‍𝅹‍𝅸⁠⁠⁠⁢‍‍⁡𝅸"
        },
        {
          "_id": "f1c158cc-34f2-4b19-9cc8-9b84feff9586",
          "title": "How to Get the Best Car Lease Deal: Insider Tips & Tricks𝅹‍𝅸⁠⁠⁠⁢‍‍⁡𝅸"
        },
        {
          "_id": "789faf67-de33-42fa-9242-d66f85d8fec5",
          "title": "The Top 5 Myths About Car Leasing Debunked⁡𝅶‍𝅹‍𝅸⁠⁠⁠⁢‍‍⁡𝅸"
        },
        {
          "_id": "f725f22d-49a1-47fe-9cd1-53cde06945a6",
          "title": "Car Leasing vs. Buying: Which Option is Right for You?⁡𝅶‍‍⁠𝅹‍𝅸⁠⁠⁠⁢‍‍⁡𝅸"
        }
       ]
    }
  }
}
```

Once your request is processed, check out the response. You will get a list of all published articles with their identifiers and titles.

That’s it. You’ve made your first call to the Prepr GraphQL API.

## What's next?

You can [try out your GraphQL queries](https://docs.prepr.io/graphql-api/test-queries) using the *Apollo Explorer* tool.

To learn more about the Prepr GraphQL API, check out the following resources:

- [API basics](https://docs.prepr.io/graphql-api/api-basics)
- [Authorization](https://docs.prepr.io/graphql-api/authorization)
- [Caching](https://docs.prepr.io/graphql-api/caching)

> **Note:**
>
> If you’re new to GraphQL, check out the [How to GraphQL](https://www.howtographql.com/) resource.