APIs · SDKs
Configuring API clients and SDKs
Keep base URLs out of code, point them at the real service, and add a check that stops example addresses from reaching production.
Guide · Documentation
Documentation, tutorials and tests need addresses, numbers and names that look real but never reach anyone. For most kinds of value a reserved range exists. This guide lists them, with the source for each, so examples stay harmless when someone copies them.
Examples get copied: into code, configuration files, tests and other documentation. A value that looks invented but belongs to someone sends that traffic, those e-mails or those calls to a real party. example-petstore.com is a case in point: an invented name in Google’s documentation that anyone could register, and that still receives requests. Reserved values are guaranteed never to be assigned, so a copied example fails harmlessly.
For websites, APIs and e-mail addresses in examples, use example.com, example.net or example.org and their subdomains, such as api.example.com and user@example.com. For test environments, names that must never resolve and local networks there are .test, .invalid, .localhost, home.arpa and .internal.
What each reserved name is for, and why look-alikes such as example-petstore.com are not safe: Example domains
| Type | Reserved for documentation | Source |
|---|---|---|
| IPv4 | 192.0.2.0/24 (TEST-NET-1), 198.51.100.0/24 (TEST-NET-2), 203.0.113.0/24 (TEST-NET-3) | RFC 5737 |
| IPv6 | 2001:db8::/32 | RFC 3849 |
| IPv6, larger networks | 3fff::/20 | RFC 9637 (2024) |
# A client, a server and a proxy in an example
client 192.0.2.10 2001:db8::10
server 198.51.100.20 2001:db8:1::20
proxy 203.0.113.30 2001:db8:2::30
The three IPv4 blocks give an example three separate “networks”, which helps when explaining routing or firewalls.
3fff::/20 exists because 2001:db8::/32 is too small to show realistic allocations for large
providers.
For BGP examples: 64496–64511 (16-bit) and 65536–65551 (32-bit),
reserved for documentation by RFC 5398. Private-use AS numbers are meant for real networks, not for examples.
00-00-5E-00-53-00 to 00-00-5E-00-53-FF (written as 00:00:5e:00:53:00 in most
tools) are reserved for documentation by RFC 9542 (which replaced RFC 7042).
There is no worldwide range; several countries reserve their own for fiction and examples:
555-0100 to 555-0199, with any area code, such as
+1 202 555 0143.07700 900000 to 07700 900999, London
020 7946 0000 to 020 7946 0999, and 01632 960000 to 01632 960999
without a specific area.For other countries, check the telecom regulator. Where no range exists, use a placeholder that cannot be dialled,
such as +31 6 XXXX XXXX, rather than digits that merely look random.
Payment providers publish test card numbers that only work in their test mode, such as Stripe’s
4242 4242 4242 4242 with any future expiry date and any CVC. Use the numbers of the provider you are
integrating with; test numbers from one provider are not accepted by another. Never use a real card number, not even
your own, in documentation, fixtures or screenshots.
10.0.0.0/8 or 192.168.0.0/16 in public
documentation: they exist in the reader’s own network, so a copied example may reach a real device there.YOUR_API_KEY or
sk_test_…, never a key that was ever valid.