Skip to main content

Your First Podchaser Query

Just getting started with the API? Let's take a look at how you can interact with it.

If you have not used a GraphQL API before, we recommend reviewing at least the first few pages of the GraphQL tutorial on graphql.org to get familiar with the terminology and concepts.

For all of our queries and mutations, you will be making a POST request to our https://api.podchaser.com/graphql endpoint.

A great way to start exploring the API is using a tool such as Postman. If using Postman, be sure to set the body type to GraphQL.

Postman request screen with the body set to GraphQL.

Getting Your Access Token

Before you can make any queries, you will need to get your access token. If you haven't already, you can follow our Authorization instructions for getting your access tokens.

Making Your First Query

Now that you have your token, let's do a simple podcasts query to retrieve some recent podcasts. To do so, we will again submit a POST request to https://api.podchaser.com/graphql. This time, we will use the podcasts query.

Many of our queries return a paginated list object that has the returned data inside the data key. You can select any of our podcast attributes by selecting fields within the data object. For now, let's select the title and description fields for some podcasts.

Note: If you are using Postman, you will set the Authorization type to "Bearer Token" and add your access token. If you are using a library within your code, make sure to add an authorization header as "Bearer YOURTOKEN".

Postman request screen with the Authorization type set to Bearer Token with a token entered into the text field.

The query will look like this:

POST https://api.podchaser.com/graphql

Authorization: Bearer YOURTOKEN
query {
podcasts {
data {
title,
description
}
}
}

And, we will get a response like this (though shortened here for brevity):

{
"data": {
"podcasts": {
"data": [
{
"title": "Stuff You Should Know",
"description": "If you've ever wanted to know about champagne, satanism, the Stonewall Uprising, chaos theory, LSD, El Nino, true crime and Rosa Parks, then look no further. Josh and Chuck have you covered."
},
...other podcasts...
]
}
}
}

Now that you have a general idea on how our queries work, you should review the documentation for some of our main queries in our API reference or view some of our other guides.

Once you created your queries, you will then want to start writing these in your language using a client-side library. You can find libraries over on the graphql.org language support page.