Reproducible address API fixtures with seeds and versions
Record the parameters that make an API fixture repeatable and know when a catalog update can change it.
AI summary
Save country, region, requested count, seed, and generator data version beside the test. A seed alone is not enough if the algorithm or its source catalog can change.
Capture all inputs that shape the fixture
Save country, region, requested count, seed, and generator data version beside the test. A seed alone is not enough if the algorithm or its source catalog can change.
Use the project endpoint as documented
fakeloc’s endpoint accepts a country, optional region, count, and required seed; the documented maximum is 100 records. It returns synthetic fixtures and has no account or API-key system. Do not send personal data.
curl "https://fakeloc.tech/api/addresses?country=us&count=2&seed=checkout-42&profile=false"
Response envelope: { "data": [/* two records */], "count": 2, "synthetic": true }
Each record includes generatorVersion and dataVersion; pin both with the request parameters.Pin output only when the test needs exact values
For a form contract test, assert required fields and types rather than a whole record snapshot. Use an exact fixture when a specific edge case matters, and refresh it intentionally when the dataset version changes.
Make failures diagnosable
Log the non-sensitive parameters and response version. If the result differs, first check the seed encoding, country alias, and version before treating it as a regression.