Using the Request Versions API, you can fetch all the versions of a specific Bin.

Root
https://api.jsonbin.io/
Route
/c/<BIN_ID>/versions
Request Type
GET
Request Headers
Header Value Required
secret-key <YOUR_SECRET_KEY> Optional
secret-key

secret-key is an optional header. It is required when you need to fetch versions for a Private bin. You can find your secret-key on the API Keys page after signing-in.

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

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

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

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

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

  http.request(req)
end

puts res.body
Request Response
Success
200
{
  "binVersions": [
    // other version objects
    {
      "version": 1,
      "created": "2018-07-24T19:26:06.360Z"
    }
  ],
  "versionCount": <VERSION_COUNT>,
  "success": true
}
Error
422, 404, 401
{
  "message": "<ERROR_MESSAGE>",
  "success": false
}
Status Code Error Message
422 Unprocessible Entity
Invalid Bin ID

Fix: You need to pass a valid Bin ID to fetch the version details.

404 Not Found
No versions found

Fix: No versions are available for the particular bin you tried to fetch the version details for.

404 Not Found
No versions found

Fix: No versions are available for the particular bin you tried to fetch the version details for.

401 Unauthorized
Need to provide a secret-key to READ private bin versions

Fix: While fetching version details for a Private record, you need to pass secret-key header to Read the versions for the private record.