All of our API requests can be minified or pretty-printed.
By default, the Open Exchange Rates API returns responses in human-readable (pretty-printed) format, with indentation and line breaks.
If you prefer to minify your API responses to save bandwidth, you can use the prettyprint
query parameter with any valid API route.
The data will be returned with unnecessary whitespace removed, but otherwise exactly the same.
Example Query
Request:
https://openexchangerates.org/api/latest.json
?app_id=[[app:app_id]]
&prettyprint=0
$.get('https://openexchangerates.org/api/latest.json', {app_id: '[[app:app_id]]', prettyprint: 0}, function(data) {
console.log(data);
});
Response:
{"disclaimer": "[...]","license":"[...]","timestamp":1453623028,"base":"USD","rates":{"AED":3.67289,"AFN":68.580001,"ALL":127.189901,/* ... */}}
Please note: because the default value is
1
('true'), you need to specifyprettyprint=0
to receive minified responses.