curl --fail-with-body --silent --show-error \
-H "Authorization: Bearer $MEREU_API_KEY" \
-H 'Accept: application/json' \
"https://mereu.md/api/v1/programs"
// Node.js 24+. Run on your server; set the named environment variables.
const env = (name) => {
const value = process.env[name];
if (!value) throw new Error("Missing environment variable: " + name);
return value;
};
const url = new URL("https://mereu.md/api/v1/programs");
const response = await fetch(url, {
method: "GET",
redirect: "error",
signal: AbortSignal.timeout(15000),
headers: {
"Authorization": "Bearer " + env("MEREU_API_KEY"),
"Accept": "application/json"
}
});
const result = await response.json();
if (!response.ok) {
throw Object.assign(new Error(result.error?.code || "API_ERROR"), {
status: response.status,
requestId: result.error?.request_id || response.headers.get("X-Request-Id"),
retryAfter: response.headers.get("Retry-After")
});
}
console.log(JSON.stringify(result, null, 2));
# Python 3, standard library only. Run on your server.
import json
import os
from urllib.parse import quote, urlencode
from urllib.request import Request, build_opener, HTTPRedirectHandler
from urllib.error import HTTPError
def env(name):
value = os.environ.get(name)
if not value:
raise ValueError("Missing environment variable: " + name)
return value
class NoRedirect(HTTPRedirectHandler):
def redirect_request(self, req, fp, code, msg, headers, newurl):
return None
url = "https://mereu.md/api/v1/programs"
headers = {
"Authorization": "Bearer " + env("MEREU_API_KEY"),
"Accept": "application/json"
}
request = Request(url, method="GET", headers=headers)
try:
with build_opener(NoRedirect()).open(request, timeout=15) as response:
result = json.load(response)
except HTTPError as error:
try:
code = json.load(error).get("error", {}).get("code", "API_ERROR")
except (ValueError, AttributeError):
code = "INVALID_RESPONSE"
raise SystemExit("HTTP " + str(error.code) + ": " + code
+ "; request_id=" + str(error.headers.get("X-Request-Id"))
+ "; retry_after=" + str(error.headers.get("Retry-After"))) from None
print(json.dumps(result, indent=2))
The JavaScript (Node.js 24+) and Python 3 examples are self-contained. Run them on your server and set the environment variables shown in the code.
JSON response · example JSON
{
"data": [
{
"id": "9788420f-8230-4e89-a189-6e557783346e",
"kind": "points",
"name": "Cafenea Exemplu",
"rules": {
"summary": "Reducere valabilă în locația Centru.",
"visit_target": null,
"points_precision": 2,
"points_expiry_months": null
},
"currency": "USD",
"updated_at": "2026-11-05T00:13:44.127483+02:00",
"version_id": "abbe38bc-901e-48e1-8b17-03b5e1763d85"
}
],
"next_cursor": null,
"sync_token": "eyJ2IjoxLCJiaW5kaW5nIjoiZDJmZTQzZTI4OTljZDFmNDA5NzMyNzM1ZTc2Y2IwZWExMzQ0MDI4MTQ2YWQ4OWZhYmFjNDE3NjNhMGQxNGE5MyIsInJlc291cmNlIjoicHJvZ3JhbXMiLCJhdCI6IjIwMjYtMTEtMDRUMjI6MTM6NDQuMzA3WiIsImFmdGVyIjpudWxsLCJraW5kIjoic3luYyJ9.Q88VoT8fXevbwrh3SR1kcqj7EZljd9l77Asmk_ZEqiM"
}
Illustrative data from isolated checks. These identifiers do not belong to your account.