Using the All Bins API, you can fetch all the bins which belongs to a specific collection.

Root
/e
Route
/e/collection/:collectionId/all-bins
Request Type
GET
Request Headers
Header Value Required
secret-key <YOUR_SECRET_KEY> Yes
secret-key

You'll need to pass a secret-key in the header to fetch all the bins which belongs to a collection.

Basic Code Samples
curl --header "secret-key: <SECRET_KEY>" \
       --request GET \
       https://api.jsonbin.io/e/collection/<COLLECTION_ID>/all-bins
let req = new XMLHttpRequest();

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

req.open("GET", "https://api.jsonbin.io/e/collection/<COLLECTION_ID>/all-bins", true);
req.setRequestHeader("secret-key", "<SECRET_KEY>");
req.send();
import requests
url = 'https://api.jsonbin.io/e/collection/<COLLECTION_ID>/all-bins'
headers = {'secret-key': '<SECRET_KEY>'}

req = requests.get(url, json=nil, headers=headers)
print(req.text)
require 'net/http'

uri = URI("https://api.jsonbin.io/e/collection/<COLLECTION_ID>/all-bins")
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
  req = Net::HTTP::Get.new(uri)
  req['secret-key'] = '<SECRET_KEY>'

  http.request(req)
end

puts res.body
Request Response
Success
200
{
  "records": [
    {
      "id": "<BIN_ID>"
    },
    {
      "id": "<BIN_ID>"
    }
  ],
  "success": true
}
Error
422, 404, 401
{
  "message": "<ERROR_MESSAGE>",
  "success": false
}
Status Code Error Message
422 Unprocessible Entity
Invalid Collection ID

Fix: You need to pass a valid Collection ID to fetch the all the bins from a collection.

401 Unauthorized
Need to provide a secret-key to fetch all the bins of a collection

Fix: While fetching all the bins of a collection, you need to pass secret-key header to Read the bin IDs from a collection.

401 Unauthorized
Invalid secret key provided.

Fix: Ensure that you are passing a valid secret-key in the headers.