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);
JSON:API — A specification for building APIs in JSON
I would love to get a better understanding of what sets this apart from Open API or JSON schema. More on reddit.com
Have you ever worked with APIs that implements, or at least follow the {json:api} specification? And how was your experience with it?
I've never heard of it. We only followed REST rules and designed the schemas for JSON data ourselves More on reddit.com
GraphQL vs. JSON:API
For me the main advantage of Graphql over anything is the tooling: Code first graphql is great. Nexus for instance allows to generate a graphql schema directly from your backend code. Once you have that schema, you can generate types and boilerplate code for your clients to call your API in a typesafe way. Thus eliminating the need for a lot of testing and enabling a really good DX. In a monorepo, you can have all that process mostly automated, and it can feel like magic sometimes when you have a process that watches your file changes, generates your client libraries, and you see your new changes directly available on the front end. If you made a breaking change in your backend for instance, you can see typescript errors immediately on the front end. if you use React Apollo Client / Relay are awesome libraries that do a lot of heavy lifting for you and allow you to build faster. Front end development with graphql is great thanks to fragments that you can declare besides the components that use them, allowing you to reuse in a typesafe way components in multiple queries really easily. I don’t see JSON:API solving most of those problems, not by itself at least! More on reddit.com
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 ...
00:49
API Response: Turn Raw Data into Usable JSON in Seconds! - YouTube
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.
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 › 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.
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:
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.
CRAN
cran.r-project.org › web › packages › jsonlite › vignettes › json-apis.html
Fetching JSON data from REST APIs - CRAN
Below an example from the ProPublica Nonprofit Explorer API where we retrieve the first 10 pages of tax-exempt organizations in the USA, ordered by revenue. The rbind_pages function is used to combine the pages into a single data frame. #store all pages in a list first baseurl <- "https://projects.propublica.org/nonprofits/api/v2/search.json?order=revenue&sort_order=desc" pages <- list() for(i in 0:10){ mydata <- fromJSON(paste0(baseurl, "&page=", i), flatten=TRUE) message("Retrieving page ", i) pages[[i+1]] <- mydata$organizations } #combine all into one organizations <- rbind_pages(pages) #check output nrow(organizations)
ReqBin
reqbin.com › req › 4gvqbdi1 › json-response-format-example
What is the correct JSON Response Format?
December 23, 2022 - 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.