API

All requests support cross-origin resource sharing (CORS) and SSL.

Root

https://api.myjson.com/


Request JSON

GET /bins/:id


To pretty print returned JSON, add optional parameter:


?pretty=1


Server response:


200 OK - Your JSON data returned


jQuery Example (run in JSFiddle)


$.get("https://api.myjson.com/bins/:id", function(data, textStatus, jqXHR) {

});

Create a new JSON

POST /bins


Send JSON as String


'{"key":"value", ...}'

Server response:


201 Created - {"uri":"https://api.myjson.com/bins/:id"}


jQuery Example (run in JSFiddle)


$.ajax({
    url:"https://api.myjson.com/bins",
    type:"POST",
    data:'{"key":"value"}',
    contentType:"application/json; charset=utf-8",
    dataType:"json",
    success: function(data, textStatus, jqXHR){

    }
});     

Update a JSON

PUT /bins/:id


Send updated JSON as String


'{"key_updated":"value_updated", ...}'

Server response:


200 OK - Your JSON data returned


jQuery Example (run in JSFiddle)


$.ajax({
    url:"https://api.myjson.com/bins/:id",
    type:"PUT",
    data:'{"key_updated":"value_updated"}',
    contentType:"application/json; charset=utf-8",
    dataType:"json",
    success: function(data, textStatus, jqXHR){

    }
});