Fake Addresses

How Do You Generate a Random Address Programmatically?

A random address is generated programmatically by calling a keyless HTTP API or an npm/PyPI package instead of scraping a web form. Fake Addresses exposes `/api/v1/`, free and rate-limited at 60 requests per minute, returning postal-format-valid, non-deliverable JSON, CSV, NDJSON or SQL records with no account and no API key required.

Why Developers Reach for a Mock Data API Instead of a Web Form

Developers reach for the Fake Addresses API instead of a web form the moment a test suite needs more than a handful of addresses, because a web form was built for one person clicking one button, not a build pipeline generating hundreds of records unattended. Scripting a browser to fill in a form, submit it, and scrape the result back out is slow, brittle against every front-end redesign, and usually against the target site's terms of service.

The market's largest address generator has never published a public API, which is why several independent GitHub repositories exist purely to automate a browser against its web form and scrape the output — and a RapidAPI listing exists cataloguing free alternatives for developers who assumed an API should exist and went looking for one. The demand for a real API in this category is well documented; it has simply gone unmet.

Fake Addresses ships /api/v1/ specifically to close that gap. The endpoint is free, keyless and CORS-enabled, with a published rate limit, so a developer can call it directly from a test runner, a CI job, or a Postman collection without writing a scraper at all — no browser automation, no scraping library, and no maintenance burden when the target site's markup changes.

Calling the Fake Addresses API Directly

Calling the Fake Addresses API directly means one HTTP GET request against /api/v1/, with no signup and no API key in the request. Anonymous callers are rate-limited to 60 requests per minute, published openly rather than discovered by trial and error, so a script can back off correctly instead of guessing at a hidden ceiling.

Two query parameters control reproducibility: seed pins the request to a specific, repeatable output, and dataset pins it to a specific data version — every response also carries the dataset version it was generated against, so a caller can tell which version produced a given record without guessing. Omitting both parameters returns a fresh, randomly seeded record each call, which is the right default for exploratory use and the wrong default for a CI fixture.

Every US address field in the response is formatted per USPS Publication 28, so the JSON needs no extra normalization before a test asserts against it. International records returned by the same endpoint follow UPU S42 formatting templates where one exists for that country, the equivalent international standard published by the Universal Postal Union for cross-border mail. Every field in the response — street, city, county, state, ZIP, phone — traces back to that same generated point, already checked against USPS Publication 28 before it is returned, so a caller never has to reconcile disagreeing values pulled from separate endpoints.

Using the npm and PyPI Packages

Using the Fake Addresses npm and PyPI packages skips the HTTP layer entirely for a Node.js or Python project that would rather import a function than manage a fetch call. Both packages wrap the same /api/v1/ contract and the same seed-and-dataset-version determinism, so a record generated through the npm package and a record generated through a raw HTTP call with the same seed and dataset are identical.

Output from both packages is licensed free to use, with no attribution requirement, which matters specifically for anyone committing generated fixtures into a public repository — a common pattern for open-source test suites that check example data in alongside the tests themselves. Several competing generators require attribution in their terms of service, a real obstacle for exactly that workflow.

A published npm and PyPI package also does something a web tool cannot: it shows up in other people's package manifests, README examples, and Stack Overflow answers without Fake Addresses writing any of that content. That is the specific reason the packages exist as a priority ahead of, not alongside, marketing copy — a tool referenced inside someone else's workflow compounds in a way a linked-to web page does not, and every record either package returns is checked against the same USPS Publication 28 conformance before it leaves either one.

The OpenAPI Spec, CLI and MCP Server

The OpenAPI 3.1 specification, the command-line interface, and the MCP server are the three developer surfaces beyond the API and the packages, each solving a different integration problem. The OpenAPI spec is the machine-readable contract itself — the same file that generates the Postman collection, validates client-library output against the real API shape, and lets a developer generate a typed client in a language Fake Addresses does not publish a package for.

The CLI wraps the same endpoint for anyone who wants a test address without leaving a terminal or writing any code at all. A single command against a seed returns a record in whichever export format is requested, useful for a quick manual check during debugging without opening a browser.

The MCP server is the newest of the three and solves a different kind of integration: a coding agent that needs test data does not search the web for a tool, it calls one directly. Being invoked inside an agent's workflow, rather than found through a search result, is a form of distribution nothing else in this category is currently built for, and Fake Addresses ships the MCP server specifically because that shift is already underway, not as a speculative bet on where developer tooling might go next.

Frequently asked questions

Is the Fake Addresses API free?

Yes, with no signup and no API key required for anonymous use, and no credit card ever requested. Requests are rate-limited to 60 per minute, and that limit is published openly rather than left for a script to discover through failed requests and guesswork.

Does the Fake Addresses API require an API key?

No. The core /api/v1/ endpoint works with a plain HTTP GET request, no key and no signup, up to the published 60-requests-per-minute anonymous limit. That limit is enforced and documented, not a soft suggestion a heavy caller can ignore.

Can I get the same record from the Fake Addresses API and the npm package?

Yes. Both call the same underlying generation logic and honor the same seed and dataset parameters, so a record generated through the npm package with a given seed matches a raw HTTP call to /api/v1/ using that same seed and dataset version, field for field.

Is there a Python library, or only JavaScript?

Both. Fake Addresses publishes an npm package for Node.js and JavaScript projects and a PyPI package for Python projects, alongside the language-neutral OpenAPI 3.1 specification anyone can use to generate a typed client in another language entirely.

Sources

  • United States Postal Service — Postal Explorer — USPS Publication 28 defines a "standardized address" as one using official USPS abbreviations, and a "complete address" as one containing everything needed to match the ZIP+4 and City State files.
  • Universal Postal Union — The Universal Postal Union runs an addressing-solutions programme, including international addressing standards and assistance to member countries whose addresses do not follow a US or UK-style format.

Generate this kind of test data