تخطَّ إلى المحتوى
توثيق المطورين

الدليل السريع

من الصفر إلى بحث ناجح عن مكان، بمفتاح لا يغادر خادمك.

الدليل السريع

من الصفر إلى بحث ناجح عن مكان، بمفتاح لا يغادر خادمك.

1. Create an API key

Sign in to the console and open API keys. A key is organization-scoped and carries a set of scopes. The plaintext value is shown once, at creation: store it immediately. Test keys are prefixed bdy_test_, live keys bdy_live_.

2. Confirm connectivity

Health endpoints are public and unauthenticated. Use them to prove DNS, TLS and egress before you debug a credential.

shell
curl -sS "https://api.bardiyamap.com/v1/health/live"
# {"status":"alive"}

3. Make your first billable request

curl -sS "https://api.bardiyamap.com/v1/places/search?q=coffee&latitude=30.0444&longitude=31.2357&limit=3" \
  -H "X-API-Key: $BARDIYA_API_KEY"

Latitude and longitude are separate named parameters in a query string. Inside a JSON body or a GeoJSON geometry, a coordinate pair is written [longitude, latitude]. This is the single most common integration mistake; see Conventions.

4. Handle the first failure correctly

A 401 means the key is missing, malformed or revoked. A 403 means the key is valid but lacks the scope, or the request origin is not allowed. A 422 means a field failed validation. A 429 means a rate or quota guard fired and you must honour Retry-After. Never retry a 4xx blindly: a retried 401 cannot succeed.

json
{
  "error": {
    "code": "invalid_request",
    "message": "latitude must be between -90 and 90",
    "details": {},
    "request_id": "req_01HX9Z6Q3M"
  }
}
The error envelope is identical on every operation

Every response carries X-Bardiya-Request-Id. Quote it when you contact support: it is the only reliable way to find one request in the logs.

5. Add an SDK (optional)

npm install @bardiyamap/sdk@0.1.0

Every package is published and installable today. Pick one from the SDK catalogue for the full guide, including initialization, error handling and the operations that package actually supports.