How to get started with the Stats API using Postman
Postman is a simple interface that you can use for our stats API. To help you get started, here are the step by step instructions:
-
Log in to your Postman account.
-
Go to "My Workspace" and then "Collections" to create a new collection. Feel free to give it a descriptive name such as "Plausible Stats API".
![Create a new collection](/docs/img/how-to-get-started-with-the-stats-api-using-postman-1.png)
- Once you've created the collection, you should have the authorization tab open in which you can select the Bearer Token type for authorization:
![Select the Bearer Token type for authorization](/docs/img/how-to-get-started-with-the-stats-api-using-postman-2.png)
-
In the Token field, you should paste your Plausible Stats API key. You can obtain the Stats API key for your account by going to your Plausible account settings.
-
Once that's done, go ahead and save the collection at the top right:
![Save the collection at the top right](/docs/img/how-to-get-started-with-the-stats-api-using-postman-3.png)
- Then add a new request to this collection and again feel free to give it a descriptive name:
![Add a new request to this collection](/docs/img/how-to-get-started-with-the-stats-api-using-postman-4.png)
- Now, you can copy an example query from our stats API documentation, and paste it into the request field as follows:
![Copy an example query from our documentation, and paste it](/docs/img/how-to-get-started-with-the-stats-api-using-postman-5.png)
This will automatically read the different parameters and display them at the bottom. You can modify the parameters from the URL and in the bottom section too.
-
Hit send and you should see the response. This should be formatted as JSON by default. You can choose some other formatting if you like.
-
Now, you probably want to export this data. For that, you can either download the response as a .json file (Save Response), or copy it to your clipboard:
![Download the response as a .json file (Save Response)](/docs/img/how-to-get-started-with-the-stats-api-using-postman-7.png)
- To convert the data into the CSV format, you should copy the response to your clipboard, and paste it into a tool like this one.
You can save the request to use it again in the future. You can also create new ones and save them as well. Have fun exploring!