What Is a JSON Endpoint? Definition and Example

A JSON endpoint is a URL on a server that returns data as JSON instead of an HTML page. A browser shows HTML to a person. A JSON endpoint sends data to a program.

JSON is short for JavaScript Object Notation. It is a plain text format built from key and value pairs, lists, numbers, strings and the values true, false and null.

Every JSON endpoint is an API endpoint. The name only adds the fact that the reply is JSON.

A request and the reply

Ask for a list of users at one URL.

GET https://api.example.com/users

The server replies with a status line, headers and a body.

200 OK
Content-Type: application/json

{
  "users": [
    { "id": 1, "name": "Ana Silva", "email": "ana@example.com" },
    { "id": 2, "name": "Wei Chen", "email": "wei@example.com" }
  ],
  "total": 2
}

The body is the data. No page layout, no styling, no scripts.

What makes it a JSON endpoint

Three things have to be true.

PartRequirement
Response headerContent-Type: application/json
Response bodyValid JSON that a parser accepts
Status code200 for success, 4xx for a client mistake, 5xx for a server fault

The header matters as much as the body. Many client libraries decide whether to parse the reply by reading that header first.

The methods a JSON endpoint accepts

One URL usually serves several actions, split by HTTP method.

MethodMeaningUsual reply
GETRead data.200 with the records
POSTCreate a record.201 with the new record
PUTReplace a record.200 with the updated record
PATCHChange part of a record.200 with the updated record
DELETERemove a record.204 with an empty body

Public endpoints you can try

You can test a JSON endpoint without writing any code. Paste one of these into a browser tab.

URLWhat it returns
jsonplaceholder.typicode.com/postsA list of fake blog posts for testing.
jsonplaceholder.typicode.com/usersA short list of fake user records.
ip-api.com/jsonThe location guessed from your own address.

From a terminal the same request looks like this.

curl -s https://jsonplaceholder.typicode.com/users/1

Add -i to see the headers. That is the fastest way to confirm the content type.

How an endpoint is described

Endpoints are described by path, method and shape of the reply. Teams publish that description so other teams can build against it.

The common formats are OpenAPI for REST services and JSON Schema for the body itself. A schema states which fields exist, which are required, and what type each one holds.

Tools like Postman read those files and build a request form for you. That is why the same URL is called an API endpoint there.

Problems that come up most

  • Wrong content type. The body is JSON but the header says text/html, so the client refuses to parse it.
  • An error hidden inside a 200. The status says success and the body says "error". Return the real status code instead.
  • Blocked by the browser. A page on another domain needs the right cross-origin headers, or the request fails before the data arrives.
  • No pagination. An endpoint that returns every row will time out once the table grows. Return a page and a cursor.
  • Fields that appear and vanish. Removing a field breaks every client. Add fields, and retire old ones behind a version.

JSON or XML for the reply

JSON has largely replaced XML for web and mobile APIs. It is shorter, and every major language parses it without an extra library.

XML still wins where a strict contract or a signed document is needed. The longer comparison is in XML or JSON, which is better.

How to Prepare

  • Build one endpoint yourself. Return a list, add a filter, then add paging. Doing it once teaches more than reading about it.
  • Read the status codes. Know 200, 201, 204, 400, 401, 403, 404, 429 and 500, and when each is correct.
  • Practice the API design questions. Grokking System Design Fundamentals covers request formats, paging and rate limits.
  • Design a full service. Grokking the System Design Interview shows where endpoints sit next to caches, queues and databases.
  • Say the contract out loud. In a mock interview, name the path, the method and the reply shape before you draw anything.
TAGS
System Design Interview
CONTRIBUTOR
Arslan Ahmad
Arslan Ahmad
ex-FAANG engineering manager and author or Grokking series.

GET YOUR FREE

Coding Questions Catalog

Design Gurus Newsletter - Latest from our Blog
Boost your coding skills with our essential coding questions catalog.
Take a step towards a better tech career now!
Explore Answers
What is three step interview strategy?
What is the full form of GUI?
What not to do in system design interview?
Top companies recommending grokking system design for interview prep
Discover which companies' engineers recommend Grokking System Design for interview prep. Covers FAANG endorsements, success stories, what makes it the industry standard, and how top tech engineers use it.
What is &nbsp in HTML?
What is the salary of a fresher in Cisco?
Related Courses
New
Grokking the AI System Design Interview course cover
Grokking the AI System Design Interview
Learn to design AI systems the way interviewers expect: classic ML products, LLM and RAG architectures, and agentic systems, all through the lens of the system design interview.
4.6
(3,192 learners)
Discounted price for Your Region

$99

Grokking the Coding Interview: Patterns for Coding Questions course cover
Grokking the Coding Interview: Patterns for Coding Questions
The 24 essential patterns behind every coding interview question. Available in Java, Python, JavaScript, C++, C#, and Go. The most comprehensive coding interview course with 543 lessons. A smarter alternative to grinding LeetCode.
4.6
Discounted price for Your Region

$197

Grokking Modern AI Fundamentals course cover
Grokking Modern AI Fundamentals
Master the fundamentals of AI today to lead the tech revolution of tomorrow.
4.1
Discounted price for Your Region

$72

Design Gurus logo
One-Stop Portal For Tech Interviews.
About Us
Our Team
Careers
Partners
Contact Us
Become Affiliate
Copyright © 2026 Design Gurus, LLC. All rights reserved.