{"__v":4,"_id":"566b51a3f46dc90d009de82a","category":{"__v":5,"_id":"566b59110506f40d0034f148","pages":["566b5afcec4a320d00a8ca76","566b63213d25d00d0066b00a","56a47942e5e9190d00ad6200","56a480315fb2530d00421b75","56a489ae9093960d00f9ab31"],"project":"55312174c68f493900aebb3f","version":"55312174c68f493900aebb42","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-12-11T23:15:29.864Z","from_sync":false,"order":2,"slug":"extra-parameters","title":"Extra Parameters"},"project":"55312174c68f493900aebb3f","user":"5531215e29603d2300011341","version":{"__v":10,"_id":"55312174c68f493900aebb42","project":"55312174c68f493900aebb3f","createdAt":"2015-04-17T15:06:28.598Z","releaseDate":"2015-04-17T15:06:28.598Z","categories":["55312175c68f493900aebb43","566b431d03b4b20d00d02c3a","566b58f212bc0517005d3068","566b59110506f40d0034f148","566b7cc94d1a4d0d00801c00","566b82d130cdb417008d217d","566b855b4d1a4d0d00801c04","566b856f03870a0d008ee7a7","566c42d2f0a5dc0d009acbab","566c443d85dc790d0062c134"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"0.7.0","version":"0.7"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-12-11T22:43:47.409Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"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.\n\nThe `callback` value can be any valid JavaScript method name. \n\nThe entire JSON API response will be delivered wrapped in the requested callback function.\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Example JSONP Query\"\n}\n[/block]\n**Request URL:** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"https://openexchangerates.org/api/latest.json\\n    ?app_id=[[app:app_id]]\\n    &callback=myCallbackFunction\\n\",\n      \"language\": \"http\"\n    }\n  ]\n}\n[/block]\n**JSONP Response: **\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"myCallbackFunction({\\n    \\\"disclaimer\\\": \\\"[...]\\\",\\n    \\\"license\\\": \\\"[...]\\\",\\n    \\\"timestamp\\\": 1346874992,\\n    \\\"base\\\": \\\"USD\\\",\\n    \\\"rates\\\": {\\n        /* ... */\\n    }\\n})\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","excerpt":"All of our API routes/endpoints support JSONP callbacks.","slug":"jsonp-callbacks","type":"basic","title":"JSONP Callbacks"}

JSONP Callbacks

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. [block:api-header] { "type": "basic", "title": "Example JSONP Query" } [/block] **Request URL:** [block:code] { "codes": [ { "code": "https://openexchangerates.org/api/latest.json\n ?app_id=[[app:app_id]]\n &callback=myCallbackFunction\n", "language": "http" } ] } [/block] **JSONP Response: ** [block:code] { "codes": [ { "code": "myCallbackFunction({\n \"disclaimer\": \"[...]\",\n \"license\": \"[...]\",\n \"timestamp\": 1346874992,\n \"base\": \"USD\",\n \"rates\": {\n /* ... */\n }\n})", "language": "json" } ] } [/block]