{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","params":[],"results":{"codes":[]},"settings":""},"next":{"description":"","pages":[]},"title":"Minified Response ('prettyprint')","type":"basic","slug":"prettyprint","excerpt":"All of our API requests can be minified or pretty-printed.","body":"By default, the Open Exchange Rates API returns responses in human-readable (pretty-printed) format, with indentation and line breaks. \n\nIf you prefer to minify your API responses to save bandwidth, you can use the `prettyprint` query parameter with any valid API route. \n\nThe data will be returned with unnecessary whitespace removed, but otherwise exactly the same.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Example Query\"\n}\n[/block]\n**Request:** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"https://openexchangerates.org/api/latest.json\\n    ?app_id=[[app:app_id]]\\n    &prettyprint=0\\n\",\n      \"language\": \"http\"\n    },\n    {\n      \"code\": \"$.get('https://openexchangerates.org/api/latest.json', {app_id: '[[app:app_id]]', prettyprint: 0}, function(data) {\\n    console.log(data);\\n});\",\n      \"language\": \"javascript\",\n      \"name\": \"jQuery\"\n    }\n  ]\n}\n[/block]\n**Response: **\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\\"disclaimer\\\": \\\"[...]\\\",\\\"license\\\":\\\"[...]\\\",\\\"timestamp\\\":1453623028,\\\"base\\\":\\\"USD\\\",\\\"rates\\\":{\\\"AED\\\":3.67289,\\\"AFN\\\":68.580001,\\\"ALL\\\":127.189901,/* ... */}}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"Please note: because the default value is `1` ('true'), you need to specify `prettyprint=0` to receive minified responses.\"\n}\n[/block]","updates":["57a318e6bc062f0e00191832"],"order":4,"isReference":true,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"56a489ae9093960d00f9ab31","user":"5531215e29603d2300011341","category":{"sync":{"isSync":false,"url":""},"pages":["566b5afcec4a320d00a8ca76","566b63213d25d00d0066b00a","56a47942e5e9190d00ad6200","56a480315fb2530d00421b75","56a489ae9093960d00f9ab31"],"title":"Extra Parameters","slug":"extra-parameters","order":2,"from_sync":false,"reference":true,"_id":"566b59110506f40d0034f148","__v":5,"project":"55312174c68f493900aebb3f","version":"55312174c68f493900aebb42","createdAt":"2015-12-11T23:15:29.864Z"},"createdAt":"2016-01-24T08:22:06.881Z","version":{"version":"0.7","version_clean":"0.7.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["55312175c68f493900aebb43","566b431d03b4b20d00d02c3a","566b58f212bc0517005d3068","566b59110506f40d0034f148","566b7cc94d1a4d0d00801c00","566b82d130cdb417008d217d","566b855b4d1a4d0d00801c04","566b856f03870a0d008ee7a7","566c42d2f0a5dc0d009acbab","566c443d85dc790d0062c134"],"_id":"55312174c68f493900aebb42","project":"55312174c68f493900aebb3f","releaseDate":"2015-04-17T15:06:28.598Z","__v":10,"createdAt":"2015-04-17T15:06:28.598Z"},"project":"55312174c68f493900aebb3f","__v":12,"githubsync":"","parentDoc":null}

Minified Response ('prettyprint')

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. [block:api-header] { "type": "basic", "title": "Example Query" } [/block] **Request:** [block:code] { "codes": [ { "code": "https://openexchangerates.org/api/latest.json\n ?app_id=[[app:app_id]]\n &prettyprint=0\n", "language": "http" }, { "code": "$.get('https://openexchangerates.org/api/latest.json', {app_id: '[[app:app_id]]', prettyprint: 0}, function(data) {\n console.log(data);\n});", "language": "javascript", "name": "jQuery" } ] } [/block] **Response: ** [block:code] { "codes": [ { "code": "{\"disclaimer\": \"[...]\",\"license\":\"[...]\",\"timestamp\":1453623028,\"base\":\"USD\",\"rates\":{\"AED\":3.67289,\"AFN\":68.580001,\"ALL\":127.189901,/* ... */}}", "language": "json" } ] } [/block] [block:callout] { "type": "info", "body": "Please note: because the default value is `1` ('true'), you need to specify `prettyprint=0` to receive minified responses." } [/block]