What an API is and how to connect to one for the first time
APIs explained without the jargon: what they are, how REST, JSON and keys work, and how to make your first call in the browser, the terminal, Python and JavaScript.
Published on October 18, 2026 · 4 min read
API stands for Application Programming Interface. The name is intimidating, but the idea is simple: an API is an agreed way for one program to ask another for data or actions. When your banking app shows your balance, when a site shows the weather forecast, or when a bot posts a result to Telegram, there is almost always an API behind it. This guide explains the concepts without jargon and ends with you making your first call.
An analogy that works
Think of a restaurant. You do not walk into the kitchen; you order from the waiter using the menu, and the dish comes back. The API is the waiter with the menu: it defines what you can order, how to order it and what comes back, and it hides the whole kitchen. You do not need to know how the data was collected, only how to ask for it.
The terms you will run into
| Term | What it is |
|---|---|
| Endpoint | A specific API address, like /latest, that returns one kind of data |
| Request | What your program sends to an endpoint |
| Response | What the API sends back, usually as JSON |
| JSON | A text format for data, with keys and values, that every language understands |
| API key | A password identifying who is asking and what they are allowed to access |
| HTTP status | A number saying how the request went: 200 worked, 401 is a missing key, 429 is too many requests |
| Per-minute limit | How many requests you can make in a minute, according to your plan |
What a REST API is
Most APIs on the internet are REST: you make HTTP requests, the same ones your browser makes when it opens a page, to addresses that represent the data. To read data, you use the GET method. The response comes back as JSON, and that is it.
Here is an example JSON response, from LynxMetrics' Bac Bo Live API:
{
"data": {
"id": "v1792354840763",
"outcome": "banker",
"settledAt": "2026-10-18T20:20:49.923Z",
"data": {
"player": { "dice": [1, 2], "score": 3 },
"banker": { "dice": [4, 5], "score": 9 },
"multiplier": null
}
}
}Even without knowing how to code, you can read it: the round ended at 20:20 (UTC), the Banker won 9 to 3, and there was no tie.
How to connect to an API, step by step
- Read the documentation. It tells you the base address, the endpoints, the parameters and how to send the key. At LynxMetrics, it is all in the documentation.
- Get a key. You usually create an account and generate the key in a dashboard. At LynxMetrics, the free 2-hour trial already gives you a key.
- Make your first call. Use the terminal, or a program like Postman or Insomnia, which show the response nicely formatted.
- Move it into code. With the call working, you repeat the same thing in your project's language.
- Handle the errors. Get your program ready for a wrong key, an exhausted limit or a dropped connection.
Your first call, four ways
In the terminal, with curl, which ships with Windows, macOS and Linux:
curl https://api.lynxmetrics.com/v1/bacbo-live/latest \ -H "x-api-key: YOUR_KEY"
In Python:
import requests
r = requests.get("https://api.lynxmetrics.com/v1/bacbo-live/latest", headers={"x-api-key": "YOUR_KEY"})
print(r.status_code, r.json())In JavaScript, on Node.js:
const r = await fetch("https://api.lynxmetrics.com/v1/bacbo-live/latest", {
headers: { "x-api-key": "YOUR_KEY" },
});
console.log(r.status, await r.json());With no key at all, you can look at a public API straight from the browser. Open api.lynxmetrics.com/v1/apis, which lists the LynxMetrics API catalogue with plans and prices, and see what real JSON looks like.
The most common errors
| Status | What it means | What to do |
|---|---|---|
| 401 | The key was not sent, is wrong or was revoked | Check the header and copy the key again from the dashboard |
| 403 | The key exists but has no access to what you asked for | Check that the key belongs to the right API and the plan is active |
| 404 | The address does not exist | Check the endpoint in the documentation |
| 429 | Too many requests in too little time | Wait the seconds given in the Retry-After header |
| 500 to 504 | An error on the API's side | Try again in a few seconds |
At LynxMetrics, every error comes with a fixed code and a message, such as {"error": {"code": "key_wrong_api", "message": "This key belongs to another API."}}. The full list is in the documentation.
Why use an API instead of copying data from a site
Copying data from a page with a program — scraping — works until the page changes. An API is a contract: the format stays stable, the data arrives complete and the provider handles collection. We compare both paths in scraping or an API.
Next step
If you want to practise with data that changes every half minute, the Bac Bo Live API is a good laboratory: the trial is free, the response is small and the result changes all the time, so you see your integration working straight away.
Frequently asked questions
- What is an API, simply put?
It is an agreed way for one program to ask another for data or actions. You send a request to an address and get the answer back ready to use, usually as JSON, without opening any page.
- Do I need to know how to code to use an API?
Not to try one: you can call an API from the browser, the terminal or tools like Postman. To integrate it into a bot or a site, a little programming helps, but the examples are usually only a few lines long.
- What is an API key?
It is a password identifying who is making the request and what they are allowed to access. It travels in a request header and should be kept like any other password.
Read also
- Real-time results: the SSE stream, event by event
How to receive every round the moment it is stored: the /stream events, reconnecting with Last-Event-ID, and why SSE instead of a webhook or WebSocket.
- Where to host a bot 24/7: bot hosts, a VPS or serverless
What a bot that runs non-stop actually needs, what each hosting option costs, and why serverless does not go with an open connection.
- API errors and limits: 429, backoff and what to do
A practical guide to a data API's errors: what each HTTP status means, how to handle 429 with Retry-After and backoff, and the code that keeps your bot alive.