Cleartrip API Documentation

Welcome to the developer documentation of the Cleartrip APIs. The Cleartrip APIs let you build full featured websites and applications with all the power of Cleartrip's fast flight and hotel search and book functionalities, without having to sweat it out yourself to implement the complex stuff we've already done.

This documentation is rather new, so there might be bugs or it might be less than complete. We're sorry for the lapse, and we're constantly working on perfecting this documentation. Please let us know on our API forum if you find anything amiss.


Getting Started

You can start using the Cleartrip APIs right away, provided you have the following things in place.

RESTful web services

From the Wikipedia article on REST:

REST strictly refers to a collection of network architecture principles which outline how resources are defined and addressed.

We've based our API on the REST architectural principles.We chose REST over other architectural styles since it's the easiest to use and is agnostic to programming languages and frameworks.

If you are not familiar with REST, you are strongly encouraged to read up about it. The external references in the wikipedia article linked to above is a great place to start learning about REST. Whatever be your favourite programming language, it should be very easy for you to get the fundamental concepts and start using our APIs almost immediately. Depending on your language of choice, you might already have tools to communicate RESTfully with web services.


XML and XSD

A lot of our web service requests and responses are in the XML data format. To create such requests, you will need familiarity with constructing XML documents. Also, since most of our responses are in XML, you will need to know how to parse XML documents. Almost all modern programming frameworks have already got built in tools to work with XML, and we've ensured that our XML formats conform to all established standards, so you should already be able to use them very easily. Please check with your favourite language or framework documentation to check for XML tools.

The first level of validation for all XMLs is done using XML Schema Documents (XSDs). Though it is not absolutely necessary for you to understand how this works, it will help you a lot during your initial development time. Some knowledge of XSD will let you check if your XML is valid even before you make an API request to us. This will not only make your application faster (you needn't wait for us to throw errors when you could catch the error yourself), it will also help you ensure that you conform to our XML structure during development.


API key

The API key should be sent as the value of the X-CT-API-KEY HTTP request header with every API request. Failure to send an API key will result in an HTTP 403 (Forbidden) response.

Get an API key

  1. Register on our staging environment at http://api.staging.cleartrip.com/register.
  2. When you complete your registration, you will be presented with a link to generate an API key.
  3. Please go through the API documentation available at http://www.cleartrip.com/api/docs/air-api/index.shtml and http://www.cleartrip.com/api/docs/hotel-api/index.shtml.
  4. You will also be presented with a link to generate a deposit account* along with the option of specifying an initial deposit amount.
  5. The incentive structure for API bookings will be emailed to you when you register for the api key.
  6. All your transactions will be available for view/download inside your cleartrip account.

* A deposit account is a pre-paid account. Once we approve your application to go live on production, you will need to deposit money with Cleartrip on the deposit account to allow people transact on your application.

Lost your key?

If you happen to lose your api key, all you need to do is log back into our staging environment at http://api.staging.cleartrip.com and click on the profile tab where you will find links to help identify your key.

Need to top up your deposit account?

Follow the same process to top up your deposit account as well.

Go to top