{"info":{"_postman_id":"0c102ce6-6f37-4748-b0bc-c054d99488b8","name":"API documentation","description":"<html><head></head><body><h1 id=\"introduction\">📄 Introduction</h1>\n<hr>\n<p>The Sunsethue API provides API products, tools, and resources that enable you to access and use Sunsethue's data products in your applications and projects.</p>\n<h2 id=\"getting-started-guide\"><strong>Getting started guide</strong></h2>\n<p>Steps to start using the Sunsethue API:</p>\n<ul>\n<li><p>Sign up for the API on <a href=\"https://sunsethue.com/dev-api\">sunsethue.com/dev-api</a></p>\n</li>\n<li><p>Generate an API key in the API portal <a href=\"https://sunsethue.com/dev-api\">sunsethue.com/dev-api/portal</a></p>\n</li>\n<li><p>Consult your daily request quota, you cannot go over the daily request quota on a free account. Be aware that the number of credits used differ per endpoint.</p>\n</li>\n</ul>\n<h2 id=\"authentication\">Authentication</h2>\n<p>The Sunsethue API uses API keys for authentication. You can generate a Sunsthue API key in the <a href=\"https://sunsethue.com/dev-api/portal\">API portal</a>.</p>\n<p>You must include your API key in every request you make to the Sunsethue API. The key can be passed in two ways:</p>\n<ul>\n<li><p>Pass the API key in the header of the HTTP request using the <code>x-api-key</code> property</p>\n</li>\n<li><p>Pass the API key as an argument (<code>key={your_key}</code>) in the URL of the request</p>\n</li>\n</ul>\n<p><em>Be careful with exposing the API key to the frontend of your application, as it can be accessed and stolen by malicious actors.</em></p>\n<p><strong>Generate a key</strong><br>If you do not have an API key yet, you can click \"generate key\" to generate a random API key. Make sure to store this key securely as it cannot be viewed again. Every account is limited to one API key.</p>\n<p><strong>Delete a key</strong><br>To delete your API key, click \"delete key\". This can only be done if you have an active API key. On deletion, the API key will stop working instantly.</p>\n<p><strong>Regenerating a key</strong><br>To generate a new key, delete your existing key and generate a new key.</p>\n<h3 id=\"error-responses\">Error responses</h3>\n<p>If your request fails, an error response is returned. The returned object contains a <code>status</code> field with</p>\n<ul>\n<li><p><code>400</code>: user error</p>\n</li>\n<li><p><code>500</code>: server error</p>\n</li>\n</ul>\n<p>The <code>code</code> field and <code>message</code> contain more information about the error. If you need help, please contact <a href=\"https://mailto:tropoflow@gmail.com\">tropoflow@gmail.com</a>, and include your request URL and the error <code>code</code>.</p>\n<p>Example error response:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  status: 400,\n  code: 204,\n  message: \"Exceeded daily quota\"\n}\n\n</code></pre>\n<h3 id=\"need-some-help\"><strong>Need some help?</strong></h3>\n<p>In case of issues with the Sunsethue API, contact me at <a href=\"https://mailto:tropoflow@gmail.com\">tropoflow@gmail.com</a></p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"📄 Introduction","slug":"introduction"}],"owner":"39964523","collectionId":"0c102ce6-6f37-4748-b0bc-c054d99488b8","publishedId":"2sAYBUDY4W","public":true,"customColor":{"top-bar":"fffdff","right-sidebar":"303030","highlight":"ca6acd"},"publishDate":"2024-11-24T16:05:46.000Z"},"item":[{"name":"Sunsethue","item":[{"name":"event","id":"90613726-edcc-47d2-8b23-1b9c2c956bde","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://api.sunsethue.com/event?latitude={{latitude}}&longitude={{longitude}}&date={{date}}&type={{type}}&forecast={{forecast}}","description":"<p>The <code>event</code> endpoint is used to access the forecasted data for a single event. The event is defined by a <code>date</code>, <code>type</code> and <code>location</code>. The <code>date</code> should be in local time (not in UTC time).</p>\n<p>In case you only need the time, magic hours, and/or direction, you can set the <code>forecast</code> property to <code>false</code>. This will make sure <code>model_data</code> is always <code>false</code>, and as explained below, this will reduce the number of credits used.</p>\n<h3 id=\"credits\">Credits</h3>\n<p>The number of credits this API call adds to your daily total depends on <code>model_data</code>:</p>\n<ul>\n<li><p>If <code>model_data</code> is <code>false</code>: <code>1</code> credit per request</p>\n</li>\n<li><p>If <code>model_data</code> is <code>true</code>: <code>5</code> credits per request</p>\n</li>\n</ul>\n<h3 id=\"return-object\">Return object</h3>\n<p>The data is returned in json format.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Key</th>\n<th>Value type</th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>time</code></td>\n<td><code>datetime</code></td>\n<td>time of the request in <code>UTC</code></td>\n</tr>\n<tr>\n<td><code>location</code></td>\n<td><code>coordinates</code></td>\n<td>coordinates of the requested location</td>\n</tr>\n<tr>\n<td><code>grid_location</code></td>\n<td><code>coordinates</code></td>\n<td>coordinates of the grid cell where the <code>model_data</code> is retrieved from (coordinates of the upper left corner of the cell)</td>\n</tr>\n<tr>\n<td><code>data</code></td>\n<td><code>event_data</code></td>\n<td>data object as described above</td>\n</tr>\n</tbody>\n</table>\n</div><p>Whereby the <code>coordinates</code> object has a <code>latitude</code> and a <code>longitude</code> property.</p>\n","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"x-api-key"},{"key":"value","value":"{{key}}"}]},"isInherited":true,"source":{"_postman_id":"0c102ce6-6f37-4748-b0bc-c054d99488b8","id":"0c102ce6-6f37-4748-b0bc-c054d99488b8","name":"API documentation","type":"collection"}},"urlObject":{"path":["event"],"host":["https://api.sunsethue.com"],"query":[{"description":{"content":"<p>(Required) Latitude of the location (in WGS84)</p>\n","type":"text/plain"},"key":"latitude","value":"{{latitude}}"},{"description":{"content":"<p>(Required) Longitude of the location (in WGS84)</p>\n","type":"text/plain"},"key":"longitude","value":"{{longitude}}"},{"description":{"content":"<p>(Required) Date of the event (in yyyy-mm-dd) in local time</p>\n","type":"text/plain"},"key":"date","value":"{{date}}"},{"description":{"content":"<p>(Required) Type of the event (sunrise or sunset)</p>\n","type":"text/plain"},"key":"type","value":"{{type}}"},{"description":{"content":"<p>(Optional, default=true) Whether forecasts should be fetched</p>\n","type":"text/plain"},"key":"forecast","value":"{{forecast}}"}],"variable":[]}},"response":[{"id":"048b6d15-08a3-4f66-bd0e-1aa9d75f27c8","name":"default","originalRequest":{"method":"GET","header":[{"key":"x-api-key","value":"{{key}}","type":"text"}],"url":{"raw":"https://api.sunsethue.com/event?latitude=40.7&longitude=-74&date=2024-11-24&type=sunset","host":["https://api.sunsethue.com"],"path":["event"],"query":[{"key":"latitude","value":"40.7"},{"key":"longitude","value":"-74"},{"key":"date","value":"2024-11-24"},{"key":"type","value":"sunset"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"keep-alive"},{"key":"Content-Length","value":"428"},{"key":"Cache-Control","value":"private"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Etag","value":"W/\"1ac-RchXrMtw7Ko+3Z8MwKt+OcQdjCs\""},{"key":"Function-Execution-Id","value":"ml9txmy6vd5c"},{"key":"Server","value":"Google Frontend"},{"key":"Strict-Transport-Security","value":"max-age=31556926"},{"key":"X-Cloud-Trace-Context","value":"5bb163f08d9fba09c0e084c5e638d1d9"},{"key":"X-Country-Code","value":"US"},{"key":"X-Powered-By","value":"Express"},{"key":"X-Ratelimit-Limit","value":"100"},{"key":"X-Ratelimit-Remaining","value":"98"},{"key":"X-Ratelimit-Reset","value":"1732464543"},{"key":"Accept-Ranges","value":"bytes"},{"key":"Date","value":"Sun, 24 Nov 2024 16:08:58 GMT"},{"key":"X-Served-By","value":"cache-iad-kcgs7200103-IAD"},{"key":"X-Cache","value":"MISS"},{"key":"X-Cache-Hits","value":"0"},{"key":"X-Timer","value":"S1732464538.645192,VS0,VE491"},{"key":"Vary","value":"cookie,need-authorization, x-fh-requested-host, accept-encoding"},{"key":"alt-svc","value":"h3=\":443\";ma=86400,h3-29=\":443\";ma=86400,h3-27=\":443\";ma=86400"}],"cookie":[],"responseTime":null,"body":"{\n    \"time\": \"2024-11-24T16:08:57.906Z\",\n    \"location\": {\n        \"latitude\": 40.7,\n        \"longitude\": -74\n    },\n    \"grid_location\": {\n        \"latitude\": 41,\n        \"longitude\": -74\n    },\n    \"data\": {\n        \"type\": \"sunset\",\n        \"model_data\": true,\n        \"quality\": 0.34,\n        \"cloud_cover\": 0.19,\n        \"quality_text\": \"Fair\",\n        \"time\": \"2024-11-24T21:32:00.000Z\",\n        \"direction\": 243.1,\n        \"magics\": {\n            \"blue_hour\": [\n                \"2024-11-24T21:57:00.000Z\",\n                \"2024-11-24T22:10:00.000Z\"\n            ],\n            \"golden_hour\": [\n                \"2024-11-24T21:17:00.000Z\",\n                \"2024-11-24T21:51:00.000Z\"\n            ]\n        }\n    }\n}"},{"id":"9234929b-6123-420f-9724-da167ed9c443","name":"no_model_data","originalRequest":{"method":"GET","header":[{"key":"x-api-key","value":"{{key}}","type":"text"}],"url":{"raw":"https://api.sunsethue.com/event?latitude=50.4&longitude=-70&date=2024-11-30&type=sunrise","host":["https://api.sunsethue.com"],"path":["event"],"query":[{"key":"latitude","value":"50.4","description":"Latitude of the location (in WGS84)"},{"key":"longitude","value":"-70","description":"Longitude of the location (in WGS84)"},{"key":"date","value":"2024-11-30","description":"Date of the event (in yyyy-mm-dd)"},{"key":"type","value":"sunrise","description":"Type of the event (sunrise or sunset)"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"keep-alive"},{"key":"Content-Length","value":"376"},{"key":"Cache-Control","value":"private"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Etag","value":"W/\"178-uCjUgCXkOCAuC/fGaa1RwRikDM4\""},{"key":"Function-Execution-Id","value":"ml9tzvs4k52m"},{"key":"Server","value":"Google Frontend"},{"key":"Strict-Transport-Security","value":"max-age=31556926"},{"key":"X-Cloud-Trace-Context","value":"eb7645a7364e3bb3800de89e5cced8d4"},{"key":"X-Country-Code","value":"US"},{"key":"X-Powered-By","value":"Express"},{"key":"X-Ratelimit-Limit","value":"100"},{"key":"X-Ratelimit-Remaining","value":"97"},{"key":"X-Ratelimit-Reset","value":"1732458752"},{"key":"Accept-Ranges","value":"bytes"},{"key":"Date","value":"Sun, 24 Nov 2024 14:32:31 GMT"},{"key":"X-Served-By","value":"cache-iad-kcgs7200096-IAD"},{"key":"X-Cache","value":"MISS"},{"key":"X-Cache-Hits","value":"0"},{"key":"X-Timer","value":"S1732458751.218896,VS0,VE432"},{"key":"Vary","value":"cookie,need-authorization, x-fh-requested-host, accept-encoding"},{"key":"alt-svc","value":"h3=\":443\";ma=86400,h3-29=\":443\";ma=86400,h3-27=\":443\";ma=86400"}],"cookie":[],"responseTime":null,"body":"{\n    \"time\": \"2024-11-24T14:32:31.497Z\",\n    \"location\": {\n        \"latitude\": 50.4,\n        \"longitude\": -70\n    },\n    \"grid_location\": {\n        \"latitude\": 50.5,\n        \"longitude\": -70\n    },\n    \"data\": {\n        \"type\": \"sunrise\",\n        \"model_data\": false,\n        \"time\": \"2024-11-30T12:17:00.000Z\",\n        \"direction\": 124.2,\n        \"magics\": {\n            \"blue_hour\": [\n                \"2024-11-30T11:30:00.000Z\",\n                \"2024-11-30T11:46:00.000Z\"\n            ],\n            \"golden_hour\": [\n                \"2024-11-30T11:54:00.000Z\",\n                \"2024-11-30T12:38:00.000Z\"\n            ]\n        }\n    }\n}"}],"_postman_id":"90613726-edcc-47d2-8b23-1b9c2c956bde"},{"name":"forecast","id":"c9a81294-6467-470b-8f66-279e806790b8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://api.sunsethue.com/forecast?latitude={{latitude}}&longitude={{longitude}}&days={{days}}&type={{type}}&forecast={{forecast}}&timezone={{timezone}}","description":"<p>The <code>forecast</code> endpoint is used to access the forecasted data for multiple events at once. Without any optional parameeters, it returns both sunrise and sunset events for the coming <code>3</code> days.</p>\n<p>The events can be further filtered using the <code>days</code> and <code>type</code> parameters. This can influence the number of events returned.</p>\n<h3 id=\"credits\">Credits</h3>\n<p>The number of credits this API call adds to your daily total depends on the number of <code>events</code> and <code>model_data</code>:</p>\n<ul>\n<li><p>If <code>model_data</code> is <code>false</code>: <code>1</code> credit per request per <code>event</code></p>\n</li>\n<li><p>If <code>model_data</code> is <code>true</code>: <code>5</code> credits per request per <code>event</code></p>\n</li>\n</ul>\n<h3 id=\"return-object\">Return object</h3>\n<p>The data is returned in json format.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Key</th>\n<th>Value type</th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>time</code></td>\n<td><code>datetime</code></td>\n<td>time of the request in <code>UTC</code></td>\n</tr>\n<tr>\n<td><code>location</code></td>\n<td><code>coordinates</code></td>\n<td>coordinates of the requested location</td>\n</tr>\n<tr>\n<td><code>grid_location</code></td>\n<td><code>coordinates</code></td>\n<td>coordinates of the grid cell where the <code>model_data</code> is retrieved from</td>\n</tr>\n<tr>\n<td><code>data</code></td>\n<td><code>array</code> of <code>event_data</code></td>\n<td>array of <code>event data</code> objects as describe above, sorted on <code>datetime</code></td>\n</tr>\n</tbody>\n</table>\n</div><p>Whereby the <code>coordinates</code> object has a <code>latitude</code> and a <code>longitude</code> property.</p>\n","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"x-api-key"},{"key":"value","value":"{{key}}"}]},"isInherited":true,"source":{"_postman_id":"0c102ce6-6f37-4748-b0bc-c054d99488b8","id":"0c102ce6-6f37-4748-b0bc-c054d99488b8","name":"API documentation","type":"collection"}},"urlObject":{"path":["forecast"],"host":["https://api.sunsethue.com"],"query":[{"description":{"content":"<p>(Required) Latitude of the location (in WGS84)</p>\n","type":"text/plain"},"key":"latitude","value":"{{latitude}}"},{"description":{"content":"<p>(Required) Longitude of the location (in WGS84)</p>\n","type":"text/plain"},"key":"longitude","value":"{{longitude}}"},{"description":{"content":"<p>(Optional, default=3) Numbers of  forecast days (integer)</p>\n","type":"text/plain"},"key":"days","value":"{{days}}"},{"description":{"content":"<p>(Optional, default=both) Type of the events (sunrise or sunset)</p>\n","type":"text/plain"},"key":"type","value":"{{type}}"},{"description":{"content":"<p>(Optional, default=true) Whether forecasts should be fetched</p>\n","type":"text/plain"},"key":"forecast","value":"{{forecast}}"},{"description":{"content":"<p>(Optional, default=0) Timezone of the location to get the correct events when filtering by day (valid float)</p>\n","type":"text/plain"},"key":"timezone","value":"{{timezone}}"}],"variable":[]}},"response":[{"id":"f34f5f56-ae49-4b02-a5c9-35155c162cbe","name":"default","originalRequest":{"method":"GET","header":[{"key":"x-api-key","value":"{{key}}","type":"text"}],"url":{"raw":"https://api.sunsethue.com/forecast?latitude=-21.83&longitude=55","host":["https://api.sunsethue.com"],"path":["forecast"],"query":[{"key":"latitude","value":"-21.83"},{"key":"longitude","value":"55"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"keep-alive"},{"key":"Content-Length","value":"1901"},{"key":"Cache-Control","value":"private"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Etag","value":"W/\"76d-3SrnUbHEQOYMhvcm+sAzK/wnMoY\""},{"key":"Function-Execution-Id","value":"ml9thmud76hz"},{"key":"Server","value":"Google Frontend"},{"key":"Strict-Transport-Security","value":"max-age=31556926"},{"key":"X-Cloud-Trace-Context","value":"086b3582aefc4ac6764ef8b45854617f"},{"key":"X-Country-Code","value":"US"},{"key":"X-Powered-By","value":"Express"},{"key":"X-Ratelimit-Limit","value":"100"},{"key":"X-Ratelimit-Remaining","value":"96"},{"key":"X-Ratelimit-Reset","value":"1732463649"},{"key":"Accept-Ranges","value":"bytes"},{"key":"Date","value":"Sun, 24 Nov 2024 15:54:07 GMT"},{"key":"X-Served-By","value":"cache-iad-kcgs7200125-IAD"},{"key":"X-Cache","value":"MISS"},{"key":"X-Cache-Hits","value":"0"},{"key":"X-Timer","value":"S1732463646.442525,VS0,VE1090"},{"key":"Vary","value":"cookie,need-authorization, x-fh-requested-host, accept-encoding"},{"key":"alt-svc","value":"h3=\":443\";ma=86400,h3-29=\":443\";ma=86400,h3-27=\":443\";ma=86400"}],"cookie":[],"responseTime":null,"body":"{\n    \"time\": \"2024-11-24T15:54:07.311Z\",\n    \"location\": {\n        \"latitude\": -21.83,\n        \"longitude\": 55\n    },\n    \"grid_location\": {\n        \"latitude\": -21.5,\n        \"longitude\": 55\n    },\n    \"data\": [\n        {\n            \"type\": \"sunrise\",\n            \"model_data\": true,\n            \"quality\": 0.34,\n            \"cloud_cover\": 0.05,\n            \"quality_text\": \"Fair\",\n            \"time\": \"2024-11-24T01:28:00.000Z\",\n            \"direction\": 112.6,\n            \"magics\": {\n                \"blue_hour\": [\n                    \"2024-11-24T00:57:00.000Z\",\n                    \"2024-11-24T01:08:00.000Z\"\n                ],\n                \"golden_hour\": [\n                    \"2024-11-24T01:14:00.000Z\",\n                    \"2024-11-24T01:40:00.000Z\"\n                ]\n            }\n        },\n        {\n            \"type\": \"sunset\",\n            \"model_data\": true,\n            \"quality\": 0.35,\n            \"cloud_cover\": 0.86,\n            \"quality_text\": \"Fair\",\n            \"time\": \"2024-11-24T14:45:00.000Z\",\n            \"direction\": 247.4,\n            \"magics\": {\n                \"blue_hour\": [\n                    \"2024-11-24T15:05:00.000Z\",\n                    \"2024-11-24T15:16:00.000Z\"\n                ],\n                \"golden_hour\": [\n                    \"2024-11-24T14:33:00.000Z\",\n                    \"2024-11-24T15:00:00.000Z\"\n                ]\n            }\n        },\n        {\n            \"type\": \"sunrise\",\n            \"model_data\": true,\n            \"quality\": 0.39,\n            \"cloud_cover\": 0.37,\n            \"quality_text\": \"Fair\",\n            \"time\": \"2024-11-25T01:28:00.000Z\",\n            \"direction\": 112.9,\n            \"magics\": {\n                \"blue_hour\": [\n                    \"2024-11-25T00:57:00.000Z\",\n                    \"2024-11-25T01:08:00.000Z\"\n                ],\n                \"golden_hour\": [\n                    \"2024-11-25T01:13:00.000Z\",\n                    \"2024-11-25T01:40:00.000Z\"\n                ]\n            }\n        },\n        {\n            \"type\": \"sunset\",\n            \"model_data\": true,\n            \"quality\": 0.41,\n            \"cloud_cover\": 0.43,\n            \"quality_text\": \"Good\",\n            \"time\": \"2024-11-25T14:46:00.000Z\",\n            \"direction\": 247.1,\n            \"magics\": {\n                \"blue_hour\": [\n                    \"2024-11-25T15:06:00.000Z\",\n                    \"2024-11-25T15:17:00.000Z\"\n                ],\n                \"golden_hour\": [\n                    \"2024-11-25T14:34:00.000Z\",\n                    \"2024-11-25T15:01:00.000Z\"\n                ]\n            }\n        },\n        {\n            \"type\": \"sunrise\",\n            \"model_data\": true,\n            \"quality\": 0.35,\n            \"cloud_cover\": 0.19,\n            \"quality_text\": \"Fair\",\n            \"time\": \"2024-11-26T01:28:00.000Z\",\n            \"direction\": 113.1,\n            \"magics\": {\n                \"blue_hour\": [\n                    \"2024-11-26T00:57:00.000Z\",\n                    \"2024-11-26T01:08:00.000Z\"\n                ],\n                \"golden_hour\": [\n                    \"2024-11-26T01:13:00.000Z\",\n                    \"2024-11-26T01:40:00.000Z\"\n                ]\n            }\n        },\n        {\n            \"type\": \"sunset\",\n            \"model_data\": true,\n            \"quality\": 0.32,\n            \"cloud_cover\": 0.55,\n            \"quality_text\": \"Fair\",\n            \"time\": \"2024-11-26T14:47:00.000Z\",\n            \"direction\": 246.9,\n            \"magics\": {\n                \"blue_hour\": [\n                    \"2024-11-26T15:07:00.000Z\",\n                    \"2024-11-26T15:18:00.000Z\"\n                ],\n                \"golden_hour\": [\n                    \"2024-11-26T14:35:00.000Z\",\n                    \"2024-11-26T15:01:00.000Z\"\n                ]\n            }\n        }\n    ]\n}"},{"id":"e6c93d6e-d7dc-4ee4-a299-13cac03a16ab","name":"optional_params","originalRequest":{"method":"GET","header":[{"key":"x-api-key","value":"{{key}}","type":"text"}],"url":{"raw":"https://api.sunsethue.com/forecast?latitude=-21.83&longitude=55&days=2&type=sunset&timezone=-3","host":["https://api.sunsethue.com"],"path":["forecast"],"query":[{"key":"latitude","value":"-21.83"},{"key":"longitude","value":"55"},{"key":"days","value":"2"},{"key":"type","value":"sunset"},{"key":"timezone","value":"-3"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"keep-alive"},{"key":"Content-Length","value":"726"},{"key":"Cache-Control","value":"private"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Etag","value":"W/\"2d6-luSW4SMv4GBATKDwTQW6qszNiXg\""},{"key":"Function-Execution-Id","value":"ml9t8oedppc7"},{"key":"Server","value":"Google Frontend"},{"key":"Strict-Transport-Security","value":"max-age=31556926"},{"key":"X-Cloud-Trace-Context","value":"af699b7d7d0a688ae9d5ec7bb45190fc"},{"key":"X-Country-Code","value":"US"},{"key":"X-Powered-By","value":"Express"},{"key":"X-Ratelimit-Limit","value":"100"},{"key":"X-Ratelimit-Remaining","value":"94"},{"key":"X-Ratelimit-Reset","value":"1732463702"},{"key":"Accept-Ranges","value":"bytes"},{"key":"Date","value":"Sun, 24 Nov 2024 15:54:55 GMT"},{"key":"X-Served-By","value":"cache-iad-kcgs7200023-IAD"},{"key":"X-Cache","value":"MISS"},{"key":"X-Cache-Hits","value":"0"},{"key":"X-Timer","value":"S1732463695.440806,VS0,VE413"},{"key":"Vary","value":"cookie,need-authorization, x-fh-requested-host, accept-encoding"},{"key":"alt-svc","value":"h3=\":443\";ma=86400,h3-29=\":443\";ma=86400,h3-27=\":443\";ma=86400"}],"cookie":[],"responseTime":null,"body":"{\n    \"time\": \"2024-11-24T15:54:55.708Z\",\n    \"location\": {\n        \"latitude\": -21.83,\n        \"longitude\": 55\n    },\n    \"grid_location\": {\n        \"latitude\": -21.5,\n        \"longitude\": 55\n    },\n    \"data\": [\n        {\n            \"type\": \"sunset\",\n            \"model_data\": true,\n            \"quality\": 0.35,\n            \"cloud_cover\": 0.86,\n            \"quality_text\": \"Fair\",\n            \"time\": \"2024-11-24T14:45:00.000Z\",\n            \"direction\": 247.4,\n            \"magics\": {\n                \"blue_hour\": [\n                    \"2024-11-24T15:05:00.000Z\",\n                    \"2024-11-24T15:16:00.000Z\"\n                ],\n                \"golden_hour\": [\n                    \"2024-11-24T14:33:00.000Z\",\n                    \"2024-11-24T15:00:00.000Z\"\n                ]\n            }\n        },\n        {\n            \"type\": \"sunset\",\n            \"model_data\": true,\n            \"quality\": 0.41,\n            \"cloud_cover\": 0.43,\n            \"quality_text\": \"Good\",\n            \"time\": \"2024-11-25T14:46:00.000Z\",\n            \"direction\": 247.1,\n            \"magics\": {\n                \"blue_hour\": [\n                    \"2024-11-25T15:06:00.000Z\",\n                    \"2024-11-25T15:17:00.000Z\"\n                ],\n                \"golden_hour\": [\n                    \"2024-11-25T14:34:00.000Z\",\n                    \"2024-11-25T15:01:00.000Z\"\n                ]\n            }\n        }\n    ]\n}"},{"id":"ed6a0c77-df4a-4667-ab83-efc8340e2a04","name":"partially_no_model_data","originalRequest":{"method":"GET","header":[{"key":"x-api-key","value":"{{key}}","type":"text"}],"url":{"raw":"https://api.sunsethue.com/forecast?latitude=-21.83&longitude=55&days=5&type=sunset","host":["https://api.sunsethue.com"],"path":["forecast"],"query":[{"key":"latitude","value":"-21.83"},{"key":"longitude","value":"55"},{"key":"days","value":"5"},{"key":"type","value":"sunset"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"keep-alive"},{"key":"Content-Length","value":"1495"},{"key":"Cache-Control","value":"private"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Etag","value":"W/\"5d7-+qnpYTs8RqPfZ7jWSG4AZ6y6Us0\""},{"key":"Function-Execution-Id","value":"ml9t9c7ybd8o"},{"key":"Server","value":"Google Frontend"},{"key":"Strict-Transport-Security","value":"max-age=31556926"},{"key":"X-Cloud-Trace-Context","value":"e994642186a8d5e4c72b1f6fc4e5f72f;o=1"},{"key":"X-Country-Code","value":"US"},{"key":"X-Powered-By","value":"Express"},{"key":"X-Ratelimit-Limit","value":"100"},{"key":"X-Ratelimit-Remaining","value":"99"},{"key":"X-Ratelimit-Reset","value":"1732463778"},{"key":"Accept-Ranges","value":"bytes"},{"key":"Date","value":"Sun, 24 Nov 2024 15:56:09 GMT"},{"key":"X-Served-By","value":"cache-iad-kcgs7200024-IAD"},{"key":"X-Cache","value":"MISS"},{"key":"X-Cache-Hits","value":"0"},{"key":"X-Timer","value":"S1732463767.246186,VS0,VE2259"},{"key":"Vary","value":"cookie,need-authorization, x-fh-requested-host, accept-encoding"},{"key":"alt-svc","value":"h3=\":443\";ma=86400,h3-29=\":443\";ma=86400,h3-27=\":443\";ma=86400"}],"cookie":[],"responseTime":null,"body":"{\n    \"time\": \"2024-11-24T15:56:09.199Z\",\n    \"location\": {\n        \"latitude\": -21.83,\n        \"longitude\": 55\n    },\n    \"grid_location\": {\n        \"latitude\": -21.5,\n        \"longitude\": 55\n    },\n    \"data\": [\n        {\n            \"type\": \"sunset\",\n            \"model_data\": true,\n            \"quality\": 0.35,\n            \"cloud_cover\": 0.86,\n            \"quality_text\": \"Fair\",\n            \"time\": \"2024-11-24T14:45:00.000Z\",\n            \"direction\": 247.4,\n            \"magics\": {\n                \"blue_hour\": [\n                    \"2024-11-24T15:05:00.000Z\",\n                    \"2024-11-24T15:16:00.000Z\"\n                ],\n                \"golden_hour\": [\n                    \"2024-11-24T14:33:00.000Z\",\n                    \"2024-11-24T15:00:00.000Z\"\n                ]\n            }\n        },\n        {\n            \"type\": \"sunset\",\n            \"model_data\": true,\n            \"quality\": 0.41,\n            \"cloud_cover\": 0.43,\n            \"quality_text\": \"Good\",\n            \"time\": \"2024-11-25T14:46:00.000Z\",\n            \"direction\": 247.1,\n            \"magics\": {\n                \"blue_hour\": [\n                    \"2024-11-25T15:06:00.000Z\",\n                    \"2024-11-25T15:17:00.000Z\"\n                ],\n                \"golden_hour\": [\n                    \"2024-11-25T14:34:00.000Z\",\n                    \"2024-11-25T15:01:00.000Z\"\n                ]\n            }\n        },\n        {\n            \"type\": \"sunset\",\n            \"model_data\": true,\n            \"quality\": 0.32,\n            \"cloud_cover\": 0.55,\n            \"quality_text\": \"Fair\",\n            \"time\": \"2024-11-26T14:47:00.000Z\",\n            \"direction\": 246.9,\n            \"magics\": {\n                \"blue_hour\": [\n                    \"2024-11-26T15:07:00.000Z\",\n                    \"2024-11-26T15:18:00.000Z\"\n                ],\n                \"golden_hour\": [\n                    \"2024-11-26T14:35:00.000Z\",\n                    \"2024-11-26T15:01:00.000Z\"\n                ]\n            }\n        },\n        {\n            \"type\": \"sunset\",\n            \"model_data\": false,\n            \"time\": \"2024-11-27T14:47:00.000Z\",\n            \"direction\": 246.7,\n            \"magics\": {\n                \"blue_hour\": [\n                    \"2024-11-27T15:08:00.000Z\",\n                    \"2024-11-27T15:19:00.000Z\"\n                ],\n                \"golden_hour\": [\n                    \"2024-11-27T14:35:00.000Z\",\n                    \"2024-11-27T15:02:00.000Z\"\n                ]\n            }\n        },\n        {\n            \"type\": \"sunset\",\n            \"model_data\": false,\n            \"time\": \"2024-11-28T14:48:00.000Z\",\n            \"direction\": 246.5,\n            \"magics\": {\n                \"blue_hour\": [\n                    \"2024-11-28T15:08:00.000Z\",\n                    \"2024-11-28T15:19:00.000Z\"\n                ],\n                \"golden_hour\": [\n                    \"2024-11-28T14:36:00.000Z\",\n                    \"2024-11-28T15:03:00.000Z\"\n                ]\n            }\n        }\n    ]\n}"}],"_postman_id":"c9a81294-6467-470b-8f66-279e806790b8"}],"id":"66952111-8064-4da3-aec4-5327735fb781","description":"<p>The <code>sunsethue</code> endpoints give access to the core feature of the Sunsethue API: the sunrise and sunset forecasts. There are two endpoints you can access:</p>\n<ul>\n<li><p><code>/event</code> to access Sunsethue's forecast and all relevant metadata for a single event</p>\n</li>\n<li><p><code>/forecast</code> to access multiple events</p>\n</li>\n</ul>\n<h3 id=\"technical-details\">Technical details</h3>\n<p><em>The technical details about the Sunsethue model are subject to change. Changes will not affect the structure of the API.</em></p>\n<ul>\n<li><p>Data source: <a href=\"https://www.dwd.de/EN/ourservices/nwp_forecast_data/nwp_forecast_data.html\">ICON</a> (DWD)</p>\n</li>\n<li><p>Resolution: <code>0.5° x 0.5°</code></p>\n</li>\n<li><p>Runs: <code>00z, 06z, 12z, 18z</code> (daily at resp. <code>05:40, 10:20, 16:40, 22:20 UTC</code>)</p>\n</li>\n<li><p>Timestep spacing <code>2h</code></p>\n</li>\n<li><p>Interpolation: only between timesteps</p>\n</li>\n<li><p>Forecast horizon: <code>78h</code> (<code>06z, 18z</code> only update first <code>28h</code>)</p>\n</li>\n<li><p>Data retention: <code>7 days</code></p>\n</li>\n</ul>\n<h3 id=\"what-is-an-event\">What is an event?</h3>\n<p>An <code>event</code> is a single sunrise or sunset for a single location and a given date. Every <code>event</code> consists of a json object <code>event_data</code> that contains all relevant data:</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Key</th>\n<th><strong>Value type</strong></th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>type</code></td>\n<td><code>sunrise</code> or <code>sunset</code></td>\n<td>the type of the event</td>\n</tr>\n<tr>\n<td><code>model_data</code></td>\n<td><code>boolean</code></td>\n<td><code>true</code> if there is a Sunsethue forecast for this event</td>\n</tr>\n<tr>\n<td><code>quality</code></td>\n<td><code>float</code> between <code>0</code> and <code>1</code> inclusive</td>\n<td>the forecasted quality of the event</td>\n</tr>\n<tr>\n<td><code>quality_text</code></td>\n<td><code>poor</code>, <code>fair</code>, <code>good</code>, <code>great</code> or <code>excellent</code></td>\n<td>the forecasted quality category of the event</td>\n</tr>\n<tr>\n<td><code>cloud_cover</code></td>\n<td><code>float</code> between <code>0</code> and <code>1</code> inclusive</td>\n<td>the forecasted cloud cover during the event</td>\n</tr>\n<tr>\n<td><code>time</code></td>\n<td><code>datetime</code></td>\n<td>the date and time of the event (i.e. time of sunrise or sunset) in <code>UTC</code></td>\n</tr>\n<tr>\n<td><code>direction</code></td>\n<td><code>float</code> between <code>0</code> and <code>360</code></td>\n<td>the direction of the event in degrees</td>\n</tr>\n<tr>\n<td><code>magics</code></td>\n<td><code>magics</code> object</td>\n<td>object containing information about magic hours</td>\n</tr>\n</tbody>\n</table>\n</div><p><code>quality</code>, <code>quality_text</code> and <code>cloud_cover</code> will only be present if <code>model_data=true</code>.</p>\n<hr />\n<p><strong>When is there</strong> <strong><code>model_data</code></strong>?</p>\n<p>Since not all properties of the <code>event</code> object are present if <code>model_data</code> is <code>false</code> it is useful to know when there will be no <code>model_data</code>?</p>\n<p>Sunsethue forecasts are made for up to three days in the future. They are updated every day at <code>8-9 UTC</code> and<code>18-19 UTC</code>.The last forecasts are stored for <code>7 days</code>. So data can be accessed between seven days in the past and three days in the future.</p>\n<p>Sunsethue forecasts are only available for locations between <code>55°S</code> and <code>70°N</code>.</p>\n<p>Lastly, the <code>model_data</code> could be <code>false</code> due to issues at Sunsethue or the weather data provider.</p>\n<hr />\n<p><strong>Defining</strong> <strong><code>quality_text</code></strong></p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong><code>quality_text</code></strong></th>\n<th><strong><code>quality</code></strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>poor</code></td>\n<td><code>0.00</code> to <code>0.20</code></td>\n</tr>\n<tr>\n<td><code>fair</code></td>\n<td><code>0.21</code> to <code>0.40</code></td>\n</tr>\n<tr>\n<td><code>good</code></td>\n<td><code>0.41</code> to <code>0.60</code></td>\n</tr>\n<tr>\n<td><code>great</code></td>\n<td><code>0.61</code> to <code>0.80</code></td>\n</tr>\n<tr>\n<td><code>excellent</code></td>\n<td><code>0.81</code> to <code>1.00</code></td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<p><strong>Defining</strong> <strong><code>magics</code></strong> <strong>object</strong></p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Key</th>\n<th><strong>Value type</strong></th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>blue_hour</code></td>\n<td><code>array of datetimes</code></td>\n<td>an array with the start and end of the blue hour in <code>UTC</code></td>\n</tr>\n<tr>\n<td><code>golden_hour</code></td>\n<td><code>array of datetimes</code></td>\n<td>an array with the start and end of the golden hour in <code>UTC</code></td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h3 id=\"credits\">Credits</h3>\n<p>The number of credits per request to the Sunsethue endpoints depend on the number of events retrieved and on <code>model_data</code>.</p>\n<ul>\n<li><p>If <code>model_data</code> is <code>false</code>: <code>1</code> credit per <code>event</code></p>\n</li>\n<li><p>If <code>model_data</code> is <code>true</code>: <code>5</code> credits per <code>event</code></p>\n</li>\n</ul>\n<p>Example: if you make a request using the <code>/forecast</code> endpoint for <code>6 events</code>, for which <code>4</code> have <code>model_data</code>, <code>(4 x 5) + (2 x 1) = 22</code> credits are added to your daily total.</p>\n","_postman_id":"66952111-8064-4da3-aec4-5327735fb781","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"x-api-key"},{"key":"value","value":"{{key}}"}]},"isInherited":true,"source":{"_postman_id":"0c102ce6-6f37-4748-b0bc-c054d99488b8","id":"0c102ce6-6f37-4748-b0bc-c054d99488b8","name":"API documentation","type":"collection"}}}],"auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"x-api-key"},{"key":"value","value":"{{key}}"}]}},"event":[{"listen":"prerequest","script":{"id":"eb62384d-b549-46b6-811a-3349df2adc83","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"9780335f-0e68-4231-a860-188eccd5617c","type":"text/javascript","exec":[""]}}],"variable":[{"key":"baseURL","value":"https://api.sunsethue.com","type":"default"}]}