# Sgdi — 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.

> Search for Singapore government personnel, contacts, and organizational details to find the right department or official for your needs. Quickly locate specific government staff members and their contact information, or browse entire organizational structures within the Singapore Government Directory.

**Category:** Government & Public Data | **Website:** [www.sgdi.gov.sg/ministries](https://www.sgdi.gov.sg/ministries) | **Docs:** [parse.bot/marketplace/fa679531-45a3-49ce-9b8b-5aad5ba5ae8d/sgdi-gov-sg-api](https://parse.bot/marketplace/fa679531-45a3-49ce-9b8b-5aad5ba5ae8d/sgdi-gov-sg-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-sgdi-gov-sg-api-fa679531/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_organization

Retrieve details of a specific government organisation including its name, contact information, description, all listed personnel (with names, job titles, phone numbers, and emails), and links to sub-departments. Accepts the URL path segment identifying the organisation.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `path` | string | Yes | URL path segment of the organisation (e.g. 'ministries/mfa', 'ministries/mof/departments/agd', 'organs-of-state/agc'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-sgdi-gov-sg-api-fa679531/get_organization \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"path":"<string>"}'
```

### list_organizations

Retrieve the complete directory of Singapore government organisations (ministries and organs of state). Without filters, returns all top-level entries. With ministry filter, narrows to matching ministry. With both ministry and department, returns matching sub-departments within that ministry. Results include name, path, and URL for each organisation.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `department` | string | No | Further filter to a sub-department within the specified ministry, by slug or name (e.g. 'hq'). Requires ministry to be specified. |
| `ministry` | string | No | Filter by ministry name or slug (e.g. 'mfa', 'FOREIGN AFFAIRS'). Case-insensitive partial match against organisation names and exact match against slugs. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-sgdi-gov-sg-api-fa679531/list_organizations \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"department":"<string>","ministry":"<string>"}'
```

### search_directory

Full-text search across the Singapore Government Directory by name, organisation, job title, telephone number, or email. Returns a mix of personnel and organisation results with contact details and organisational hierarchy. Results are auto-iterated across pages (10 results per server page).

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `page` | integer | No | Page number for paginated results (10 results per page). |
| `query` | string | Yes | Search term — matches against names, organisations, job titles, phone numbers, and emails. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-sgdi-gov-sg-api-fa679531/search_directory \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"page":"<integer>","query":"<string>"}'
```
