OneMap has over 100 thematic layers that users can retrieve via API. These thematic layers are provided by various government agencies. Use this API for location analysis or developing applications that bring out the livability of an area.
This API checks if the themes are updated.
400 - Please send the access token in the request header as a bearer token.
400 - There is no query name.
400 - Your date provided is empty.
401 - Token has expired: Session expired. Please refresh your token (if still within refresh window) or re-login.
401 - Invalid token: Could not decode token: The token xxx; is an invalid JWS.
403 - Access Forbidden. GET access to component 'xxx' of service 'xxx' is not allowed by this user's role.
429 - API limit(s) exceeded.
API token provided by the Authentication Service.
Query name. Themes’ query names can be retrieved using Get All Themes Info service.
The datetime in YYYY-MM-DDTHH:MM:SS:FFFZ. EG: 2023-06-15T16:00:00.000Z format.
1const url = "https://www.onemap.gov.sg/api/public/themesvc/checkThemeStatus?queryName=kindergartens&dateTime=2023-06-15T16%3A00%3A00.000Z";
2const authToken = '**********************'; // Replace with your access token
3
4fetch(url, {
5 method: 'GET',
6 headers: {
7 'Authorization': `${authToken}`, // API token for authorization
8 }
9})
10.then(response => response.json()) // Parse response as JSON
11.then(data => console.log(data)) // Log the data to the console
12.catch(error => console.error('Error:', error)); // Log any errors
1{
2 "UpdatedFile": true
3}
This API searches themes with queryName and returns the themes' info.
400 - Please send the access token in the request header as a bearer token.
400 - There is no query name
401 - Token has expired: Session expired. Please refresh your token (if still within refresh window) or re-login.
401 - Invalid token: Could not decode token: The token xxx; is an invalid JWS.
403 - Access Forbidden. GET access to component 'xxx' of service 'xxx' is not allowed by this user's role.
429 - API limit(s) exceeded.
API token provided by the Authentication Service.
Enables users to retrieve theme information. Themes' query names can be retrieved using Get All Themes Info service.
1const url = "https://www.onemap.gov.sg/api/public/themesvc/getThemeInfo?queryName=kindergartens";
2const authToken = '**********************'; // Replace with your access token
3
4fetch(url, {
5 method: 'GET',
6 headers: {
7 'Authorization': `${authToken}`, // API token for authorization
8 }
9})
10.then(response => response.json()) // Parse response as JSON
11.then(data => console.log(data)) // Log the data to the console
12.catch(error => console.error('Error:', error)); // Log any errors
1{
2 "Theme_Names": [
3 {
4 "THEMENAME": "Kindergartens",
5 "QUERYNAME": "kindergartens"
6 }
7 ]
8}
This API retrieves and returns a list of all available themes.
400 - Please send the access token in the request header as a bearer token.
401 - Token has expired: Session expired. Please refresh your token (if still within refresh window) or re-login.
401 - Invalid token: Could not decode token: The token xxx; is an invalid JWS.
403 - Access Forbidden. GET access to component 'xxx' of service 'xxx' is not allowed by this user's role.
429 - API limit(s) exceeded.
API token provided by the Authentication Service.
Optional. Values: Y, N. Returns more information of themes such as icon names, category names, and theme owners if set as Y. Default is N.
1const url = "https://www.onemap.gov.sg/api/public/themesvc/getAllThemesInfo?moreInfo=Y";
2const authToken = '**********************'; // Replace with your access token
3
4fetch(url, {
5 method: 'GET',
6 headers: {
7 'Authorization': `${authToken}`, // API token for authorization
8 }
9})
10.then(response => response.json()) // Parse response as JSON
11.then(data => console.log(data)) // Log the data to the console
12.catch(error => console.error('Error:', error)); // Log any errors
1{
2 "Theme_Names": [
3 {
4 "THEMENAME": "Kindergartens",
5 "QUERYNAME": "kindergartens",
6 "ICON": "school.gif",
7 "EXPIRY_DATE": "31/12/2026",
8 "PUBLISHED_DATE": "01/01/2012",
9 "CATEGORY": "Education",
10 "THEME_OWNER": "EARLY CHILDHOOD DEVELOPMENT AGENCY"
11 },
12 {
13 "THEMENAME": "Community Clubs",
14 "QUERYNAME": "communityclubs",
15 "ICON": "PA.jpg",
16 "EXPIRY_DATE": "31/12/2022",
17 "PUBLISHED_DATE": "01/01/2012",
18 "CATEGORY": "Community",
19 "THEME_OWNER": "PEOPLE'S ASSOCIATION"
20 },...,
21 {
22 "THEMENAME": "CET Centres",
23 "QUERYNAME": "cetcentres",
24 "ICON": "WSQ.jpg",
25 "EXPIRY_DATE": "31/12/2021",
26 "PUBLISHED_DATE": "01/01/2012",
27 "CATEGORY": "Education",
28 "THEME_OWNER": "SINGAPORE WORKFORCE DEVELOPMENT AGENCY"
29 }
30 ]
31}
This API searches and returns specified list of themes that are filtered by the search term.
The icon is located at https://www.onemap.gov.sg/images/themesIcon/{icon name }.{file extension}
400 - Please send the access token in the request header as a bearer token.
400 - There is no query name
401 - Token has expired: Session expired. Please refresh your token (if still within refresh window) or re-login.
401 - Invalid token: Could not decode token: The token xxx; is an invalid JWS.
403 - Access Forbidden. GET access to component 'xxx' of service 'xxx' is not allowed by this user's role.
429 - API limit(s) exceeded.
API token provided by the Authentication Service.
Enables users to retrieve theme information. Themes' query names can be retrieved using Get All Themes Info service.
1const url = "https://www.onemap.gov.sg/api/public/themesvc/retrieveTheme?queryName=dengue_cluster";
2const authToken = '**********************'; // Replace with your access token
3
4fetch(url, {
5 method: 'GET',
6 headers: {
7 'Authorization': `${authToken}`, // API token for authorization
8 }
9})
10.then(response => response.json()) // Parse response as JSON
11.then(data => console.log(data)) // Log the data to the console
12.catch(error => console.error('Error:', error)); // Log any errors
1{
2 "SrchResults": [
3 {
4 "FeatCount": 40,
5 "Theme_Name": "Dengue Clusters",
6 "Category": "Health",
7 "Owner": "NATIONAL ENVIRONMENT AGENCY",
8 "DateTime": "2023-07-11T15:54:59+00:00",
9 "Published_Date": "2013-06-26T00:00:00+00:00",
10 "Formatted_DateTime": "11/07/2023",
11 "Formatted_Published_Date": "26/06/2013"
12 },
13 {
14 "NAME": "Dengue_Cluster",
15 "DESCRIPTION": "Lor 4 Toa Payoh (Blk 62B, 66, 71, 73) / Lor 5 Toa Payoh (Blk 55)",
16 "HYPERLINK": "https://www.nea.gov.sg/dengue-zika/dengue/dengue-clusters",
17 "CASE_SIZE": "8",
18 "HOMES": "Domestic containers, Pail, Planter box, Flower pot plate/tray",
19 "PUBLIC_PLACES": "Puddle/ground depression, Domestic containers, Canvas sheet, Closed perimeter darain, Plant leaves, Inspection chamber, Discarded coconut husks, Scupper darin, Tree hole, Disacrded receptacles",
20 "MAPTIP": "Dengue_Cluster",
21 "SYMBOLCOLOR": "#FFFFFF",
22 "Type": "Polygon",
23 "LatLng": "[[103.850350730955,1.33866331941482],[103.850675995233,1.33845777044955],[103.850832242221,1.33835903262749],[103.851021145103,1.33820261057472],[103.852125919154,1.337226154554],[103.852820647897,1.33646601266903],[103.853470125116,1.33573928180302],[103.853689562754,1.33540526743064],[103.853794864562,1.33505969802759],[103.853801661111,1.33471673401618],[103.853763046875,1.33454362088808],[103.853615613621,1.33424332336343],[103.853442863977,1.33399475026009],[103.853201249917,1.33375405381435],[103.85145507206,1.33347300987719],[103.851353579675,1.33416235976273],[103.851293165986,1.3343972001566],[103.851259079473,1.3345568740998],[103.851184191992,1.3348179881942],[103.851082557678,1.33502975311817],[103.850955961659,1.33527561456845],[103.850854326799,1.33541559374158],[103.850344668896,1.33612841292271],[103.850223895785,1.33629830315427],[103.849942575137,1.33668264733536],[103.849873899538,1.33686186933158],[103.849846361961,1.3369419690815],[103.849779319569,1.33720230622839],[103.849774566459,1.33737698154924],[103.849806425447,1.3376019040183],[103.849900573891,1.33789717567323],[103.849987114171,1.33804600725171],[103.850165424435,1.33835228443411],[103.850350730955,1.33866331941482]]",
24 "GeoJSON": {
25 "type": "Feature",
26 "properties": {},
27 "geometry": {
28 "type": "Polygon",
29 "coordinates": "[[103.850350730955,1.33866331941482],[103.850675995233,1.33845777044955],[103.850832242221,1.33835903262749],[103.851021145103,1.33820261057472],[103.852125919154,1.337226154554],[103.852820647897,1.33646601266903],[103.853470125116,1.33573928180302],[103.853689562754,1.33540526743064],[103.853794864562,1.33505969802759],[103.853801661111,1.33471673401618],[103.853763046875,1.33454362088808],[103.853615613621,1.33424332336343],[103.853442863977,1.33399475026009],[103.853201249917,1.33375405381435],[103.85145507206,1.33347300987719],[103.851353579675,1.33416235976273],[103.851293165986,1.3343972001566],[103.851259079473,1.3345568740998],[103.851184191992,1.3348179881942],[103.851082557678,1.33502975311817],[103.850955961659,1.33527561456845],[103.850854326799,1.33541559374158],[103.850344668896,1.33612841292271],[103.850223895785,1.33629830315427],[103.849942575137,1.33668264733536],[103.849873899538,1.33686186933158],[103.849846361961,1.3369419690815],[103.849779319569,1.33720230622839],[103.849774566459,1.33737698154924],[103.849806425447,1.3376019040183],[103.849900573891,1.33789717567323],[103.849987114171,1.33804600725171],[103.850165424435,1.33835228443411],[103.850350730955,1.33866331941482]]"
30 }
31 },
32 "ICON_NAME": "mosquitoa20.jpg"
33 },...
34 ]
35}
This API searches and returns specified list of themes that are filtered by the search term within the specified boundary
400 - Please send the access token in the request header as a bearer token.
401 - Token has expired: Session expired. Please refresh your token (if still within refresh window) or re-login.
401 - Invalid token: Could not decode token: The token xxx; is an invalid JWS.
403 - Access Forbidden. GET access to component 'xxx' of service 'xxx' is not allowed by this user's role.
429 - API limit(s) exceeded.
API token provided by the Authentication Service.
Optional. Boundary provided by user. EG: 1.291789,103.7796402,1.3290461,103.8726032
1const url = "https://www.onemap.gov.sg/api/public/themesvc/retrieveTheme?queryName=dengue_cluster&extents=1.291789%2C103.7796402%2C1.3290461%2C103.8726032";
2const authToken = '**********************'; // Replace with your access token
3
4fetch(url, {
5 method: 'GET',
6 headers: {
7 'Authorization': `${authToken}`, // API token for authorization
8 }
9})
10.then(response => response.json()) // Parse response as JSON
11.then(data => console.log(data)) // Log the data to the console
12.catch(error => console.error('Error:', error)); // Log any errors
1{
2 "SrchResults": [
3 {
4 "FeatCount": 3,
5 "Theme_Name": "Dengue Clusters",
6 "Category": "Health",
7 "Owner": "NATIONAL ENVIRONMENT AGENCY",
8 "DateTime": "2023-07-11T15:54:59+00:00",
9 "Published_Date": "2013-06-26T00:00:00+00:00",
10 "Formatted_DateTime": "11/07/2023",
11 "Formatted_Published_Date": "26/06/2013"
12 },
13 {
14 "NAME": "Dengue_Cluster",
15 "DESCRIPTION": "Angklong Ln (Faber Gdn Condo) / Island Gdns Walk / Sin Ming Ave (Flame Tree Pk) / Sin Ming Walk (The Gdns at Bishan) / The Inglewood",
16 "HYPERLINK": "https://www.nea.gov.sg/dengue-zika/dengue/dengue-clusters",
17 "CASE_SIZE": "30",
18 "HOMES": "Ornamental containers, Domestic containers",
19 "PUBLIC_PLACES": "Ornamental containers, Plastic tray, Closed perimeter draun, Closed other drains, Keyhole, Open carpark drain",
20 "MAPTIP": "Dengue_Cluster",
21 "SYMBOLCOLOR": "#FFFFFF",
22 "Type": "Polygon",
23 "LatLng": "[[103.89920987978,1.3967446013845]]",
24 "ICON_NAME": "mosquitoa20.jpg"
25 }
26 ]
27}