GET /api/v1/ping • HTTP 200 OK

Simple GET API Call (Hello World & Ping) — Request & Response Example

An introductory example of an API call demonstrating how a client program sends an HTTP GET request to an endpoint and receives a structured JSON response with an HTTP 200 status code.

1. HTTP Client Request (GET)

GET /api/v1/ping HTTP/1.1
{
  "Accept": "application/json",
  "User-Agent": "Cometflow-API-Client/1.0"
}

2. Server JSON Response (HTTP 200 OK)

{
  "status": "online",
  "message": "Hello World! API server is healthy and responding.",
  "version": "1.0.4",
  "uptime_seconds": 489201,
  "server_time": "2026-10-06T12:00:00.000Z"
}

Copy-Paste Code Snippets (cURL, JavaScript Fetch, Python, Node.js)

curl -X GET "https://cometflow.space/api/v1/ping?timestamp=1728211200" \
  -H "Accept: application/json"
fetch('https://cometflow.space/api/v1/ping?timestamp=1728211200', {
  method: 'GET',
  headers: {
    'Accept': 'application/json'
  }
})
  .then(res => res.json())
  .then(data => console.log(data));
import requests

url = "https://cometflow.space/api/v1/ping"
params = {"timestamp": "1728211200"}
headers = {"Accept": "application/json"}

response = requests.get(url, params=params, headers=headers)
print(response.status_code)
print(response.json())

How This API Call Works Step-by-Step

  1. 1. Client Request: Your browser or code sends an HTTP GET request over the internet to the server endpoint /api/v1/ping.
  2. 2. DNS & Connection: The domain resolves to an IP address, establishes a secure TLS handshake (HTTPS), and delivers the HTTP packet.
  3. 3. Server Processing: The backend server receives the request, checks its internal health check function, and formats a JSON reply.
  4. 4. HTTP Response: The server returns status code 200 (OK) with headers and the JSON body containing the server status.

Backend API Functions: In API architecture, "API functions" are the backend controller methods that map to specific routes. Here, a function named checkHealth() executes on the server when an incoming GET /api/v1/ping arrives, serializing an object to JSON and sending it down the wire.

Frequently Asked Questions

How can someone understand API call meaning through a request and response example?

Think of an API call like ordering at a restaurant. The Request is what you ask the waiter (the method "GET" is asking to look at something, the endpoint is the menu item, and the headers are your language). The Response is the plate brought back from the kitchen (Status 200 means served successfully, and the JSON body is the actual food/data).

What is a simple API?

A simple API is an interface where a client sends a basic HTTP request (usually GET or POST) to a URL with zero complicated authentication, and receives standard, readable JSON data back.