Using All Bins API for a Collection, you can fetch all the bins in a specific Collection. You can now paginate through all the records.
Root
https://api.jsonbin.io/v3
Route
/c/<COLLECTION_ID>/bins/<PAGE_NO>
Request Type
GET
Request Headers
Header | Value | Required |
X-Master-Key | <YOUR_SECRET_KEY> | Yes |
X-Sort-Order | ascending/descending | No |
X-Master-Key
X-Master-Key is required to Create a Collection. You can find your X-Master-Key on the API Keys page after signing-in.
Basic Code Samples
curl -v\
-H "X-Master-key: <YOUR_API_KEY>" \
--request GET \
https://api.jsonbin.io/v3/c/<COLLECTION_ID>/bins/1
let req = new XMLHttpRequest();
req.onreadystatechange = () => {
if (req.readyState == XMLHttpRequest.DONE) {
console.log(req.responseText);
}
};
req.open("GET", "https://api.jsonbin.io/v3/c/<COLLECTION_ID>/bins/1
", true);
req.setRequestHeader("X-Master-Key", "<YOUR_API_KEY>");
req.send();
import requests
url = 'https://api.jsonbin.io/v3/c/<COLLECTION_ID>/bins/1
'
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/<COLLECTION_ID>/bins/1
")
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 200
[
{
"record": "RECORD_ID",
"createdAt": "2021-01-12T12:58:01.515Z",
"metaData": {
"name": "Hello World"
}
},
...
]
Error 400, 401, 403
{
"message": "<ERROR_MESSAGE>"
}
Status Code | Error Message |
---|---|
401 Unauthorized |
You need to pass X-Master-Key in the header |
401 Unauthorized |
Invalid X-Master-Key provided |
422 Unprocessible Entity |
Invalid Collection Id provided |
404 Not Found |
Collection not found |
403 Forbidden |
Requests exhausted. Buy additional requests at https://jsonbin.io/pricing |