home > support > API > Marketplace API > API: rate limit status

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.

REST info

Endpoint/api/rate_limit_status
FormatsXML
Example/api/rate_limit_status.xml
VerbGET

Code samples

PHP examples use the PHP Client Library with the return type set to SimpleXML

Description

object api_rate_limit_status ( [ int $channel = 0 ] )


Parameters

$channel
Suppliers use your Channel ID. Partners leave blank / zero


Example

// 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

Overload list

XmlDocument ApiRateLimitStatus ()
XmlDocument ApiRateLimitStatus (int channelId)


Parameters

channelId
Suppliers use your Channel ID. Partners leave blank / zero

Example

// 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

Overload list

XmlDocument ApiRateLimitStatus ()
XmlDocument ApiRateLimitStatus (Integer ChannelId)


Parameters

channelId
Operators use your Channel ID. Agents leave blank / zero

Example

' 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


Example

// 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

Querystring parameters

There are no querystring parameters supported by this method.

Response fields

Response fields
XML NodeNotes
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_hitsNumber of remaining hits before you are throttled
hourly_limitCurrent GET limit per hour

More information