🪄

Custom APIs

 
If you have an API hosted at a particular URL, you can probably use it with Pico. Note that if the API requires an API key, that key will be exposed in the browser so make sure to set up usage limits to avoid overspending.
 
Here’s a quick tutorial of using TheCatAPI, which is a simple API that returns a list of random cat images.
 
Step 1: Open up the API docs
 
Write down the following:
  1. URL
  1. Method
  1. Request parameters
  1. Response format (preferably including a sample response)
 
Step 2: Describe the API to Pico
 
Here, we first describe the UI of the app, then the user interactions and how they tie into the API call, and then finally, we describe the API in detail using the information we noted down in Step 1.
 
notion image
 
That’s it. Here’s the resulting app we got after issuing the previous update.
 
notion image
Â