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.
Custom Security Info Fields¶
The Custom Security Info Field Endpoint is used to obtain information about one or more custom security.
Note
Full list of fields can be found in the Reference Guide
Request Info¶
Request Method |
GET |
URL |
/api/v3/custom_securities/ |
Request Parameters¶
Parameter |
Required |
Description |
---|---|---|
security_id[s] |
Y |
The security id (e.g. ‘Y:1234’) for a custom security, or a comma separated list of security ids |
field[s] |
Y |
One or more comma separated custom security fields. (See list below) |
Note
There is a maximum of 100 custom securities per request. In addition, there is a maximum of 100 fields per request.
Examples¶
The following is an example successful response
Request URL
https://ycharts.com/api/v3/custom_securities/Y:1234/info/security_name,starting_level,description
Response
{
"meta": {
"status": "ok",
"url": "https://ycharts.com/api/v3/custom_securities/Y:1234/info/security_name,starting_level,description"
},
"response": {
"Y:1234": {
"meta": {
"status": "ok"
},
"results": {
"security_name": {
"data": "My Custom Security",
"meta": {
"status": "ok"
}
},
"starting_level": {
"data": 100000,
"meta": {
"status": "ok"
}
},
"description": {
"data": "Cash savings",
"meta": {
"status": "ok"
}
}
}
}
}
}
The following is an example successful multi custom security response
Request URL
https://ycharts.com/api/v3/custom_securities/Y:1234,Y:5678/info/security_name,starting_level
Response
{
"meta": {
"status": "ok",
"url": "https://ycharts.com/api/v3/custom_securities/Y:1234,Y:5678/info/security_name,starting_level"
},
"response": {
"Y:1234": {
"meta": {
"status": "ok"
},
"results": {
"security_name": {
"data": "My Custom Security",
"meta": {
"status": "ok"
}
},
"starting_level": {
"data": 100000,
"meta": {
"status": "ok"
}
}
}
},
"Y:5678": {
"meta": {
"status": "ok"
},
"results": {
"security_name": {
"data": "My Other Custom Security",
"meta": {
"status": "ok"
}
},
"starting_level": {
"data": 200000,
"meta": {
"status": "ok"
}
}
}
}
}
}
The following is an example incorrect request, which requests a custom security Y:0000 that does not exist
Request URL
https://ycharts.com/api/v3/custom_securities/Y:0000/info/security_name,starting_level
Response
{
"meta": {
"status": "ok",
"url": "https://ycharts.com/api/v3/custom_securities/Y:0000/info/security_name,starting_level"
},
"response": {
"Y:0000": {
"meta": {
"error_code": 404,
"error_message": "Symbol Not Found.",
"status": "error"
}
}
}
}
The following is an example of an incorrect request that requests info fields that do not exist
Request URL
https://ycharts.com/api/v3/custom_securities/Y:1234/info/fake_field_one,fake_field_two
Response
{
"meta": {
"status": "ok",
"url": "https://ycharts.com/api/v3/custom_securities/Y:1234/info/fake_field_one,fake_field_two"
},
"response": {
"Y:1234": {
"meta": {
"status": "ok"
},
"results": {
"fake_field_one": {
"meta": {
"error_code": 404,
"error_message": "Info Field Not Found.",
"status": "error"
}
},
"fake_field_two": {
"meta": {
"error_code": 404,
"error_message": "Info Field Not Found.",
"status": "error"
}
}
}
}
}
}