Non-negotiable rules
- Use the production base URL:
https://api.hfsaa.organd send a production API key as a Bearer token. - Keep the API key in a server-side secret; never expose it in browser or mobile application code.
- Cache API data for no more than one hour, then revalidate or fetch fresh data.
- Treat the documented API response as the complete HFSAA data contract. Do not infer, scrape, or expose additional fields.
- When your product states or implies HFSAA certification, identify HFSAA and give users reasonable access to that location’s
verification_url. - Do not construct or alter
verification_urlvalues. Use the exact URL returned by the API.
Fetch locations
Use one endpoint for restaurants, meat markets, and dining halls. Select a category with thetype query parameter when needed.
Render verification and attribution
When you state or imply that a location is certified or halal verified by HFSAA, identify HFSAA and provide reasonable access to the exact returnedverification_url. There is no required wording or placement.
verification_url, and do not suggest that HFSAA endorses your application.
Handle nullable directory fields
chapter_name, address, city, state, zip_code, cuisine_type, and google_place_id may each be null. Do not assume that address or chapter information is present. Omit or adapt UI elements that depend on unavailable values.
Paginate correctly
Responses includepagination.next_cursor.
- If it is a string, pass that exact value as
cursorin the next request. - If it is
null, there are no further results. - Keep the same filters while moving through pages.
- Treat cursors as opaque values. Do not decode, modify, or generate them.
- Every page repeats the same immutable
dataset_version, even if a newer snapshot is published while you paginate. - Superseded versions remain available for at least seven days. If a cursor returns HTTP
410, restart without that cursor. limitmust be an integer from 1 to 100.
Handle validation errors
Correct invalid requests rather than retrying them unchanged. For example,limit=0 returns HTTP 400:
404. Rate and monthly limits are assigned per API key; HTTP 429 includes Retry-After. Retry 429, 500, 502, 503, and 504 with bounded exponential backoff and jitter, honoring Retry-After when present. Do not retry invalid 400 requests unchanged.
Download a reproducible snapshot
FetchGET /v1/dataset before downloading a complete dataset. Its response includes:
- an opaque
dataset_version - the UTC
generated_attime - the exact
location_count - a SHA-256 checksum
- a version-specific
download_url
download_url. Use that version-specific URL when storing or redistributing a snapshot.
The one-hour caching limit still applies to version-specific downloads. Revalidate or fetch a fresh copy after one hour even when the same immutable version remains available from the API.
Google Place IDs
google_place_id is optional and is only an identifier. The HFSAA API does not return Google photos, hours, maps, ratings, or other Google content.
If you enrich a listing through Google Places, use your own Google Maps Platform project, credentials, billing, attribution, and policy compliance. HFSAA attribution remains required for the HFSAA data displayed alongside that enrichment.
Implementation checklist
- Fetch only from
https://api.hfsaa.org. - Send the production API key as a Bearer token from server-side code only.
- Revalidate or refresh all cached API data within one hour.
- Filter location listings with
type,state,city,zip_code,chapter, orqas needed. - Follow
next_cursorfor additional pages. - Confirm every page in a pagination sequence has the same
dataset_version. - Restart pagination if an expired cursor returns HTTP
410. - Honor
Retry-Afterand use bounded backoff with jitter for retryable responses. - Verify complete downloads against the SHA-256 checksum from
GET /v1/dataset. - When claiming HFSAA certification, identify HFSAA and make the exact
verification_urlreasonably accessible. - Handle nullable chapter, address, cuisine, and Google Place ID fields.
- Keep Google Places enrichment separate and use your own provider credentials.
- Refer to the API Reference for the authoritative endpoint and field definitions.