API documentation
Read-only JSON API over the same data that powers this site. No authentication, no rate limits, no keys. Versioned at /api/v1. Data is regenerated on every deploy; the meta endpoint carries the generation timestamp and commit SHA.
Quick start
curl https://goodsacrossborders.com/api/v1/index.json
curl https://goodsacrossborders.com/api/v1/rules/vape-e-cigarette_thailand_traveling.json
curl https://goodsacrossborders.com/api/v1/openapi.json
Endpoints (v1)
/api/v1/index.jsonCatalog of all endpoints with counts.
/api/v1/meta.jsonTotals, generation timestamp, commit SHA, licence.
/api/v1/openapi.jsonOpenAPI 3.1 specification (draft-2020-12 schemas).
/api/v1/items.json111 items/api/v1/items/{slug}.jsonAll items with category, risk level, HS codes, aliases.
/api/v1/countries.json85 items/api/v1/countries/{slug}.jsonCountry customs profiles — allowances, de minimis, VAT, restricted / prohibited categories.
/api/v1/rules.json5,339 items/api/v1/rules/{id}.jsonItem × country × purpose rule combinations. Rule ID = `${itemSlug}_${countrySlug}_${purpose}`.
/api/v1/carriers.json28 items/api/v1/carriers/{slug}.jsonInternational parcel carriers with prohibited / restricted lists.
/api/v1/medications.json33 items/api/v1/medications/{slug}.jsonMedications with per-country travel rules.
/api/v1/incoterms.json11 items/api/v1/incoterms/{slug}.jsonIncoterms 2020.
/api/v1/hs-chapters.json98 items/api/v1/hs-chapters/{chapter}.jsonHarmonized System chapter metadata.
/api/v1/guides.json37 items/api/v1/guides/{slug}.jsonLong-form explainer metadata. Body lives at the page URL.
/api/v1/airports.json78 items/api/v1/airports/{iata}.jsonAirport customs profiles (IATA-keyed, lower-cased).
/api/v1/airlines.json49 items/api/v1/airlines/{slug}.jsonAirline cabin and baggage policies.
/api/v1/scenarios.json30 items/api/v1/scenarios/{slug}.jsonProcedural cross-border scenarios (HowTo).
/api/v1/duty-rates.json3,553 itemsDuty rate entries per trade lane × HS chapter.
/api/v1/route-pairs.json8 itemsCountry-pair metadata including FTA status.
/api/v1/changelog.json327 itemsCurated site-data changelog entries (newest-first).
TypeScript SDK
A tiny, dependency-free client for the API. Source lives in packages/sdk/ in the repo; publish on npm is pending the user-space release pass.
import { createClient } from "@goodsacrossborders/sdk";
const gab = createClient();
const rule = await gab.getRule("vape-e-cigarette", "thailand", "traveling");
console.log(rule.status); // 'prohibited'
const countries = await gab.listCountries();
console.log(countries.length);Embed widget
Embed a compact rule card on your site with a single <script> tag. See a live demo →
<div data-gab-rule="vape-e-cigarette_thailand_traveling"></div> <script async src="https://goodsacrossborders.com/embed/rule.js"></script>
By use case
Eight worked examples (TS + Python + curl) live on /developers/examples:
- Fetch a country profile.
- Look up a single rule (item × country × purpose).
- Filter rules client-side.
- Sync rule changes nightly (changelog).
- Build a duty-rate lookup.
- Power a customs-warning widget at checkout.
- List trade lanes with an active FTA.
- Drop into an LLM tool-use schema (function calling).
Rate limits
No rate limits. The API is a set of static JSON files served from a CDN. Standard HTTP caching applies. Mirror the files locally for offline use.
Caching
- Every JSON file under
/api/v1/is static — same URL returns the same bytes between deploys. - The CDN sets
Cache-Controlto a moderate TTL; honour it. - Use
If-Modified-Since/ETagfor conditional refresh — most CDNs respond304 Not Modifiedwhen unchanged. - For SDK consumers:
listRules()is large (5,000+ entries); fetch once per build cycle and cache in your own layer. - /developers/changelog is the canonical signal that the dataset has moved.
Licence & attribution
All data is licensed CC-BY 4.0. When republishing or integrating, attribute as “Goods Across Borders — goodsacrossborders.com”. Commercial use is permitted within that attribution. Honest reproduction of the data requires keeping the lastVerified dates and sourceUrls alongside the content — they are load-bearing, not cosmetic.
Pricing
The public API is free and unmetered, and will remain free for all documented-rule data. Pricing page documents what the future paid tier will and won't cover.
On the roadmap (not yet shipping)
These are not available today. We list them here so you can plan ahead and email if a specific one would unlock something for you.
- Professional watchlists with email alerts on rule changes.
- Saved lanes with daily delta digests.
- CSV exports of arbitrary slices.
- White-label embeddable widgets.
- Compliance PDFs (auditable snapshot of a rule on a date).
- Historical rule changes (point-in-time API queries).
The public API stays CC-BY 4.0 and free. Premium features layer on top — they do not gate the core data.