List Collections API

Using the List Collections API, you could retrieve the meta data of all the collections you've created so far.

Info List Collections API will only return the IDs of the Collections you've created along with other Meta Data like Name & Created At timestamp. In-order to fetch the Bins from these collections, refer to Fetch Bins API for more info.

Root

https://api.jsonbin.io/v3 

Route

/c 

Request Type

GET

Request Headers

Below are the list of Accepted Request Headers if you are trying to Attach a Schema Doc to a Collection.

Request Header Value Required
X-Master-Key <API_KEY> Yes
X-Master-Key Required

X-Master-Key is nothing but your Core API Access Key. You will need this Key to access mostly any API end-point on JSONBin. You could find the key on the API Keys page.

Code Samples

  • cURL
  • JavaScript (ES6)
  • Python 3
  • Ruby
curl -v\
-H "X-Master-key: <YOUR_API_KEY>" \
--request GET \
  https://api.jsonbin.io/v3/c
let req = new XMLHttpRequest();

req.onreadystatechange = () => {
  if (req.readyState == XMLHttpRequest.DONE) {
    console.log(req.responseText);
  }
};

req.open("GET", "https://api.jsonbin.io/v3/c", true);
req.setRequestHeader("X-Master-Key", "<YOUR_API_KEY>");
req.send();
import requests
url = 'https://api.jsonbin.io/v3/c' 
headers = {
  'X-Master-Key': '<YOUR_API_KEY>'
}
data = {}
req = requests.get(url, json=data, headers=headers)
print(req.text)
require 'net/http'
require 'json'

uri = URI("https://api.jsonbin.io/v3/c")
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
  req = Net::HTTP::Get.new(uri)
  req['X-Master-Key'] = '<YOUR_API_KEY>'
  http.request(req) 
end 

puts res.body

Request Response

Success Status Code: 200
[
  {
      "record": "<COLLECTION_ID>",
      "collectionMeta": {
          "name": "<COLLECTION_NAME>"
      },
      "createdAt": "<DATE_TIME>"
  }
...
]
Error Status Code: 400, 401, 403
{
  "message": "<Error Message>"
}

For more information on the error codes & errors you might possibly encounter, refer to the below section.

Error Reference

  • 401 Unauthorized
  • 403 Forbidden
You need to pass X-Master-Key in the header

You'll encounter this error if you are not passing the X-Master-Key header which is required to authenticate your request while creating bins. In-order to fix this, pass the X-Master-Key header with a value of the API Key which you can find on the API Keys page.

Invalid X-Master-Key provided

Check if the X-Master-Key you've provided is valid.

Requests exhausted. Buy additional requests at https://jsonbin.io/pricing

You'll encounter this error if you've consumed all the available requests. You can purchase additional requests.

Collection not found

The Collection you are trying to fetch the Bins from, does not exists or does not belong to your account.

Create a Free Account

Create an Account View Pricing