Halal Eats

HTTP API quickstart

Call the Halal Eats API directly with curl, fetch, or your own HTTP client.

Use the HTTP API directly if you do not want the JavaScript SDK or need to integrate from another language.

Base URL

https://eatinghalal.vercel.app/api/v1

For local testing against your own running app:

http://localhost:3000/api/v1

First request

curl "https://eatinghalal.vercel.app/api/v1/stores?limit=10"

Equivalent JavaScript:

const response = await fetch("https://eatinghalal.vercel.app/api/v1/stores?limit=10");

if (!response.ok) {
  throw new Error(`Halal Eats API error: ${response.status}`);
}

const payload = await response.json();
console.log(payload.data);

Search restaurants

curl "https://eatinghalal.vercel.app/api/v1/stores?search=Turkish&halal_status=verified_halal"

Nearby restaurants

curl "https://eatinghalal.vercel.app/api/v1/stores/nearby?lat=-33.8688&lng=151.2093&radius=5000"

Authentication

Public read endpoints do not require an API key.

Contribution endpoints require a bearer token:

Authorization: Bearer hal_live_your_key

Example:

curl "https://eatinghalal.vercel.app/api/v1/stores/STORE_ID/reviews" \
  -X POST \
  -H "Authorization: Bearer hal_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{"rating":5,"comment":"Great food and clear halal information."}'

Response shape

Single-resource responses:

type ApiSuccess<T> = {
  data: T;
};

List responses:

type PaginatedApiSuccess<T> = {
  data: T;
  meta: {
    page: number;
    limit: number;
    total: number;
    totalPages: number;
  };
};

Errors:

type ApiErrorBody = {
  error: string;
  code: string;
};

OpenAPI

Interactive docs:

GET /api/v1/docs

Machine-readable OpenAPI document:

GET /api/v1/doc

On this page