Let our site be more useful to you each time you visit by enabling your cookies so we can remember details like your preferred language and more for a smoother browsing experience. Okay

Statement on Singapore’s Zika situation: We remain a safe travel destination and our visitors’ well-being and health are our top priority.

For Developers: API Overview

The YourSingapore.com API is a RESTFUL web service that’s designed to be easy to explore and use. This page will get you started on how to develop and use it.

The URL to access all resource is: http://www.yoursingapore.com/api.listing.en.json (in JSON format). It is our hope that through the base URL, a developer getting started with our API will be able to reach and manipulate our APIs without reading through multiple pages of documentation. This is accomplished by reading the following instructions on how to use each representation (link templates) in the response itself.

Quick API Overview

On submitting the online API form, end user will receive an email with the generated API token. To validate the API token and email ID authentication, this token and email ID needs to be sent as part of the request header in the JSON base URL.

For example:

To use the base URL along with email and token ID in the request, call the URL http://www.yoursingapore.com/ysapi-services/RequestAPI?format=listing&locale=en&pageid=1 where "format" can be "listing" or "details", and "page id" is the ID of the page where you want to access the further resources in JSON format.

Part 1: API Listings

Once the token and email ID are sent as part of the request headers, the user will be able to access the defined resources. On calling the URL: http://www.yoursingapore.com/ysapi-services/RequestAPI?format=listing&locale=en&pageid=1, you will get the following response:

Sample Response

{

"category":"See & Do",

"details":[

{

"id":"10",

"url":"http://www.yoursingapore.com/api.details.en.10.json",

"last-modified":"Mon Jun 09 18:11:38 SGT 2014"

},

{

"id":"11",

"url":"http://www.yoursingapore.com/api.details.en.11.json",

"last-modified":"Mon Jun 09 18:11:38 SGT 2014"

},

{

"id":"528",

"url":"http://www.yoursingapore.com/api.details.en.528.json",

"last-modified":"Mon Jun 09 18:11:38 SGT 2014"

}

]

}

Description
Field Description Format Character Limit
category The current category for the current country/locale. Text 100
details The metadata of the product pages. Array of details
id The ID for each product page. Text 5
url The URL to access that product detail API. URL 2,048
last-modified The last modified timestamp of each product page. Timestamp: dow mon dd hh:mm:ss zzz yyyy 40

The number of selectors in the filename (‘en’ and ‘1’) determine the type of listing to display. For this listing to be displayed, the filename requires 2 selectors. In any case, the URL for this API should follow the listing.language.json API.

Category ID will never be the same as Detail ID. Each page will have a unique ID.

Part 2: API Details

The response above provided us with links to the API Detail ID for individual pages under a selected category.

To access the page detail information, make a request using the Detail ID = 528 along with the email id and token id as request headers. On calling the URL: http://www.yoursingapore.com/ysapi-services/RequestAPI?format=details&locale=en&pageid=528, you will get the following response:

Sample Response

{

"id":"84",

"url":"http://www.yoursingapore.com/see-do-singapore/arts/performance-arts/esplanade-theatres-on-the-bay.html",

"title":"Esplanade Theatres on the Bay",

"overview":"Catch a non-stop line-up of world-class performances at Singapore\\u2019s premier arts centre.",

"content":[

{

"content":[

{

"body":"

Pop by the Esplanade at any time and you\\u2019ll find it hard not to be infected by its palpable creative vibe, whether it\\u2019s the ever-changing larger than life display near the main entrance or the world-class performances that are staged here.

The shows on offer cut across cultures and genres. You can catch a concert by Western greats such as The New York Philharmonic Orchestra or a Chinese play inspired by the late doyen of Singapore Chinese theatre Kuo Pao Kun.

Fondly nicknamed "the Durian\\u201d by Singaporeans for its resemblance to the popular fruit here, the Esplanade holds a 1,600-seat concert hall, a 2,000-seat theatre and several more intimate performance venues, which have been the setting for high-profile events such as the Singapore Arts Festival.

Free events, from music and dance to theatre, also regularly take place at various locations around the Esplanade.

",

"image-path":"http://www.yoursingapore.com/content/dam/desktop/global/see-do-singapore/arts/the-esplanade-body01-rect.jpg",

"image-alt":"The Esplanade has been the setting for various high-profile events and international performances."

},

{

"subheader":"Shopping and dining",

"body":"

Before you attend a performance, how about a pre-show dinner or a coffee at one of the restaurants or cafes at the Esplanade\\u2019s three-storey mall? And you can squeeze in a quick spot of shopping at the retail outlets, picking up goods as diverse as customised hand lotions, or maybe a guitar or two. <\\/p>\\n

If you wish to explore the complex further, take the Esplanade Walk, a 45-minute guided tour that walks you through the Concert Hall, Theatre and other front-of-house facilities. The tour will give you an understanding of the venue\\u2019s acoustic engineering techniques, its architecture and history, as well as its contribution to Singapore\\u2019s art scene. <\\/p>\\n",

"image-path":"http://www.yoursingapore.com/content/dam/desktop/global/see-do-singapore/arts/the-esplanade-body02-rect.jpg",

"image-alt":"Enjoy a spot of shopping and dining before or after shows at the Esplanade's 3-storey mall."

}

]

}

],

"images":[

{

"url":"http://www.yoursingapore.com/content/dam/desktop/global/see-do-singapore/arts/the-esplanade-carousel01-rect.jpg",

"alt-text":"Get your dose of creativity at Esplanade Theatres on the Bay, Singapore's premier arts centre.",

"photo-description":"Aerial shot of Esplanade Theatres on the Bay",

"photo-credit":"Andrew Tan",

"photo-caption":"Get your dose of creativity at the Esplanade, Singapore's premier arts centre."

},

{

"url":"http://www.yoursingapore.com/content/dam/desktop/global/see-do-singapore/arts/the-esplanade-carousel02-rect.jpg",

"alt-text":"A non-stop line-up of local and international performances awaits at the Esplanade theatres.",

"photo-description":"A live performance being held outdoors at Esplanade Theatres on the Bay",

"photo-caption":"Local and international performances are held indoors and outdoors, all-year round."

},

{

"url":"http://www.yoursingapore.com/content/dam/desktop/global/see-do-singapore/arts/the-esplanade-carousel03-rect.jpg",

"alt-text":"The architecture of Esplanade Theatres on the Bay resembles that of the durian fruit.",

"photo-description":"Architecture of Esplanade Theatres on the Bay",

"photo-caption":"Nicknamed 'the Durian' by locals, its architecture resembles that of the popular fruit."

}

],

"meta-description":"Catch a non-stop line-up of world-class performances at Singapore\\u2019s premier arts centre.",

"address":"1 Esplanade Drive",

"postal-code":"038981",

"longitude":"103.85528",

"latitude":"1.2898",

"opening-hours":"",

"last-modified":"Wed Aug 20 09:59:23 SGT 2014"

}

Description
Field Description Format Character Limit
id The ID for each product page. Text 5
url The URL to access the current product page. URL 2,048
title The content header and title of the product page. Text 42
overview The brief description of the product page. Text 1,500
content The actual content of the product page. Array of objects
header The header of the content section. Text, non-mandatory 1,500
description The description of the content section. Text, non-mandatory 1,500
title The content header and title of the product page. Text 42
image-path The image associated with this content section. URL, non-mandatory 2,048
image-caption The caption of the image. Text, non-mandatory 1,500
image-alt The alt text of the image. Text, non-mandatory 1,500
content The content of each paragraph. Array of objects
location-no The location number (only applies to itineraries) Text, non-mandatory 3
subheader The header of the paragraph. Text, non-mandatory 1,500
body The body content of the paragraph. Text, non-mandatory No limit.
image-path The image associated with this paragraph. URL, non-mandatory 2,048
image-path The image associated with this content section. URL, non-mandatory 2,048
image-caption The caption of the image. Text, non-mandatory 1,500
image-alt The alt text of the image. Text, non-mandatory 1,500
quote The quote associated with this paragraph. Text, non-mandatory 1,500
images The images associated with this product page. Array of images
url The URL of each image. URL 2,048
alt-text The alt text of each image. Text 120
photo-description The description of each image. Text 120
photo-credit The credits of each image. Text e.g. "Andrew Tan" 120
photo-caption The caption of each image. Text 120
meta-description The meta description of the product page. Text 120
address The address of the product page. Text 80
postal-code The postal code of the product page. Text 10
longitude The longitude of the product page. Text 15
latitude The latitude of the product page. Text 15
opening-hours The opening hours of the product page. Text 100
last-modified The last modified timestamp of the product page. Timestamp: dow mon dd hh:mm:ss zzz yyyy 40

The number of selectors in the filename ("en" and "528") determines the language and ID of the content respectively. In any case, the URL for this API should follow the listing.en.1.json API.

NOTE:

a. Every time when you hit the URL, 1 API call is used. 5000 API calls are allowed per user, every month. Once it is achieved, the Status of User(s) will be automatically locked and you won't be able to use the API token anymore

b. API usage count will be reset back to zero automatically on 28th of each month. So, either request the business administrator to unlock the token or it will be automatically unlocked by 28th of each month.

c. JSON API cache will be refreshed weekly, by every Thursday.

"