Gov APIsgdi.gov.sg ↗
Search and retrieve personnel, contacts, and organisational data from the Singapore Government Directory (SGDI) via 3 structured API endpoints.
What is the Gov API?
The SGDI API provides access to Singapore's official Government Directory through 3 endpoints covering personnel search, organisation details, and directory listings. Use search_directory to run full-text queries across names, job titles, phone numbers, and emails. Use get_organization to pull structured contact data, personnel rosters, and sub-department links for any specific ministry or department. Use list_organizations to enumerate the full directory of ministries and organs of state.
curl -X POST 'https://api.parse.bot/scraper/5e0333d8-0c70-4dcb-b15e-f03b3b7c8c4c/search_directory' \
-H 'X-API-Key: $PARSE_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"page": "1",
"query": "director"
}'Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace sgdi-gov-sg-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: sgdi SDK — bounded, re-runnable; every call capped."""
from parse_apis.Singapore_Government_Directory_API import Sgdi, OrganizationNotFound
client = Sgdi()
# List all government organisations (ministries + organs of state).
for org in client.organization_summaries.list(limit=3):
print(org.name, org.path, org.url)
# Filter to a specific ministry by slug.
for org in client.organization_summaries.list(ministry="mfa", limit=3):
print(org.name, org.path)
# Search directory for personnel by query.
for result in client.search_results.search(query="Vivian", limit=3):
print(result.type, result.name, result.job_title, result.ministry)
# Get a specific organisation's personnel listing.
try:
for person in client.organizations.get(path="ministries/mfa", limit=3):
print(person.name, person.job_title, person.phone)
except OrganizationNotFound as e:
print("not found:", e.path)
print("exercised: organization_summaries.list, search_results.search, organizations.get")
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).
| Param | Type | Description |
|---|---|---|
| page | integer | Page number for paginated results (10 results per page). |
| queryrequired | string | Search term — matches against names, organisations, job titles, phone numbers, and emails. |
{
"type": "object",
"fields": {
"page": "current page number",
"query": "the search term used",
"total": "total number of matching results",
"results": "array of search result entries (personnel and organisations)"
},
"sample": {
"page": 1,
"query": "Vivian",
"total": 16,
"results": [
{
"name": "John Doe",
"type": "person",
"email": "[email protected]",
"phone": "+1 (555) 012-3456",
"ministry": "MINISTRY OF FOREIGN AFFAIRS",
"job_title": "Minister for Foreign Affairs",
"profile_url": "https://www.sgdi.gov.sg/ministries/mfa#Dr-Vivian-BALAKRISHNAN_Minister-for-Foreign-Affairs",
"ministry_url": "https://www.sgdi.gov.sg/ministries/mfa"
}
]
}
}About the Gov API
What the API covers
The Singapore Government Directory (SGDI) is the official contact registry for Singapore's public sector, listing personnel across all ministries, statutory boards, and organs of state. The API surfaces this directory through three endpoints that return structured contact and organisational data — names, job titles, phone numbers, emails, physical addresses, official websites, and organisational hierarchy.
Searching and browsing
The search_directory endpoint accepts a query string matched against multiple fields simultaneously — names, organisations, job titles, telephone numbers, and email addresses. Results are paginated at 10 per page; use the page parameter to iterate. Each response includes a total count, the query echoed back, and a results array containing a mix of personnel and organisation entries with their associated contact details.
list_organizations returns the directory's top-level structure — all ministries and organs of state — each with a name, path, and url. Pass a ministry filter (slug or partial name, case-insensitive) to narrow results. Add a department filter alongside ministry to drill into sub-departments. The response includes a total count and an organizations array.
Organisation detail
The get_organization endpoint accepts a path parameter that matches the URL segment identifying an organisation (e.g., ministries/mfa or ministries/mof/departments/agd). The response returns the organisation's name, address, telephone, fax, website, description, and a personnel array. Each personnel entry includes name, job_title, phone, email, and section. A departments array lists linked sub-departments by name and URL, and parent_name is populated for sub-departments to indicate their parent ministry.
The Gov API is a managed, monitored endpoint for sgdi.gov.sg — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when sgdi.gov.sg changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official sgdi.gov.sg API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Look up the direct phone number and email for a named Singapore government official using search_directory
- Build a structured contact list for all personnel within a specific ministry by combining list_organizations and get_organization
- Enumerate all sub-departments under a ministry using the departments array returned by get_organization
- Verify current job titles and assigned sections for officials in a given statutory board
- Find which ministry or department a person belongs to by searching their name or email via search_directory
- Retrieve the official website and physical address for any Singapore government organisation using its path
- Construct an org-chart skeleton by traversing parent_name and departments fields across ministry and department endpoints
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.