# Querying content

## API Keys

To query content you will need to set up an API key.  This can be done from the project settings screen.

![Click the cog here to access the project settings](/files/-MdzUQkFKHN43T6egy4i)

Click the "New token" button under the "API Tokens" section.

![](/files/-MdzUb4GcMNF1wyxV-Px)

Click the "GraphQL Playground" button to open a website where you can start querying content.

In this UI you will need to specify the token that was generated.

Click "HTTP Headers" down the bottom and enter the following

```
{
  "X-Token": "<< API TOKEN >>"
}
```

With this in place, you can start querying your content.

## Queries

There are two ways of querying your content.

1. Querying individual pieces of content - `entry()`
2. Querying a list of content of a specific type  - `entries { }`

The GraphQL root query has two queries to access your content - `entry` and `entries`

More information about what queries are available can be found in the GraphQL Playground.

### Individual entries

With `entry` you can query individual entries by ID or by Path.

```graphql
query GetBlogPost {
  entry(id: "...") {
    ... on IBlogPost {
      id
      # additional fields here
    }
  }
}
```

### Multiple entries

With `entries` you can query multiple entries of a type.

```graphql
query ListBlogPosts {
  entries {
    allBlogPost(skip: 0, take: 10, filter: { ... }) {
      nodes {
        id
        # additional fields here
      }
      totalCount
    }
  }
}
```

## Caching

A layer of caching is in place for the content querying endpoints.  Content will be cached indefinitely until a change to your content is made.  When a Publish occurs on an entry the cache will be cleared.

The more complex a GraphQL query is, the longer the initial request will take.  Subsequent cached queries will be drastically faster.

## GraphQL endpoint

<mark style="color:green;">`POST`</mark> `https://<region>.pokko.io/:project/:environment/graphql`

This endpoint allows you to get free cakes.

#### Path Parameters

| Name        | Type   | Description |
| ----------- | ------ | ----------- |
| environment | string |             |
| project     | string |             |

#### Headers

| Name    | Type   | Description |
| ------- | ------ | ----------- |
| X-Token | string |             |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pokko.io/basic-features/getting-started.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
