Warning

The YCharts API is available to our API customers for their internal use only. Any redistribution or commercial use of data from the API is strictly prohibited without prior written consent from YCharts. For more details on our API’s capabilities and pricing please contact sales@ycharts.com or call (866) 965-7552.

Response Structure

All responses are returned in the JSON format. The top-level object returned in the response will contain two keys, meta and response. The meta object contains information about the request, and the response object contains the response.

Meta Structure

Every level of the response will contain at least a meta key. The meta object will contain information about the current level of the response. In addition, every meta object will contain a status and url key.

Possible Meta Keys

Always Present

Type

status

Y

String

url

Y

String

error_code

N

Number

error_message

N

String

Example Responses

Successful Response

The following is an example successful response.

{
    "meta": {
        "status": "ok",
        "url": "https://api.ycharts.com/v3/companies/AAPL/points/price"
    },
    "response": {
        "AAPL": {
            "meta": {
                "status": "ok"
            },
            "results": {
                "price": {
                    "data": [
                        "2015-02-26",
                        130.42
                    ],
                    "meta": {
                        "status": "ok"
                    }
                }
            }
        }
    }
}

Error Response

The following is an example unsuccessful response.

{
    "meta": {
        "status": "error",
        "url": "https://ycharts.com/api/v3/companies/AAPL,MSFT/dividends?start_date=2015-01-01&end_date=bad-date",
        "error_code": 400,
        "error_message": "Invalid end_date format."
    },
    "response": {}
}