evaluation

Responses and Errors Codes

The StockTwits API attempts to return appropriate HTTP status codes for every request. The following table describes the codes which may appear when working with the API:

Successful Response

All successful responses will return a 200 code status like this:

{
  "response": {
    "status": 200
  }
}

Error codes and responses

Error messages contain machine-parseable codes as well as additional descriptive error text. The text for an error message may change, the status codes will stay the same. Errors will look like this:

{
  "response": {
    "status": 400
  },
  "errors": [{
      "message": "SSL is required for all API requests"
  }]
}
{
  "response": {
    "status": 401
  },
  "errors": [{
    "message": "Authentication required"
  }]
}
{
  "response": {
    "status": 401
  },
  "errors": [{
    "message": "Stream required authentication"
  }]
}
{
  "response": {
    "status": 401
  },
  "errors": [{
    "message": "Account suspended"
  }]
}
{
  "response": {
    "status": 422
  },
  "errors": [{
    "message": "Duplicate messages within 30 minutes will not be posted."
  }]
}
{
  "response": {
    "status": 422
  },
  "errors": [{
    "message": "Body can't be blank"
  }]
}
{
  "response": {
    "status": 422
  },
  "errors": [{
    "message": "You can't like your own messages."
  }]
}
{
  "response": {
    "status": 429
  },
  "errors": [{
    "message": "Rate limit exceeded. Client may not make more than N requests an hour."
  }]
}