Yes there are a couple of standards (albeit some liberties on the definition of standard) that have emerged:
- JSON API - JSON API covers creating and updating resources as well, not just responses.
- JSend - Simple and probably what you are already doing.
- OData JSON Protocol - Very complicated.
- HAL - Like OData but aiming to be HATEOAS like.
There are also JSON API description formats:
- Swagger
- JSON Schema (used by swagger but you could use it stand alone)
- WADL in JSON
- RAML
- HAL because HATEOAS in theory is self describing.
Top answer 1 of 16
894
Yes there are a couple of standards (albeit some liberties on the definition of standard) that have emerged:
- JSON API - JSON API covers creating and updating resources as well, not just responses.
- JSend - Simple and probably what you are already doing.
- OData JSON Protocol - Very complicated.
- HAL - Like OData but aiming to be HATEOAS like.
There are also JSON API description formats:
- Swagger
- JSON Schema (used by swagger but you could use it stand alone)
- WADL in JSON
- RAML
- HAL because HATEOAS in theory is self describing.
2 of 16
327
Google JSON guide
Success response return data
{
"data": {
"id": 1001,
"name": "Wing"
}
}
Error response return error
{
"error": {
"code": 404,
"message": "ID not found"
}
}
and if your client is JS, you can use if ("error" in response) {} to check if there is an error.
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › API › Response › json
Response: json() method - Web APIs | MDN
const myList = document.querySelector("ul"); const myRequest = new Request("products.json"); fetch(myRequest) .then((response) => response.json()) .then((data) => { for (const product of data.products) { const listItem = document.createElement("li"); listItem.appendChild(document.createElement("strong")).textContent = product.Name; listItem.append(` can be found in ${product.Location}. Cost: `); listItem.appendChild(document.createElement("strong")).textContent = `£${product.Price}`; myList.appendChild(listItem); } }) .catch(console.error);
Videos
05:17
Getting Data From an External JSON Response - YouTube
02:57
What is JSON? Simple Explanation with Real API Examples! #coding ...
07:29
Python for Beginners #18: Make JSON API Calls & Handle Responses ...
03:08
How to get OpenAI API response in JSON format reliably🔥: Python ...
33:51
Access JSON Data in an API Response | Workflows Online Meetup - ...
09:22
Format API JSON Response Using @JsonProperty and @JsonInclude - ...
JSON:API
jsonapi.org
JSON:API — A specification for building APIs in JSON
}, "relationships": { "author": { "data": { "type": "people", "id": "2" } } }, "links": { "self": "http://example.com/comments/5" } }, { "type": "comments", "id": "12", "attributes": { "body": "I like XML better" }, "relationships": { "author": { "data": { "type": "people", "id": "9" } } }, "links": { "self": "http://example.com/comments/12" } }] } The response above contains the first in a collection of “articles”, as well as links to subsequent members in that collection. It also contains resources linked to the article, including its author and comments. Last but not least, links are provided that can be used to fetch or update any of these resources. JSON:API covers creating and updating resources as well, not just responses.
JSON:API
jsonapi.org › examples
JSON:API — Examples
See “Square Brackets in Parameter ... to have name field only. HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "data": [{ "type": "articles", "id": "1", "attributes": { "title": "JSON:API paints my bikeshed!", "body": "The shortest article....
Atlassian
developer.atlassian.com › server › crowd › json-requests-and-responses
JSON requests and responses
curl -i -u application_name:application_password --data '{"value": "my_password"}' http://localhost:8095/crowd/rest/usermanagement/1/authentication?username=my_username --header 'Content-Type: application/json' --header 'Accept: application/json' ... { "reason" : "INVALID_USER_AUTHENTICATION", "message" : "Failed to authenticate principal, password was invalid" } ... { "expand" : "attributes", "link" : { "rel" : "self", "href" : "http://localhost:8095/crowd/rest/usermanagement/1/user?username=my_username" }, "name" : "my_username", "first-name" : "My", "last-name" : "Username", "display-name"
JSON:API
jsonapi.org › format
JSON:API — Latest Specification (v1.1)
According to the profile, the attribute ... With such a profile applied, a response might appear as follows: HTTP/1.1 200 OK Content-Type: application/vnd.api+json;profile="https://example.com/resource-timestamps" // ......
JSONPlaceholder
jsonplaceholder.typicode.com
JSONPlaceholder - Free Fake REST API
fetch('https://jsonplaceholder.typicode.com/todos/1') .then(response => response.json()) .then(json => console.log(json)) Run script · {} Congrats! You've made your first call to JSONPlaceholder. 😃 🎉 · JSONPlaceholder is a free online REST API that you can use whenever you need some fake data. It can be in a README on GitHub, for a demo on CodeSandbox, in code examples on Stack Overflow, ...or simply to test things locally.
Red Hat
docs.redhat.com › en › documentation › red_hat_satellite › 6.3 › html › api_guide › sect-api_guide-understanding_the_json_response_format
2.2. Understanding the JSON Response Format | API Guide | Red Hat Satellite | 6.3 | Red Hat Documentation
The output was piped through json.tool to make the results section easier to read. curl -X GET -k -u admin:password https://satellite6.example.com/api/domains | python -m json.tool { "total": 3, "subtotal": 3, "page": 1, "per_page": 20, "search": null, "sort": { "by": null, "order": null }, "results": [ { "id": 23, "name": "qa.lab.example.com", "fullname": "QA", "dns_id": 10, "created_at": "2013-08-13T09:02:31Z", "updated_at": "2013-08-13T09:02:31Z" }, { "id": 25, "name": "sat.lab.example.com", "fullname": "SATLAB", "dns_id": 8, "created_at": "2013-08-13T08:32:48Z", "updated_at": "2013-08-14T07:04:03Z" }, { "id": 32, "name": "hr.lab.example.com", "fullname": "HR", "dns_id": 8, "created_at": "2013-08-16T08:32:48Z", "updated_at": "2013-08-16T07:04:03Z" } ] }
Apidog
apidog.com › blog › json-api-responses
Mastering API Responses: The Definitive Guide to JSON Formatting
July 21, 2025 - Status Code: Indicates the result of the API call, such as success or error. Headers: Provide metadata about the response, like content type and cache directives. Body: Contains the actual data payload, formatted as a JSON object or array. For example, a successful response from an API might look like this:
ReqBin
reqbin.com › req › chcn9woc › rest-api-get-example
How do I get JSON from a REST API endpoint?
The server informs the client that it has returned JSON by sending "Content-Type: application/json" in response. The following is an example of a REST API GET request to the ReqBin API endpoint:
ReqBin
reqbin.com › req › gzezk8d5 › json-response-example
How do I return JSON in response?
In this JSON response example, we send a request to the ReqBin echo URL and provide the "Accept: application/json" request header to tell the server that the client is expecting JSON.
Typeform
typeform.com › developers › responses › JSON-response-explanation
Responses API JSON response explanation
"field": { "id": "vD4bCXm9bnSf", "type": "multi_format", "ref": "my_custom_multiformat_reference" }, "type": "multi_format", "multi_format": { "audio_url": "https://api.typeform.com/media/audios/e8211f3c-df88-4fd0-9639-af4fc1c5bf6g", "audio_transcript": "One, two, three.", // either audio or video "video_url": "https://api.typeform.com/media/videos/450d691c-6c9e-42cd-9707-aa35a4bc1f28", "video_transcript": "One, two, three." } ... NOTE: To download the video/audio file please refer to the Request/Download master file documentation · The final object in each response lists any Hidden Field and calculated values. In this example, our typeform doesn't use Hidden Fields (so that object is empty}, but it does include a calculated score:
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › API › Response › json_static
Response: json() static method - Web APIs | MDN
The code below creates a Response object with JSON body { my: "data" } and header set to application/json. ... The object has the following properties. Note the body and header are set as expected, and that the default status is set to 200. This example shows how you can create a JSON response ...
ReqBin
reqbin.com › req › j1lmcm1r › json-api-example
How do I post request to JSON API?
In this JSON API example, we send data to the ReqBin JSON API echo UR and provide the "Accept: application/vnd.api+json" and "Content-Type: application/vnd.api+json" HTTP headers to the server.
ReqBin
reqbin.com › req › 4gvqbdi1 › json-response-format-example
What is the correct JSON Response Format?
JSON Response Format Example · HTTP/1.1 200 OK Content-Type: application/json Content-Length: 19 {"success":"true"} JSON Payload Example · JSON API Example · How do I add comments to JSON? Convert your JSON Response Format request to the PHP, JavaScript/AJAX, Node.js, Curl/Bash, Python, Java, C#/.NET code snippets using the ReqBin code generator.
CRAN
cran.r-project.org › web › packages › jsonlite › vignettes › json-apis.html
Fetching JSON data from REST APIs
The code below includes some example keys for illustration purposes. #search for articles article_key <- "&api-key=b75da00e12d54774a2d362adddcc9bef" url <- "http://api.nytimes.com/svc/search/v2/articlesearch.json?q=obamacare+socialism" req <- fromJSON(paste0(url, article_key)) articles <- req$response$docs colnames(articles) [1] "abstract" "web_url" "snippet" "lead_paragraph" "print_section" "print_page" "source" [8] "multimedia" "headline" "keywords" "pub_date" "document_type" "news_desk" "section_name" [15] "byline" "type_of_material" "_id" "word_count" "uri" "subsection_name" #search for be