API Academy
🌐 English
  • 🌐 English
  • 🌐 繁體中文
HomePetstore APIExplore more APIs
HomePetstore APIExplore more APIs
🌐 English
  • 🌐 English
  • 🌐 繁體中文
🌐 English
  • 🌐 English
  • 🌐 繁體中文
  1. Get Started
  • Introduction
  • Table of Contents
  • API Academy
    • Get Started
      • What is an API?
      • How Does an API Work?
      • How to Call an API?
      • How to Read an API Documentation?
      • Chapter Summary
      • Get realtime weather
        GET
    • API Fundamentals
      • API Funtamentals: Overview
      • Method & Path
      • Parameters
      • Request Body
      • Responses
      • API Specification & OAS
      • Chapter Summary
    • Working with APIs
      • Working with APIs: Overview
      • Making Requests from Spec
      • Environments and Variables
      • Chaining Multiple Endpoints
      • Handling Authentication
      • Handling API Signatures
      • Introduction to Scripts
      • Chapter Summary
    • Mocking APIs
      • Mocking APIs: Overview
      • Smart Mock
      • Mock Expectations
      • Cloud Mock
      • Mock Scripts
      • Chapter Summary
    • Designing APIs
      • Designing APIs: Overview
      • Introduction to API Design
      • Creating Your First API Project
      • Analyzing Requirements and Planning Your API
      • Designing Data Models
      • Designing Endpoints
      • Using Components and Reusability
      • Setting Up Authentication
      • API Design Guidelines
      • Chapter Summary
    • Developing APIs
      • Developing APIs: Overview
      • Setup: Install Your AI Coding Assistant
      • Quick Start: From Spec to Running API in 30 Minutes
      • Understanding the Generated Code
      • Testing Your API with Apidog
      • Deployment: Put Your API Online
      • Chapter Summary
    • Testing APIs
      • Testing APIs: Overview
      • Getting Started: Your First Test Scenario
      • Integration Testing and Data Passing
      • Dynamic Values
      • Assertions and Validations
      • Flow Control: If, For, ForEach
      • Data-Driven Testing
      • Performance Testing
      • Test Reports and Analysis
      • CI/CD Integration
      • Scheduled Tasks and Automation
      • Advanced Testing Strategies
      • Chapter Summary
    • API Documentations
      • API Documentations: Overview
      • Publishing Your First API Doc
      • Customizing Documentation Appearance
      • Interactive Features for Consumers
      • Advanced Publishing Settings
      • Managing API Versions
      • Chapter Summary
    • Advanced API Technologies
      • API Technologies: Overview
      • GraphQL
      • gRPC
      • WebSocket
      • Socket.IO
      • Server-Sent Events (SSE)
      • SOAP
      • Chapter Summary
    • API Lifecycle
      • API Lifecycle: Overview
      • Stages of the API Lifecycle
      • API Governance
      • API Security Best Practices
      • Monitoring and Analytics
      • API Versioning Strategies
      • The Future of APIs
      • Chapter Summary
    • API Security
      • API Security: Overview
      • API Security Fundamentals
      • Authentication vs Authorization
      • Understanding OAuth 2.0 and OpenID Connect
      • JSON Web Tokens (JWT)
      • OWASP API Security Top 10
      • Encryption and HTTPS
      • Chapter Summary
    • API Tools
      • API Tools: Overview
      • The Evolution of API Tools
      • API Clients
      • Command Line Tools (cURL, HTTPie)
      • API Design and Documentation Tools
      • API Mocking Tools
      • API Testing Tools
      • All-in-One API Platforms
      • Chapter Summary
    • API Gateway
      • API Gateway: Overview
      • What is an API Gateway?
      • Key Features of API Gateways
      • API Gateway vs Load Balancer vs Service Mesh
      • Popular API Gateway Solutions
      • The BFF (Backend for Frontend) Pattern
      • Chapter Summary
  • Modern Pet Store
    • Pet
      • Get Pet
      • Update Pet
      • Delete Pet
      • Create Pet
      • List Pets
      • Upload Pet Image
    • User
      • Update User
      • Get User
      • Delete User
      • Login
      • Logout
      • Create User
    • Store
      • List Inventory
      • Create Order
      • Get Order
      • Delete Order
      • Callback Example
      • Pay for an Order
    • Payments
      • Pay Order
    • Chat
      • Create Chat Completion
    • Webhooks
      • Pet Adopted Event
      • New Pet Available Event
  • Schemas
    • Pet
    • Category
    • User
    • ApiResponse
    • OrderPayment
    • Tag
    • Order
    • Links-Order
    • PetCollection
    • Bank Card
    • Bank Account
    • Links
    • Error
HomePetstore APIExplore more APIs
HomePetstore APIExplore more APIs
🌐 English
  • 🌐 English
  • 🌐 繁體中文
🌐 English
  • 🌐 English
  • 🌐 繁體中文
  1. Get Started

How to Read an API Documentation?

When you're new to APIs, a API documentation page may look overwhelming. But once you know what each section means, reading any API becomes much easier.
Below we’ll walk through how to understand an API endpoint, how to build a request from it, and how to use the response.
Here is an example of an endpoint documentation: Get realtime weather.
Most REST API documentation is organized into the same key sections:

1. Basic Info#

1.Endpoint Title & Description#

[Get realtime weather](/docs/get-realtime-weather-24838732e0)

Realtime weather API method allows a user to get up to date current weather information in JSON.
This tells you:
What the endpoint does → returns current weather
Format → JSON
Use case → get the latest available data for a location

2. HTTP Method#

The most common HTTP methods include:
MethodMeaningTypical Usage
GETRetrieve dataFetch a weather report
POSTCreate dataCreate a user or submit a form
PUTReplace existing dataUpdate a full resource
PATCHPartially updateUpdate one field
DELETERemoveDelete an item
In our example, the method is GET.

3. Endpoint URL#

Example:
http://api.weatherapi.com/v1/current.json
This is the base URL you will send the request to.

2. Request#

This describes the request part that you send to the server.

1. Parameters#

Most GET endpoints use query parameters.
Other APIs may also include:
TypeWhere it AppearsExample Purpose
Query ParamsAfter ? in URLFilters, pagination
Path ParamsInside the URL/user/{id}
HeadersSeparate sectionAuthentication tokens
Body ParamsRequest bodyJSON sent when POSTing
In WeatherAPI’s example, there a three query params in the URL, which appears after '?' and are divided by '&'.
http://api.weatherapi.com/v1/current.json?key=3432a351afd04b30bef75833252711&q=New%20York&aqi=no
NameRequiredTypePurpose
keyrequiredstringAPI key
qrequiredstringLocation
aqioptionalstringInclude air quality
If an API has more parameters, docs will usually allow extending the URL:
?limit=20&offset=40&sort=created

2. Request Body (if applicable)#

For GET requests: usually no body.
For POST/PUT/PATCH: the body can be:
JSON (most common)
Form data
XML
Multipart (e.g., file upload)
Example JSON body (not from WeatherAPI):
{
  "title": "Hello",
  "content": "This is a post"
}

3. Example Request (Helpful but Not Mandatory)#

Examples help you verify that the format you send is correct.

3. Response#

This part describes what the server return to you.

1. HTTP code#

When you look at an API’s response section, one of the first things you'll see is the HTTP status code.
Status codes tell you whether the request succeeded or failed. They are universal across almost all REST APIs.
In WeatherAPI’s response spec, the primary success example is:
🟢 200 OK
200 OK means your request succeeded. Whether you're fetching weather data, user info, or product lists—successful reads almost always return 200.
Good API docs also include other HTTP codes:
StatusMeaning
400Bad request
401Unauthorized
404Not found
500Server error

2. Response Specification#

This is one of the most important parts.
It explains:
what fields you will receive
each field’s data type
its meaning
whether it is required
Example snippet:
location (object)
  name: string (required)  — Name of the location
  region: string (required)
  country: string (required)
  lat: number (required)
  lon: number (required)
This tells you:
The response includes a top-level field location
Inside it are required fields such as name, lat, lon
You’ll use this information to parse the response.

3. Example Response (Very Useful)#

{
  "location": { ... },
  "current": { ... }
}
An example response shows you the actual shape and helps you confirm your code or API tool (like Apidog) is working.

4. Key Takeaways#

Once you understand these core sections—method, URL, parameters, request body, status codes, and response structure—API documentation becomes far less intimidating. Almost all REST APIs follow this same pattern, so the skills you learn here apply everywhere.
With this foundation, you can confidently read any API documentation, build correct requests, and interpret the responses you receive. From here, you can start experimenting with real APIs in tools like Apidog and gradually move on to more advanced concepts such as authentication, pagination, and error handling.
You’ve now taken the first major step toward becoming comfortable and productive with APIs.

Now you’ve learned the basics of how to read API documentation. Let's wrap up this chapter with a Chapter Summary before diving into API fundamentals.
Modified at 2025-12-29 10:42:25
Previous
How to Call an API?
Next
Chapter Summary
Built with