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

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 base 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.

NOTE: Please ignore URLs returned from this main resource listing link as you won't be able to access them directly. For subsequent requests, you would need to use the API URL request format below including providing the necessary API tokens and relevant parameters.

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.

GET /ysapi-services/RequestAPI?format=details&locale=en&pageid=1

email:email ID

token:token ID

Cookie:

Host:

Connection:

User-Agent:

Part 1: API Listings

To retrieve the API Listings, we have to get the email and token ID. To get the token and email ID, submit the online API form with the right email ID where you want to receive the token ID. Once you submit the form, an email will be sent to the entered email ID with the token ID. The received token and email ID are sent as part of the request headers, and 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 with the email and token ID, you will get the following response:

Sample Response

{

"categories: ",

-0:{

      "category":"Deals",

      "id":"0",

      "url":"http://www.yoursingapore.com/api.listing.en.0.json",

}

-1:{

      "category":"See & Do",

      "id":"2",

      "url":"http://www.yoursingapore.com/api.listing.en.2.json",

}

-2:{

      "category":"Festivals & Events",

      "id":"260",

      "url":"http://www.yoursingapore.com/api.listing.en.2.json",

}

-3:{

      "category":"Eat & Drink",

      "id":"306",

      "url":"http://www.yoursingapore.com/api.listing.en.306.json",

}

-4:{

      "category":"Editorials",

      "id":"471",

      "url":"http://www.yoursingapore.com/api.listing.en.471.json",

}



Description

Field Description Format Character Limit
categories The Array of category of pages. Text 5
category The TITLE of product page. Text 100
id The PAGE ID of product page. Text 5
url The URL for the API JSON. Text 100

Locale Description
Locale Name Locale ID
Englishen
Australiaen_au
China zh_cn
Germanyde_de
English Indiaen_in
Indonesiaid_id
Japanja_jp
Koreako_kr
Malaysiaen_my
Phillipinesen_ph
Thailandth_th
Vietnamvi_vn

The number of selectors in the URL (‘locale=Locale ID’ and ‘pageid=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.

NOTE: Locale ID is the id of the country locale specified in the table.

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=84, 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 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.

      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 acoustic engineering techniques, its       architecture and history, as well as its contribution to Singapore art scene.

",

"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",</p>

"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 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 your application hits the URL, 1 API call is used. 5,000 API calls are allowed per user every month. Once this limit is reached, the Status of User(s) will automatically be locked and the API token will no longer be available for use.

b. The API usage count will automatically reset to zero on the 28th day of each month. If your application has reached the 5,000 API call limit, you may either request the business administrator to unlock the token or wait for it to be unlocked on the 28th day of each month.

c. The JSON API cache will be refreshed weekly every Thursday.

"