All of our API routes/endpoints support JSONP callbacks.
If you need to receive your API response wrapped inside a JSONP callback function, you can use the callback
query parameter with any valid API route. The data will be returned wrapped in the callback function you specify.
The callback
value can be any valid JavaScript method name.
The entire JSON API response will be delivered wrapped in the requested callback function.
Example JSONP Query
Request URL:
https://openexchangerates.org/api/latest.json
?app_id=[[app:app_id]]
&callback=myCallbackFunction
JSONP Response:
myCallbackFunction({
"disclaimer": "[...]",
"license": "[...]",
"timestamp": 1346874992,
"base": "USD",
"rates": {
/* ... */
}
})