Basics
- Address:
https://api.dondoo.com. Every path starts with/v1/; calls useGET(orHEAD) and HTTPS only. - Key: send it in the
X-API-Keyheader (see Authentication). Only the free sample and/v1/healthwork without one. - Formats: JSON by default, XML with
format=xml, a ready-to-send PDF withformat=pdf. - Changes: if we ever need to change something that could affect your integration, we tell you well in advance, and your current version keeps working until you have moved over. New fields may appear in the answers, so read the fields you need and ignore the others.
The whole API in one file
openapi.yaml describes every address, option and answer in OpenAPI, the standard format for describing an API. Import it into Postman, Insomnia or a code generator, and you can try every address or create a client for your language in a few clicks. It is the same description this page is made from.
Download openapi.yamlGET /v1/donts
Don'ts for one destination
Send the destination with the parameter for its code type, so it is always clear which code you mean: iata=DXB, icao=OMDB, iso2=AE, iso3=ARE or isonum=784. Codes are not case-sensitive and stray spaces are ignored.
Send one destination per call. If you send more than one, the first in this order is used and the others are named in warnings: iata → icao → iso2 → iso3 → isonum.
Needs your key in the X-API-Key header.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
iata |
query | string | IATA airport code (3 letters). Whole-city codes such as Example: |
icao |
query | string | ICAO airport code (4 letters). Example: |
iso2 |
query | string | ISO 3166-1 alpha-2 country code. Example: |
iso3 |
query | string | ISO 3166-1 alpha-3 country code. Example: |
isonum |
query | string | ISO 3166-1 numeric country code. Leading zeros are optional ( Example: |
limit |
query | integer · default 100 |
How many don'ts per page, best first (1 to 100, default 100). Example: |
page |
query | integer · default 1 |
Which page, starting at 1. Ranks continue across pages (page 2 with |
pictures |
query | string · one of yes, no · default yes |
Include picture links ( |
format |
query | string · one of json, xml, pdf · default json |
Answer format. All formats come from the same ranked answer. A PDF counts as several calls. |
compact |
query | string · one of yes, no · default no |
|
country_info |
query | string · one of yes, no · default yes |
PDF only. |
lang |
query | string | The language of the answer, as a standard language code: |
ref1 |
query | string · up to 100 characters | Your own reference, for example a booking number (up to 100 characters), echoed back and logged if your plan stores it. Never put personal data here (names, emails, passport numbers). |
ref2 |
query | string · up to 100 characters | Second reference field. See |
ref3 |
query | string · up to 100 characters | Third reference field. See |
from_iata from_icao from_iso2 from_iso3 from_isonum |
query | string | Origin (optional): where the traveller comes from, with the same code types as the destination. Accepted on every call and echoed in Example: |
The answer
For iata=DXB&limit=2. The XML has the same content; with format=pdf the answer is the PDF itself (application/pdf).
{
"place": {
"name": "[DXB] Dubai - Airport, United Arab Emirates",
"type": "airport",
"country": "United Arab Emirates (UAE)"
},
"language": "en",
"input": {
"parameter": "iata",
"value": "DXB"
},
"method": {
"name": "AlphaAPI",
"version": "1.0"
},
"data_version": "1009",
"total_count": 23,
"page": 1,
"limit": 2,
"total_pages": 12,
"warnings": [],
"donts": [
{
"rank": 1,
"kind": "dont",
"text": "Don't refuse a gift, and be careful when praising your host's watch or other things - a generous host may insist on giving it to you.",
"locality": "United Arab Emirates (UAE)",
"illustrations": {
"no": "https://api.dondoo.com/pictures/3f9a0c5e1b2d4f6a8c7e9b0d1f2a3c4e.png",
"yes": "https://api.dondoo.com/pictures/c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8.png"
}
},
{
"rank": 2,
"kind": "dont",
"text": "Don't be surprised when men greet each other with a light handshake, cheek kisses or a touch of noses - a right hand on your heart after shaking hands shows great respect.",
"locality": "United Arab Emirates (UAE)",
"illustrations": {
"yes": "https://api.dondoo.com/pictures/8b1e2d3c4f5a6b7c8d9e0f1a2b3c4d5e.png"
}
}
]
}<?xml version="1.0" encoding="UTF-8"?>
<donts_response>
<place>
<name>[DXB] Dubai - Airport, United Arab Emirates</name>
<type>airport</type>
<country>United Arab Emirates (UAE)</country>
</place>
<input>
<parameter>iata</parameter>
<value>DXB</value>
</input>
<method>
<name>AlphaAPI</name>
<version>1.0</version>
</method>
<data_version>1009</data_version>
<total_count>23</total_count>
<page>1</page>
<limit>2</limit>
<total_pages>12</total_pages>
<warnings>
</warnings>
<donts>
<dont rank="1">
<kind>dont</kind>
<text>Don't refuse a gift, and be careful when praising your host's watch or other things - a generous host may insist on giving it to you.</text>
<locality>United Arab Emirates (UAE)</locality>
<illustration kind="no">https://api.dondoo.com/pictures/3f9a0c5e1b2d4f6a8c7e9b0d1f2a3c4e.png</illustration>
<illustration kind="yes">https://api.dondoo.com/pictures/c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8.png</illustration>
</dont>
<dont rank="2">
…
</dont>
</donts>
</donts_response>Optional fields: input, method and data_version are included by default; origin and references only when the call sent them. Each can be switched off globally or per customer by settings, and compact=yes leaves them all out for one call.
| Field | Type | Meaning |
|---|---|---|
place | object | The destination you asked for, with its name and type (airport or country). |
language | string | The language of the answer (see |
input | object | Which code was used (optional). |
origin | object or null | Origin echo (optional). |
method | object | Ranking method and version (optional). |
data_version | string | The data version: a release number that goes up with every data update, for example 1009 (optional). |
references | object | Your reference fields, echoed back (optional). |
total_count | integer | All don'ts for this request, across all pages. The notice entry is not counted. |
page | integer | This page (see |
limit | integer | Don'ts per page (see |
total_pages | integer | How many pages there are with this limit. |
warnings | array | Notes about the call; the call still worked. Each has a |
donts | array | The don'ts, best first. |
donts[].rank | integer | Position, starting at 1. Not present on a notice entry. |
donts[].kind | string |
|
donts[].text | string | The don't itself, in the answer's language when translated. |
donts[].language | string | Only on a don't that is not translated yet into the answer's language. It is always |
donts[].locality | string | The place the don't applies to, for example "Japan", named in the answer's language where that name differs. |
donts[].illustrations | object | Picture links, labelled by the field they are stored in. A don't may have only one. Left out with |
Responses
| Status | Meaning |
|---|---|
200 | The don'ts for the destination, best first. |
400 | The call is not complete or not valid ( |
401 | No key, or the key is not valid ( |
402 | A new month of the plan started unpaid, so every key of the account is paused ( |
403 | The key is switched off, or the plan does not include this ( |
404 | The code is not known ( |
429 | Two different cases: |
500 | Something went wrong on our side ( |
503 | The API is temporarily unavailable ( |
GET /v1/airports/{code}
Shortcut for an airport
A shortcut with the code in the address: /v1/airports/DXB is the same as /v1/donts?iata=DXB. Three characters are read as IATA (DXB), four as ICAO (OMDB), so the two can never be mixed up.
Needs your key in the X-API-Key header.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
code required |
path | string | Example: |
Options: the same as GET /v1/donts.
Responses
| Status | Meaning |
|---|---|
200 | The don'ts for the destination, best first. |
400 | The call is not complete or not valid ( |
401 | No key, or the key is not valid ( |
402 | A new month of the plan started unpaid, so every key of the account is paused ( |
403 | The key is switched off, or the plan does not include this ( |
404 | The code is not known ( |
429 | Two different cases: |
500 | Something went wrong on our side ( |
503 | The API is temporarily unavailable ( |
GET /v1/countries/{code}
Shortcut for a country
A shortcut with the code in the address: /v1/countries/AE is the same as /v1/donts?iso2=AE. Two letters are read as ISO alpha-2 (AE), three letters as alpha-3 (ARE) and digits as numeric (784), so the three can never be mixed up.
Needs your key in the X-API-Key header.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
code required |
path | string | Example: |
Options: the same as GET /v1/donts.
Responses
| Status | Meaning |
|---|---|
200 | The don'ts for the destination, best first. |
400 | The call is not complete or not valid ( |
401 | No key, or the key is not valid ( |
402 | A new month of the plan started unpaid, so every key of the account is paused ( |
403 | The key is switched off, or the plan does not include this ( |
404 | The code is not known ( |
429 | Two different cases: |
500 | Something went wrong on our side ( |
503 | The API is temporarily unavailable ( |
GET /v1/sample/donts
Free sample, no key needed
Same options and answer as /v1/donts, but only for the sample places shown on the Try it page and with a small daily limit per visitor address. Includes the PDF. Any other place returns 403 sample_place_only.
No key needed.
Options: the same as GET /v1/donts.
Responses
| Status | Meaning |
|---|---|
200 | The don'ts for the destination, best first. |
400 | The call is not complete or not valid ( |
403 | The place is not one of the free sample places ( |
404 | The code is not known ( |
429 | The free sample's daily limit for your address is reached ( |
500 | Something went wrong on our side ( |
503 | The API is temporarily unavailable ( |
GET /v1/health
Is the API running?
No key needed.
Responses
| Status | Meaning |
|---|---|
200 | The API is running. |
Authentication
Your secret key, sent in the X-API-Key header on every call. Keys are for servers only; never put a normal key into a web page or app that users can download. Keys in the address (query string) are not accepted, because addresses end up in logs.
X-API-Key: dk_live_…Errors
Every error has the same shape, so your program can always read error.code. When a call fails, carry on without the don'ts (for example, send the confirmation email without the PDF) and try again later.
{ "error": { "code": "not_found", "message": "Code XYZ was not found.", "hint": "Check the code; try an airport code such as LHR, or a country code.", "contact": "api@dondoo.com" } }
With format=xml, errors come as XML too: <error_response><error><code>…, with the same fields.
All codes: missing_destination invalid_code invalid_parameter page_out_of_range missing_key invalid_key key_disabled payment_due format_not_in_plan sample_place_only place_not_included paused_for_check not_found unknown_address too_fast limit_reached internal_error unavailable pdf_unavailable
Which status goes with which code is listed under "Responses" for each address above. A failure on our side (status 5xx) never counts against your allowance.
Status
Is it us or you? Open the Status page: it asks the API live and shows any notice from us, for example planned maintenance.
For your own monitoring, call GET /v1/health. It needs no key and is not counted. It answers {"status": "ok"} with the data version and, when there is one, our notice.
Code examples
The same call in curl, JavaScript, Python, PHP, Java and C#. Replace the key with yours and keep it on your server.
curl --max-time 5 "https://api.dondoo.com/v1/donts?iata=DXB&limit=5" \
-H "X-API-Key: $DONDOO_KEY"
# The PDF, ready to attach to an email:
curl --max-time 15 "https://api.dondoo.com/v1/donts?iata=DXB&format=pdf" \
-H "X-API-Key: $DONDOO_KEY" -o DXB-travel-donts.pdf// Node.js 18+ (on your server; never put your key in a web page)
const res = await fetch("https://api.dondoo.com/v1/donts?iata=DXB&limit=5", {
headers: { "X-API-Key": process.env.DONDOO_KEY },
signal: AbortSignal.timeout(5000),
});
if (res.ok) {
const data = await res.json();
for (const d of data.donts) console.log(d.rank, d.text);
} else {
const { error } = await res.json();
console.warn("Dondoo:", error.code, error.message); // carry on without the don'ts
}import os, requests
res = requests.get(
"https://api.dondoo.com/v1/donts",
params={"iata": "DXB", "limit": 5},
headers={"X-API-Key": os.environ["DONDOO_KEY"]},
timeout=5,
)
if res.ok:
for d in res.json()["donts"]:
print(d["rank"], d["text"])
else:
err = res.json()["error"]
print("Dondoo:", err["code"], err["message"]) # carry on without the don'ts<?php
$ch = curl_init("https://api.dondoo.com/v1/donts?iata=DXB&limit=5");
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => ["X-API-Key: " . getenv("DONDOO_KEY")],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 5,
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
if ($status === 200) {
foreach ($data["donts"] as $d) echo $d["rank"], " ", $d["text"], PHP_EOL;
} else {
error_log("Dondoo: " . $data["error"]["code"]); // carry on without the don'ts
}import java.net.URI;
import java.net.http.*;
import java.time.Duration;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.dondoo.com/v1/donts?iata=DXB&limit=5"))
.header("X-API-Key", System.getenv("DONDOO_KEY"))
.timeout(Duration.ofSeconds(5))
.build();
HttpResponse<String> res = client.send(request, HttpResponse.BodyHandlers.ofString());
if (res.statusCode() == 200) {
System.out.println(res.body()); // read "donts" with your JSON library
} else {
System.err.println("Dondoo: " + res.body()); // carry on without the don'ts
}using System.Net.Http.Json;
using var http = new HttpClient { Timeout = TimeSpan.FromSeconds(5) };
http.DefaultRequestHeaders.Add("X-API-Key", Environment.GetEnvironmentVariable("DONDOO_KEY"));
var res = await http.GetAsync("https://api.dondoo.com/v1/donts?iata=DXB&limit=5");
if (res.IsSuccessStatusCode)
{
var data = await res.Content.ReadFromJsonAsync<System.Text.Json.JsonElement>();
foreach (var d in data.GetProperty("donts").EnumerateArray())
Console.WriteLine($"{d.GetProperty("rank")} {d.GetProperty("text")}");
}
else
{
Console.Error.WriteLine("Dondoo: " + await res.Content.ReadAsStringAsync()); // carry on without the don'ts
}Send it with your booking confirmation
When you send a booking confirmation, fetch the PDF for the destination and attach it. If the PDF is not ready in time (about 5 seconds), send the email without it; nothing else depends on it.
# Fetch the PDF for a booking confirmation; give up after 5 seconds.
if curl --fail --silent --max-time 5 "https://api.dondoo.com/v1/donts?iata=DXB&format=pdf" \
-H "X-API-Key: $DONDOO_KEY" -o "Your travel tips for Dubai.pdf"; then
echo "Attach the PDF to the email"
else
echo "Send the email without the PDF"
fi// When you send a booking confirmation: fetch the PDF and attach it if it comes in time.
async function travelTipsPdf(iata) {
try {
const res = await fetch(`https://api.dondoo.com/v1/donts?iata=${encodeURIComponent(iata)}&format=pdf`, {
headers: { 'X-API-Key': process.env.DONDOO_KEY },
signal: AbortSignal.timeout(5000),
});
return res.ok ? Buffer.from(await res.arrayBuffer()) : null;
} catch {
return null; // too slow or offline: send the email without the PDF
}
}
const pdf = await travelTipsPdf('DXB');
// attachments: pdf ? [{ filename: 'Your travel tips for Dubai.pdf', content: pdf }] : []import os
import requests
def travel_tips_pdf(iata):
"""The PDF for a booking confirmation, or None if it is not ready in time."""
try:
r = requests.get("https://api.dondoo.com/v1/donts",
params={"iata": iata, "format": "pdf"},
headers={"X-API-Key": os.environ["DONDOO_KEY"]},
timeout=5)
return r.content if r.ok else None
except requests.RequestException:
return None # send the email without the PDF
pdf = travel_tips_pdf("DXB")<?php
// The PDF for a booking confirmation, or null if it is not ready in time.
function travelTipsPdf(string $iata): ?string {
$ch = curl_init('https://api.dondoo.com/v1/donts?' . http_build_query(['iata' => $iata, 'format' => 'pdf']));
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => ['X-API-Key: ' . getenv('DONDOO_KEY')],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 5,
]);
$pdf = curl_exec($ch);
$ok = $pdf !== false && curl_getinfo($ch, CURLINFO_HTTP_CODE) === 200;
curl_close($ch);
return $ok ? $pdf : null; // null: send the email without the PDF
}
$pdf = travelTipsPdf('DXB');
// if ($pdf !== null) { $mail->addStringAttachment($pdf, 'Your travel tips for Dubai.pdf'); }import java.net.URI;
import java.net.URLEncoder;
import java.net.http.*;
import java.nio.charset.StandardCharsets;
import java.time.Duration;
// The PDF for a booking confirmation, or null if it is not ready in time.
static byte[] travelTipsPdf(String iata) {
try {
String url = "https://api.dondoo.com/v1/donts?format=pdf&iata=" + URLEncoder.encode(iata, StandardCharsets.UTF_8);
HttpRequest req = HttpRequest.newBuilder(URI.create(url))
.header("X-API-Key", System.getenv("DONDOO_KEY"))
.timeout(Duration.ofSeconds(5))
.build();
HttpResponse<byte[]> res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofByteArray());
return res.statusCode() == 200 ? res.body() : null;
} catch (Exception e) {
return null; // too slow or offline: send the email without the PDF
}
}// The PDF for a booking confirmation, or null if it is not ready in time.
static readonly HttpClient Http = new() { Timeout = TimeSpan.FromSeconds(5) };
static async Task<byte[]?> TravelTipsPdf(string iata)
{
try
{
using var req = new HttpRequestMessage(HttpMethod.Get,
$"https://api.dondoo.com/v1/donts?format=pdf&iata={Uri.EscapeDataString(iata)}");
req.Headers.Add("X-API-Key", Environment.GetEnvironmentVariable("DONDOO_KEY"));
using var res = await Http.SendAsync(req);
return res.IsSuccessStatusCode ? await res.Content.ReadAsByteArrayAsync() : null;
}
catch (Exception)
{
return null; // too slow or offline: send the email without the PDF
}
}Good to know
- Send the key in the
X-API-Keyheader, never in the address. - Use a short timeout (about 5 seconds for JSON and XML, up to 15 for a PDF, as in the examples) and carry on if the call fails.
- A
429answer is eithertoo_fast(wait the seconds inRetry-After) orlimit_reached(your allowance is used up). - Every successful answer has an
X-Data-Versionheader: it tells you which data version it came from.
Frequently asked questions
Which codes can I send?
Airport codes (IATA like DXB, ICAO like OMDB) and country codes (ISO, like AE, ARE or 784), each with its own parameter, for example iata=DXB, so it is always clear which code you send. See the parameters of GET /v1/donts.
Does every don't have its own illustration?
Yes. Every don't has its own illustration, carefully designed for exactly that situation and checked by hand by our team.
Can I trust the content?
Yes. Every don't is verified: our team checks it against reliable local sources before it goes live, written to inform, never to judge or offend. Each has its own illustration in the style Dondoo developed by hand over years, checked by hand too. Dondoo is fully independent and neutral, not sponsored by any government or organisation. No ads and no sponsored tips: only what matters for the destination.
How fresh is the content?
Our team looks after the don'ts all the time: we add new ones, update existing ones and retire what no longer applies, and we draw new illustrations for them. Every answer tells you which data version it comes from.
Can I approve content changes before my travellers see them?
Updates reach every customer at the same time, and every answer tells you its data version. If you need more control, a Tailor-made plan can include a sign-off: we show you each update first and switch it on for you only after your OK. We can also agree your own illustrations or wording. Request an offer.
Can I keep a copy of the content?
Show the answers to your travellers when they need them, and ask again next time: the content changes often, so a fresh answer is always the best one. Copying the collection, in whole or in part, is not allowed (see Terms & Privacy).
A traveller is flying home. Do they still need the don'ts?
Usually not, as the don'ts are written for visitors. The API answers for the destination you ask for and does not know who is travelling. Airlines and sellers of return trips can add an optional check on their side: if the traveller lives in or is a citizen of the destination country, or the flight is the return leg of a round trip, you may skip the don'ts for that booking. It's your choice; the API only needs the destination code.
Can I use it in a web page or app?
Yes, through your own server. Keep your key on the server, never in the page or the app.
How long does a PDF take?
Usually under a second; the first one after a quiet time may take a few seconds.
Can I leave the country facts out of the PDF?
Yes. By default the PDF starts with a short "Good to know" box: capital, currency, languages, calling code, driving side and plugs. If your own page or email already shows these, add country_info=no and the PDF goes straight to the don'ts. See the parameters of GET /v1/donts.
Can it handle a lot of traffic?
Yes. The API is built for speed and runs on Amazon Web Services (AWS), which adds capacity automatically as your traffic grows, so a busy day or a big campaign is no problem. Each plan has a calls-per-second limit (see Pricing). Expecting very high volumes? Tell us, and we set up a Tailor-made plan with the limits you need.
Where does the API run?
On Amazon Web Services (AWS) in Europe (primarily Frankfurt, Germany), behind Amazon CloudFront with a firewall against abuse. It grows with your traffic by itself, and on request we also serve it from other AWS regions, closer to you and your travellers.
How do you handle data?
A call needs only a destination, an airport or a country code, so no personal data of your travellers reaches us; for a language, we receive only its code. Your own references, such as a booking number, must not contain personal data, and we erase them after 90 days. We keep call records for 13 months, for your usage and invoices. Your keys are shown to you once: we store only a secured fingerprint, never the key itself. Sign-in runs on Amazon Cognito and payments on Stripe, one of the world's leading payment platforms, so we never see your password or card details.
What counts as a call?
Only successful answers. Calls that are refused (no key or a wrong key, too fast, allowance used up), calls with a mistake in them (an unknown code or option) and anything that fails on our side are not counted. A PDF counts as 5 calls. Your usage is on My account.
What happens when I reach my allowance?
You get an email at 80% and 100%. Explorer pauses until the 1st of next month. Globetrotter keeps answering up to 150%, so your service never stops by surprise; extra calls above 100% cost USD 10 per 1,000 and are only billed after we have reviewed them with you. See Pricing.
Can the PDF carry my branding?
Yes. On Globetrotter, upload your logo in My account under Your branding. It appears at the top of the first page and on every page after it, next to "In partnership with dondoo.com", on a clean background chosen to suit it. There you can also use your own words in the PDF's file name, for example DXB-Before-you-fly.pdf. On Tailor-made there is no limit: we shape the PDF exactly to your needs, for example the title on page 1 ("Before you land in …" for airlines), a second logo for a sponsor, or your own wording. Tell us what you need.
Which languages?
All languages. Answers are in English unless you ask for another language with lang, for example lang=de, or your account has another default language. If you ask for a language that isn't set up for your account, you get the answer in your default language (English unless you've chosen another), with no error. See the parameters of GET /v1/donts. On a Tailor-made plan, we deliver the don'ts in your travellers' language: just tell us which languages you need.
Can I try it without signing up?
Yes: Try it answers for a few sample places, no key needed.
Something isn't working. What can I do?
We're here to help. Often the answer itself already says what went wrong and how to fix it, for example an unknown code or calls sent a little too quickly. The Status page shows whether the API is running normally. If it still doesn't work, just write to us at api@dondoo.com with the time, the address you called, the error code and the first characters of your key (never the whole key), and we'll sort it out together.
How do I manage my keys, plan and invoices?
All in one place: My account. Under Your keys, you can make a new key, or switch one off or replace it, for example if it was lost or someone else has it. Under Plan and billing, you can change or cancel your plan and download your invoices. If your plan is billed by invoice, just write to us and we'll take care of it.
How can I reach you?
Write to api@dondoo.com with any question, idea or partnership. For a plan built around your business, request an offer.