# Astramedica Public API Documentation

Source: https://astramedica.com/docs/api

Reference for Astramedica's read-only public website endpoints, including health, services, and country-code lookup responses.

Last updated: 2026-05-10

## Health endpoint

**Method:** GET

**Path:** /api/health

Use this endpoint to confirm the public Astramedica API surface is reachable. It exposes basic contact and catalog context only and does not include patient data or protected resources.

**Cache notes:** No explicit cache header is set by this route.

### Documented responses

- **200** — Healthy public API surface.

### Response fields

- **ok** (boolean) — True when the endpoint is healthy.
- **service** (string) — Human-readable API surface name.
- **version** (string) — Application version from package.json.
- **publicServices** (number) — Count of published service pathways.
- **contact** (object) — Public coordination contact details for follow-up questions.

### Example response

```json
{
  "ok": true,
  "service": "Astramedica Public API",
  "version": "1.0.0",
  "publicServices": 11,
  "contact": {
    "email": "info@astramedica.com",
    "phone": "+1 202 500 5004"
  }
}
```

## Services endpoint

**Method:** GET

**Path:** /api/services

This endpoint provides a machine-readable summary of Astramedica's published coordination pathways. It falls back to the static site content if a database-backed service source is unavailable.

**Cache notes:** Public edge-cached JSON for one hour with stale-while-revalidate.

### Documented responses

- **200** — Published service summaries from Supabase or the static content fallback.
- **429** — Request was rate limited.
- **500** — Supabase service lookup failed after retry attempts.

### Runtime notes

- If Supabase configuration is unavailable, the route returns ok: true with service summaries derived from static site content.
- If the configured Supabase order column is unavailable, the route retries with title.asc and then without an order parameter before returning an error.

- Rate limited requests return HTTP 429 with ok: false and error: rate_limited. Rate limit headers are included on rate-limited and successful responses.

### Response fields

- **ok** (boolean) — True when the response is successful.
- **services** (array) — Published service summaries with a title and short description.

### Example response

```json
{
  "ok": true,
  "services": [
    {
      "title": "Hair Transplant",
      "description": "Compare FUE and DHI hair transplant options in Turkey with US-based coordination, travel planning, and vetted partner clinics."
    },
    {
      "title": "Dental Implants",
      "description": "Compare dental implant and full-arch options in Turkey with US-based coordination, travel planning, and vetted partner clinics."
    }
  ]
}
```

## Country codes endpoint

**Method:** GET

**Path:** /api/country-codes

This endpoint supplies ISO2 country codes, country names, and telephone calling codes for Astramedica's public intake experiences.

**Cache notes:** Public edge-cached JSON for one day with stale-while-revalidate.

### Documented responses

- **200** — Country calling code records, or an empty array when Supabase is not configured.
- **429** — Request was rate limited.
- **500** — Country-code lookup or seed handling failed; the error value can vary by failure mode.

### Runtime notes

- If Supabase configuration is unavailable, the route returns ok: true with an empty countryCodes array.
- If the country_calling_codes table is empty, the route attempts to seed records from Rest Countries and then re-fetches from Supabase.
- For 500 responses, the error value reflects the failure mode returned by the handler.

- Rate limited requests return HTTP 429 with ok: false and error: rate_limited. Rate limit headers are included on rate-limited and successful responses.

### Response fields

- **ok** (boolean) — True when the response is successful.
- **countryCodes** (array) — Country-code lookup records used by public forms.

### Example response

```json
{
  "ok": true,
  "countryCodes": [
    {
      "iso2": "US",
      "countryName": "United States",
      "callingCode": "+1"
    }
  ]
}
```