A RESTful web-based API.
All API requests require authentication in order to identify you, which is achieved by way of a unique consumer_key
. If you do not have a key, please contact us and we will create a publisher account and generate your key.
When making API requests, simply pass your consumer_key
as a URL parameter for GET requests or within the POST body, or as the value of the Authorization
header.
Blank fields are included as null
instead of being omitted.
All timestamps are returned in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ
All results returned in list methods are paginated. The default is 20 items per page, with an upper limit of 30. But you can set the per_page
parameter to override this. You can also tell the API which page to return using the page
parameter, which obviously has a default of 1 (being the first page).
The pagination info is included in the Link header (Linebreak is included for readability):
Link: <https://api.deals.shermanstravel.com/v1/deals?page=3&per_page=10>; rel="next", <https://api.deals.shermanstravel.com/v1/deals?page=6&per_page=10>; rel="last"
The possible rel
values are:
next
last
first
prev
You can send a ?callback
parameter to any GET call to have the results wrapped in a JSON function. This is typically used when browsers want to embed Deals content in web pages by getting around cross domain issues. The response includes the same data output as the regular API, plus the relevant HTTP Header information.
$ curl http://api.deals.shermanstravel.com?callback=foo foo({ "deals": [ { "id":195, "title":"$86+: Brooklyn Downtown Hotel w/3rd Night Free" } ] })
/v1/deals/:id.:format
Fetches a single deal including all associated data.
/v1/deals.:format
Fetches a single deal including all associated data.
/v1/deals-scroll.:format
Optimal option for Infinite Scrolling and a better alternative to deep pagination.
How it works
In the 2nd request, only the consumer_key
and scroll_id
are required.
We will maintain a session open for 5 minutes, so the filters applied in the 1st request will automatically be applied in all subsequent requests as long as you send the scroll_id
(received in the 1st request).
Place the below pixel on your booking or email signup confirmation page, making sure to replace the "TYPE" value with the "booking" or "signup" value accordingly. You must also replace the "PARTNER_ID" value with an unique ID provided by ShermansTravel. You may also optionally pass a "label" value. Please ensure it is persisted to your confirmation page, so it may be inserted into the pixel on this page. For assistance with implementation, please contact: development@shermanstravelmedia.com
<!-- Please Use This Test Pixel For Testing Only --> <img src="https://staging.click.deals.shermanstravel.com/{PARTNER_ID}/convert.gif?type={TYPE}&label={LABEL}" rel="nofollow" alt="" height="1" width="1"> <img src="https://staging.clicks.shermanscruise.com/{PARTNER_ID}/convert.gif?type={TYPE}&label={LABEL}" rel="nofollow" alt="" height="1" width="1">
<!-- Please Use This Pixel In Production --> <img src="https://click.deals.shermanstravel.com/{PARTNER_ID}/convert.gif?type={TYPE}&label={LABEL}" rel="nofollow" alt="" height="1" width="1"> <img src="https://clicks.shermanscruise.com/{PARTNER_ID}/convert.gif?type={TYPE}&label={LABEL}" rel="nofollow" alt="" height="1" width="1">Examples:
<!-- Booking conversion pixel without label --> <img src="https://click.deals.shermanstravel.com/{PARTNER_ID}/convert.gif?type=booking" rel="nofollow" alt="" height="1" width="1"> <img src="https://clicks.shermanscruise.com/{PARTNER_ID}/convert.gif?type=booking" rel="nofollow" alt="" height="1" width="1">
<!-- Email signup conversion pixel with label --> <img src="https://click.deals.shermanstravel.com/{PARTNER_ID}/convert.gif?type=signup&label=a-sample-label" rel="nofollow" alt="" height="1" width="1"> <img src="https://clicks.shermanscruise.com/{PARTNER_ID}/convert.gif?type=signup&label=a-sample-label" rel="nofollow" alt="" height="1" width="1">
Place the below pixel on your booking confirmation page, making sure to replace the "stsid" value with the "stsid" value found in the URL. ShermansTravel will pass this "stsid" value to your landing page: please ensure it is persisted to your confirmation page, so it may be inserted into the pixel on this page. For assistance with implementation, please contact: development@shermanstravelmedia.com
<!-- Please Use This Test Pixel For Testing Only --> <img src="https://staging.click.deals.shermanstravel.com/convert.gif?stsid={STSID}" rel="nofollow" alt="" height="1" width="1">
<!-- Please Use This Pixel In Production --> <img src="https://click.deals.shermanstravel.com/convert.gif?stsid={STSID}" rel="nofollow" alt="" height="1" width="1">
Deals can also be consumed and exposed via a simple but powerful Javascript based widget, which allows you to drop a few lines of code directly onto your site's HTML pages. This will then render a nicely formatted widget containing a few deals.
At present, there is only one widget design, but it accepts almost the same options as the REST API. The following options are supported and abide by the same formatting rules as the REST API category
, exclude_category
, no_follow
, partner
, exclude_partner
, tag
, exclude_tag
, geotag
and exclude_geotag
(see the #list method for more info on each of these options).
<script src="https://api.deals.shermanstravel.com/assets/widget.js"></script> <script type="text/javascript"> new DealsWidget('your api key'); </script>
<script src="https://api.deals.shermanstravel.com/assets/widget.js"></script> <script type="text/javascript"> new DealsWidget('your api key' { no_follow: true }); </script>
<script src="https://api.deals.shermanstravel.com/assets/widget.js"></script> <script type="text/javascript"> new DealsWidget('your api key', { categories: 'hotel' }); </script>
<script src="https://api.deals.shermanstravel.com/assets/widget.js"></script> <script type="text/javascript"> new DealsWidget('your api key', { tag: 'romance' }); </script>
<script src="https://api.deals.shermanstravel.com/assets/widget.js"></script> <script type="text/javascript"> new DealsWidget('your api key', { use_images: true }); </script>
<script src="https://api.deals.shermanstravel.com/v1/widget/widget.js"></script> <div id="sht_custom_widget_example"></div> <script type="text/javascript"> new SHTWidget('apikey13', 'Most Popular Deals', {container_id: "sht_custom_widget_example" }); </script>
<script src="https://api.deals.shermanstravel.com/v1/widget/small.js"></script> <div id="sht_featured_widget_example_collection"></div> <script type="text/javascript"> new SHTFeaturedCollectionWidget('your api key', {container_id: "sht_featured_widget_example_collection" }); </script>
<script src="https://api.deals.shermanstravel.com/v1/widget/small.js"></script> <div id="sht_featured_widget_example_collection_navy"></div> <script type="text/javascript"> new SHTFeaturedCollectionWidget('your api key', {container_id: "sht_featured_widget_example_collection_navy", theme: 'navy' }); </script>
<div id="full_page_example_1"> #widget container 1 </div> <script src="https://api.deals.shermanstravel.com/v1/widget/fp_script.js"></script> <script type="text/javascript"> new SHTFullPageWidget({ consumer_key: 'your api key', container_id : 'full_page_example_1' }); </script>
<div id="example_1"> #widget container 1 </div> ... ( Widget will inherit the size of its parent ) <script src="https://api.deals.shermanstravel.com/v1/widget/script.js"></script> <script type="text/javascript"> new SHTLargeWidget({ consumer_key: 'your api key', container_id : 'example_1' }); </script>
<div id="example_2"> #widget container 2 </div> ... ( Widget will force the size to a wider space ) <script src="https://api.deals.shermanstravel.com/v1/widget/script.js"></script> <script type="text/javascript"> new SHTLargeWidget({ consumer_key: 'your api key', container_id : 'example_2', expansive: true }); </script>
<div id="example_3"> #widget container 3 </div> ... ( Widget will force the size to a wider space ) <script src="https://api.deals.shermanstravel.com/v1/widget/script.js"></script> <script type="text/javascript"> new SHTLargeWidget({ consumer_key: 'your api key', container_id : 'example_3', no_follow: true }); </script>
<div id="example_5"> #widget orange 1 </div> ... ( Widget will inherit the size of its parent ) <script src="https://api.deals.shermanstravel.com/v1/widget/script.js"></script> <script type="text/javascript"> new SHTLargeWidget({ consumer_key: 'your api key', container_id : 'example_5', theme: 'orange' }); </script>
<div id="example_6"> #widget orange 2 </div> ... ( Widget will inherit the size of its parent ) <script src="https://api.deals.shermanstravel.com/v1/widget/script.js"></script> <script type="text/javascript"> new SHTLargeWidget({ consumer_key: 'your api key', container_id : 'example_6', theme: 'orange', condensed: true }); </script>