Content APIs allow your applications to contribute and extract content from the Tourism Information and Services Hub (TIH). This guide will cover the following topics:

  1. Contributing Content to TIH
  2. Extracting Content from TIH

TIH has rich content of product and experience listings (also known as points-of-interest POIs) in Singapore across the 12 content categories (accommodation, attractions, bars and clubs, cruises, deals, events, food and beverages, precincts, malls and shops, tours, venues, and walking trails). In addition, you can also retrieve POIs related to wellness and SG Clean certification.

 

1. CONTRIBUTING CONTENT TO TIH

To contribute POIs in Singapore across the 12 content categories, you can use the following TIH Provider APIs:

  • Content Provider API (For accommodation, attractions, bars and clubs, cruises, events, food and beverages, precincts, malls and shops, tours, venues, and walking trails)
  • Deals Provider API (For deals)

Visit the API pages above to find out more about contributing a POI for each content category, such as knowing the mandatory and non-mandatory parameters within the request JSON body, the format of the field types and examples.

 

Using the TIH Provider APIs

  • Create a new POI using the Create <Category> API for a content category. An unique identifier (i.e. uuid) will be generated upon successful creation of the POI record.
  • Whenever there is latest information on your existing POI, update the POI using the Update <Category> API and specify the unique identifier of the POI.
  • (For all categories except deals) When your existing POI is no longer valid, delete the POI using the Delete <Category> API and specify the unique identifier of the POI.
  • (For deals category) For your existing deal that is no longer valid, suspend the deal using the Suspend Deals API and specify the unique identifier of the deal.

To perform these functions using the TIH Provider APIs, you will need an OAuth token. For more information on how to request and use an OAuth token, please visit this Getting Started page.

 

Other useful tips on TIH Provider APIs

  • For the following parameters, use the corresponding general content APIs to retrieve the possible values of the parameter:
    • "type" parameter - use the List Content Types API to retrieve a list of content types (or sub-category) for each content category.
    • "tags" parameter - use the List Tags API to retrieve the full list of tags available.
    • "dataset" parameter - use the List Datasets API to retrieve the full list of datasets (or content category) available.

     

  • New For POIs related to Wellness, you can tag them to Wellness for greater discoverability by specifying the value "wellness" in the "group" parameter within the request JSON body through the Create <Category> API (for new POI) API or Update <Category>  API (for existing POI).

     

  • Both Events and Walking Trails content categories support the creation of a single entity or a main entity with multiple sub-entities.
    • For events, a single event or a main event with multiple sub-events can be created.
    • For walking trails, a single walking trail or a main walking trail with multiple walking trail itineraries can be created.

     

  • For Attractions, Shops, Bars & Clubs, Food & Beverages and Tours content categories, you can provide the business hours of your POI using the "businessHour" and "businessHourNotes" parameters. The table below provides some examples of possible business hours scenarios that can be specified using the "businessHour" and businessHourNotes" parameters.

     

    Scenario Example Scenario Examples
    Daily open (24h) including public holiday "businessHour": [
    {
    "day": "daily",
    "openTime": “00:00",
    "closeTime": "23:59",
    "description": "",
    "sequenceNumber": 1,
    "daily": true
    }
    ],
    "businessHourNotes": { "notes": ""
    },
    Daily open (time based) including public holiday "businessHour": [
    {
    "day": "daily",
    "openTime": “08:30",
    "closeTime": "20:30",
    "description": "",
    "sequenceNumber": 1,
    "daily": true
    }
    ],
    "businessHourNotes": {
    "notes": ""
    },
    Daily (24h) with public holiday open (time based) "businessHour": [
    {
    "day": "daily",
    "openTime": “00:00",
    "closeTime": “23:59",
    "description": "",
    "sequenceNumber": 1,
    "daily": true
    },
    {
    "day": "public_holiday",
    "openTime": "08:30",
    "closeTime": “14:30",
    "description": "",
    "sequenceNumber": 2,
    "daily": false
    }
    ],
    "businessHourNotes": {
    "notes": ""
    },
    Daily (time based) with public holiday open (time based) "businessHour": [
    {
    "day": "daily",
    "openTime": “08:30",
    "closeTime": "20:30",
    "description": "",
    "sequenceNumber": 1,
    "daily": true
    },
    {
    "day": "public_holiday",
    "openTime": "08:30",
    "closeTime": “15:30",
    "description": "",
    "sequenceNumber": 2,
    "daily": false
    }
    ],
    "businessHourNotes": {
    "notes": ""
    },
    Daily open with multiple public holidays "businessHour": [
    {
    "day": "daily",
    "openTime": “00:00",
    "closeTime": “23:59",
    "description": "",
    "sequenceNumber": 1,
    "daily": true
    },
    {
    "day": "public_holiday",
    "openTime": "09:30",
    "closeTime": “15:30",
    "description": “Chinese New Year",
    "sequenceNumber": 2,
    "daily": false
    },
    { "day": "public_holiday",
    "openTime": “10:00",
    "closeTime": “17:00",
    "description": “New Year’s Day",
    "sequenceNumber": 3,
    "daily": false
    }
    ],
    "businessHourNotes": {
    "notes": "closed on 1st Chinese New Year"
    },
    Monday to Friday same "businessHour": [
    {
    "day": “monday",
    "openTime": “08:30",
    "closeTime": “16:30",
    "description": "",
    "sequenceNumber": 1,
    "daily": false
    },
    {
    "day": “tuesday",
    "openTime": "08:30",
    "closeTime": “16:30",
    "description": “",
    "sequenceNumber": 2,
    "daily": false
    },
    {
    "day": “wednesday",
    "openTime": “08:30",
    "closeTime": “16:30",
    "description": “",
    "sequenceNumber": 3,
    "daily": false
    },
    {
    "day": “thrusday",
    "openTime": “08:30",
    "closeTime": “16:30",
    "description": "",
    "sequenceNumber": 4,
    "daily": false
    },
    {
    "day": “friday",
    "openTime": "08:30",
    "closeTime": “16:30",
    "description": “",
    "sequenceNumber": 5,
    "daily": false
    },
    {
    "day": "public_holiday ",
    "openTime": “10:00",
    "closeTime": “14:30",
    "description": “",
    "sequenceNumber": 6,
    "daily": false
    }
    ],
    "businessHourNotes": {
    "notes": "closed on 1st Chinese New Year"
    },
    3 continuous days with same time "businessHour": [
    {
    "day": “wednesday",
    "openTime": “11:30",
    "closeTime": “14:30",
    "description": “Lunch",
    "sequenceNumber": 1,
    "daily": false
    },
    {
    "day": “wednesday ",
    "openTime": “17:00",
    "closeTime": “20:30",
    "description": “Dinner",
    "sequenceNumber": 2,
    "daily": false
    },
    {
    "day": “friday",
    "openTime": “11:30",
    "closeTime": “14:30",
    "description": “Lunch",
    "sequenceNumber": 3,
    "daily": false
    },
    {
    "day": “friday",
    "openTime": “17:00",
    "closeTime": “20:30",
    "description": “Dinner",
    "sequenceNumber": 4,
    "daily": false
    },
    {
    "day": “saturday",
    "openTime": “11:30",
    "closeTime": “14:30",
    "description": “Launch",
    "sequenceNumber": 5,
    "daily": false
    },
    3 continuous days with same time (continued) {
    "day": " saturday ",
    "openTime": “17:00",
    "closeTime": “20:30",
    "description": “Dinner",
    "sequenceNumber": 6,
    "daily": false
    },
    {"day": “sunday","openTime": “11:30",
    "closeTime": “14:30",
    "description": “Launch",
    "sequenceNumber": 7,
    "daily": false
    },
    {
    "day": “sunday ",
    "openTime": “17:00",
    "closeTime": “20:30",
    "description": “DInner",
    "sequenceNumber": 8,
    "daily": false
    },
    {
    "day": "public_holiday ",
    "openTime": “10:00",
    "closeTime": “14:30",
    "description": “Lunch",
    "sequenceNumber": 9,
    "daily": false
    }
    ],
    "businessHourNotes": {
    "notes": "Buffet dinner menu only available on Friday, Saturday, Sunday"
    },

 

2. EXTRACTING CONTENT FROM TIH

Using the following TIH APIs, your application can retrieve rich content and images of POIs in Singapore across the 12 content categories (accommodation, attractions, bars and clubs, cruises, deals, events, food and beverages, precincts, malls and shops, tours, venues, and walking trails).

 

Search a content category using Search <Category> By Keyword or UUIDs APIs

To search for POIs within a content category, use the Search <Category> By Keyword or UUIDs API that supports keyword search or UUIDs search and specify the following query parameters:

  • "searchType" parameter: can have values either "keyword" or "uuids".
  • "searchValues" parameter: [keywords] if "searchType=keyword" or [one or a list of uuids separated by comma] if "searchType=uuids".

 

Search multiple content categories using Search Multiple Datasets By Keyword API

To search for POIs across multiple content categories (or datasets), use the Search Multiple Datasets By Keyword API and specify the keywords to search in the "keyword" parameter.

For scenarios that search multiple datasets at a location in Singapore, use the Search Map By Multiple Datasets API of TIH Enhanced Navigation service to search for multiple content categories within an area identified by location and radius.

 

Other useful information on TIH Content & Deals User APIs

  • Pagination Method - TIH APIs supports a combination of "limit" and "offset" query parameters for extracting paginated records in the API response.
    • "limit" parameter defines the maximum number of records that can be returned. When no limit is defined, the limit will be set to a default value 20. The maximum value allowed is 50.
    • "offset" parameter defines the number of records that will be discarded before returning the response. The default value is 0.

       

      Example of API request:
      https://api.stb.gov.sg/content/attractions/v2/search?limit=20&offset=0

       

    • The API response of paginated records will also include the following fields, where applicable:
      • “totalRecords” field will be assigned the total record count value.
      • “retrievedRecords” field will be assigned the count of records for that response.
      • "paginationLinks" field with following attributes:
        • first attribute provides a link to the first page.
        • next attribute provides a link to the next page.
        • previous attribute provides a link to the previous page.
        • last attribute provides a link to the last page.

         

        Example of API response:
        {
        ... ...
        "paginationLinks": {
        “self”: “https://api.stb.gov.sg/content/attractions/v2/search?limit=20&offset=60”,
        “first”: https://api.stb.gov.sg/content/attractions/v2/search?limit=20&offset=0”,
        “prev”: “https://api.stb.gov.sg/content/attractions/v2/search?limit=20&offset=40”,
        “next”: “https://api.stb.gov.sg/content/attractions/v2/search?limit=20&offset=80”,
        },
        "totalRecords": 100,
        "retrievedRecords": 20
        }				

         

  • Sorting Method - The records in the API response can be sorted using a combination of "sort" and "sortOrder" query parameters.
    • "sort" parameter defines the attribute to be sorted by.
    • "sortOrder" parameter defines the order in which the result should be sorted. Possible values: "asc" to sort in ascending order, or "desc" to sort in descending order.

     

    Example of API request:
    https://api.stb.gov.sg/content/attractions/v2/search?sort=name&sortOrder=desc
    
    https://api.stb.gov.sg/content/deals/v2/search?sort=name&sortOrder=asc

 

 

To get started with extracting TIH content, you will need an API key. Learn how to get an API key from the Getting Started page.

 

Contributor

Content User

Draw from a variety of APIs across multiple tourism sectors which include Attractions, Tours, Events, and many more.

Contributor

Content Provider

Update your products and experiences on TIH with the latest information.

Deals

Deals User & Provider

Get access to the latest deals and promotions from TIH’s network of tourism players, and start creating deals.