AeroModel
Documentation
Safe characters in URLs
The API expects URL-encoded query params. The following characters need explicit encoding:
| Character | Encoded | Use case |
|---|---|---|
# | %23 | hex color (background=%23001a33) |
(space) | %20 or + | airline / aircraft name in plain text |
& | %26 | name search containing & |
? | %3F | should never appear in a value |
= | %3D | should never appear in a value |
/ | %2F | allowed but encode for safety |
: | %3A | tolerated in backgroundGradient |
, | %2C | tolerated in backgroundGradient |
+ | %2B | when not used to encode a space |
| Accented characters | %xx%xx (UTF-8) | airline name (e.g. aérienne) |
Examples
Background color
# WRONG — # is not transmitted to the API
?background=#001a33
# RIGHT
?background=%23001a33
Airline by name
# WRONG
?airline=Air France
# RIGHT
?airline=Air%20France
# or better: use the slug
?airline=air-france
Gradient
# WRONG — bare #
?backgroundGradient=linear:90:#ff7e5f-0,#feb47b-1
# RIGHT
?backgroundGradient=linear:90:%23ff7e5f-0,%23feb47b-1
Helpers per language
| Language | Function |
|---|---|
| JavaScript / TypeScript | encodeURIComponent(value) or URLSearchParams |
| Python | urllib.parse.quote(value, safe="") or urlencode(params) |
| C# | Uri.EscapeDataString(value) or HttpUtility.UrlEncode(value) |
| PowerShell | [System.Uri]::EscapeDataString($value) |
| curl | --data-urlencode with -G, or encode manually |
Golden rule
Always use slugs (air-france, airbus-a320-200) rather than plain-text names. Slugs need no encoding and are stable over time.
If you really need to pass a name, go through a URLSearchParams (or equivalent) object — it does the encoding for you.
See also
/v1/resolveendpoint — to translate a plain-text name into a slug before generating the image.