Make your first call to Graph Swiss API in three steps.Prerequisites#
The base URL: https://api.graph.swiss — see Base URL. Any HTTP client. The examples use curl and fetch.
1. Verify connectivity#
Hit /api/health to confirm the API is reachable. This endpoint is open and does not require an API key.{
"success": true,
"data": {
"status": "ok",
"uptime": 1287.42,
"timestamp": "2026-05-01T12:34:56.789Z"
}
}
2. Make your first authenticated call#
Send the X-API-Key header on every data request. Below we list active Swiss stock symbols.A successful response wraps the payload in a { success, data } envelope:{
"success": true,
"data": {
"total": 250,
"items": [
{ "symbol": "NESN", "name": "Nestlé S.A.", "currency": "CHF", "exchange": "SIX" }
]
}
}
3. Read the headers and the envelope#
Every response carries a few headers worth capturing:| Header | What it tells you |
|---|
X-Request-Id | Trace ID for this call — log it with the status code. |
X-Credit-Cost | Credits charged for this request. |
X-Remaining-Balance | Credits left on your account after this request. |
X-RateLimit-Remaining | Calls left in your current rate-limit window. |
And the JSON envelope is always one of:{ "success": true, "data": { } }
{ "success": false, "error": "...", "code": "MACHINE_READABLE_CODE" }
If success is false, switch on code to decide how to react. The full list lives on the Errors page.Next steps#
Authentication — how the X-API-Key header works and how credits are deducted Errors — handle the standard error envelope, including credit and rate-limit errors Conventions — JSON, versioning, and what to expect from every endpoint Modified at 2026-05-01 06:35:17