Public API reference Response types

Response types

The API provides several response types, each designed to be useful in a variety of programming contexts:

  • XML: Easily parsed in many languages on many platforms. It is particularly easy to use in Desktop applications.
  • JSON: May be directly eval'd in Javascript, and also can be parsed in many languages.

How to Specify the Response Type

The request can specify the desired response type in either of two ways:

  • Accept HTTP header
  • (Deprecated) Query argument before method name with one of these values:
  • - xml
  • - json

The type argument, if present, overrides the Accept header.The Accept header works by specifying one or more acceptable media types and a "quality factor" for each. Our API selects the media type with the highest quality factor from the list below and uses the corresponding response type:

  • text/xml: XML response type
  • application/json: JSON response type

If more than one media type have equal quality factors, the API selects the first from the list. If none of the listed media types are acceptable, the XML response type is used.

Response Content Type

The response indicates the response type in the HTTP Content-Type header:

  • XML: Content-Type: text/xml;charset=utf-8
  • JSON: Content-Type: application/json