home > support > API > Marketplace API > API: rate limit status
Check remaining limit for API requests (i.e. not currently throttled), current API requests remaining are also returned in the response header to every call.
Also useful for check you can connect correctly to the API.
Calls to this API do not count towards your throttle limit.
Endpoint | /api/rate_limit_status |
Formats | XML |
Example | /api/rate_limit_status.xml |
Verb | GET |
PHP examples use the PHP Client Library with the return type set to SimpleXML
object api_rate_limit_status ( [ int $channel = 0 ] )
// Set the Channel ID
// For Suppliers this can be found in the API settings page
// For Partners this will be 0
$channel_id = 0;
// Query the TourCMS API
$result = $tc->api_rate_limit_status($channel_id);
// Print out the remaining hits
print 'Remaining hits: '.$result->remaining_hits;
Remaining hits: 500
C# examples use the .Net Client Library
XmlDocument ApiRateLimitStatus ()
XmlDocument ApiRateLimitStatus (int channelId)
// Set the Channel ID
// For Suppliers this can be found in the API settings page
// For Partners this will be 0
int channelId = 0;
// Query the TourCMS API
XmlDocument doc = myTourCMS.ApiRateLimitStatus(channelId);
// Print out the remaining hits
string lim = doc.GetElementsByTagName("remaining_hits")[0].innerText;
Console.WriteLine("Remaining hits: " + lim);
Remaining hits: 500
VB examples use the .Net Client Library
XmlDocument ApiRateLimitStatus ()
XmlDocument ApiRateLimitStatus (Integer ChannelId)
' Set the Channel ID
' For Suppliers this can be found in the API settings page
' For Partners this will be 0
Dim channelId As Integer = 0
' Query the TourCMS API
Dim doc As XmlDocument = myTourCMS.ApiRateLimitStatus(channelId)
' Print out the remaining hits
Dim lim As String = doc.GetElementsByTagName("remaining_hits")(0).InnerText
Console.WriteLine("Remaining hits: " & lim)
Remaining hits: 500
NodeJS examples use the NodeJS Wrapper
// Set the Channel ID
// For Operators this can be found in the API settings page
// For Marketplace Agents this can be 0 for general API calls
// or set to a ChannelID to see how many calls remain on that Channel
var channelId = 0;
// Query the TourCMS API
TourCMS.apiRateLimitStatus({
channelId: channelId,
callback: function(response) {
console.log("Remaining hits: " + response.remaining_hits);
}
})
Remaining hits: 500
Looking for sample code in a different language? TourCMS and community provided API libraries
Implementing yourself? Check the REST info for this endpoint.
Enter your TourCMS API credentials below to call the API Rate limit status endpoint.
There are no querystring parameters supported by this method.
XML Node | Notes |
---|---|
request | Confirmation of the request that you sent |
error | Any error message returned, if there is no error this will just contain the text OK |
remaining_hits | Number of remaining hits before you are throttled |
hourly_limit | Current GET limit per hour |
<?xml version="1.0" encoding="UTF-8"?>
<response>
<request>GET /api/rate_limit_status.xml</request>
<error>OK</error>
<remaining_hits>2999</remaining_hits>
<hourly_limit>3000</hourly_limit>
</response>