# Mahsaalert — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Track real-time safety information across Iran by accessing map data on danger zones, confirmed attacks, evacuation warnings, citizen reports, and military sites filtered by location and category. Monitor specific areas or search for detailed information about threats and incidents in your region of interest.

**Category:** Maps & Geospatial | **Website:** [mahsaalert.app/](https://mahsaalert.app/) | **Docs:** [parse.bot/marketplace/0faeaa1a-2fb4-4801-8dff-7185ac420ee6/mahsaalert-app-api](https://parse.bot/marketplace/0faeaa1a-2fb4-4801-8dff-7185ac420ee6/mahsaalert-app-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-mahsaalert-app-api-0faeaa1a/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_feature_detail

Get detailed information about a specific map feature by its ID. Returns coordinates, metadata, status, timestamps, and associated media.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `feature_id` | integer | Yes | Feature ID (obtained from get_layer_features or get_map_data results) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-mahsaalert-app-api-0faeaa1a/get_feature_detail \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"feature_id":"<integer>"}'
```

### get_layer_features

Get features for a specific map layer by layer key or ID. Optionally filter by bounding box. Returns feature coordinates, properties (name, city, province, description, date), and status. Supports pagination via limit and offset.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `bbox` | string | No | Bounding box filter: min_lon,min_lat,max_lon,max_lat (e.g. '51.0,35.5,51.8,35.9' for Tehran area) |
| `layer_id` | integer | No | Layer ID number. Either layer_key or layer_id is required. |
| `layer_key` | string | No | Layer key (e.g. 'nuclearPrograms', 'missilePrograms', 'antiAirBase', 'radarBase', 'areowayBase', 'newTargets', 'evacAreaII', 'citizenReport', 'targets', 'protestPoint'). Use get_layers to see all available keys. Either layer_key or layer_id is required. |
| `limit` | integer | No | Maximum number of features to return |
| `offset` | integer | No | Offset for pagination |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-mahsaalert-app-api-0faeaa1a/get_layer_features \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"bbox":"<string>","layer_id":"<integer>","layer_key":"<string>","limit":"<integer>","offset":"<integer>"}'
```

### get_layers

Get all available map layers with metadata including layer keys, categories, property schemas, and update timestamps. Use the returned layer keys/IDs to query features via get_layer_features or get_map_data.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-mahsaalert-app-api-0faeaa1a/get_layers \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_map_data

Get map features from multiple layers at once, filtered by bounding box and/or category. Defaults to Tehran area bbox. Returns features grouped by layer. Useful for getting an overview of all features in a geographic area.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `bbox` | string | No | Bounding box: min_lon,min_lat,max_lon,max_lat |
| `category` | string | No | Filter by category name (e.g. 'Danger Zones', 'Monitor', 'Suppression Sites', 'Medical sites', 'Iran-Israel War', 'DeyMah-Protests') |
| `layer_keys` | string | No | Comma-separated layer keys to include (e.g. 'nuclearPrograms,missilePrograms,antiAirBase'). If omitted, includes all enabled layers. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-mahsaalert-app-api-0faeaa1a/get_map_data \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"bbox":"<string>","category":"<string>","layer_keys":"<string>"}'
```
