Skip to content

Instantly share code, notes, and snippets.

@MikeRalphson
Created July 16, 2020 14:44
Show Gist options
  • Save MikeRalphson/77bb693d4cf9213909527b9cc4566609 to your computer and use it in GitHub Desktop.
Save MikeRalphson/77bb693d4cf9213909527b9cc4566609 to your computer and use it in GitHub Desktop.
OpenUV API converted from RAML 1.0 to OAS 3.0 (fixed)
openapi: 3.0.0
info:
title: OpenUV - Global Real-Time UV Index Forecast API
description: The missing minimalistic JSON real-time UV Index API for awesome
Developers, Innovators and Smart Home Enthusiasts
version: v1
servers:
- url: https://api.openuv.io/api/{version}
variables:
version:
default: v1
paths:
/uv:
description: Real-time UV Index
get:
description: Get real-time UV Index by location. Optional altitude, ozone level
and datetime could be provided.
parameters:
- name: lat
description: latitude, from -90.00 to 90.00
required: true
in: query
schema:
description: latitude, from -90.00 to 90.00
example: 78.67
type: number
- name: lng
description: longitude, from -180.00 to 180.00
required: true
in: query
schema:
description: longitude, from -180.00 to 180.00
example: 115.67
type: number
- name: alt
description: Altitude in meters, from 0 to 10000m, 0m by default. If provided
the altitude correction factor will be applied to clear sky sea
level UV Index value.
required: false
in: query
schema:
description: Altitude in meters, from 0 to 10000m, 0m by default. If provided
the altitude correction factor will be applied to clear sky sea
level UV Index value.
example: 1050
type: number
- name: ozone
description: Ozone in du (Dobson Units), from 100 to 550du, the latest forecast
from OMI dataset is used by default.
required: false
in: query
schema:
description: Ozone in du (Dobson Units), from 100 to 550du, the latest forecast
from OMI dataset is used by default.
example: 304.5
type: number
- name: dt
description: UTC datetime in ISO-8601 format, now by default. Use that parameter
to get UV Index Forecast for any point in time.
required: false
in: query
schema:
description: UTC datetime in ISO-8601 format, now by default. Use that parameter
to get UV Index Forecast for any point in time.
example: 2018-02-04T04:39:06.467Z
type: string
format: date-time
- name: x-access-token
description: This header is used to send data that contains your OpenUV API key
required: true
in: header
schema:
title: x-access-token
description: This header is used to send data that contains your OpenUV API key
type: string
responses:
"200":
description: ""
content:
application/json:
schema:
type: object
$ref: "#/components/schemas/uvIndexResult"
/forecast:
description: Hourly UV Index Forecast
get:
description: Get hourly UV Index Forecast by location and date. Optional
altitude, ozone level and datetime could be provided.
parameters:
- name: lat
description: latitude, from -90.00 to 90.00
required: true
in: query
schema:
description: latitude, from -90.00 to 90.00
example: 78.67
type: number
- name: lng
description: longitude, from -180.00 to 180.00
required: true
in: query
schema:
description: longitude, from -180.00 to 180.00
example: 115.67
type: number
- name: alt
description: Altitude in meters, from 0 to 10000m, 0m by default. If provided
the altitude correction factor will be applied to clear sky sea
level UV Index value.
required: false
in: query
schema:
description: Altitude in meters, from 0 to 10000m, 0m by default. If provided
the altitude correction factor will be applied to clear sky sea
level UV Index value.
example: 1050
type: number
- name: ozone
description: Ozone in du (Dobson Units), from 100 to 550du, the latest forecast
from OMI dataset is used by default.
required: false
in: query
schema:
description: Ozone in du (Dobson Units), from 100 to 550du, the latest forecast
from OMI dataset is used by default.
example: 304.5
type: number
- name: dt
description: UTC datetime in ISO-8601 format, now by default. Use that parameter
to get UV Index Forecast for any point in time.
required: false
in: query
schema:
description: UTC datetime in ISO-8601 format, now by default. Use that parameter
to get UV Index Forecast for any point in time.
example: 2018-02-04T04:39:06.467Z
type: string
format: date-time
- name: x-access-token
description: This header is used to send data that contains your OpenUV API key
required: true
in: header
schema:
title: x-access-token
description: This header is used to send data that contains your OpenUV API key
type: string
responses:
"200":
description: ""
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/forecastResult"
/protection:
description: Daily Protection Time
get:
description: Get daily protection time by location, UV Index from and UV Index
to with 10 minutes accuracy. Optional altitide and ozone level could be
provided.
parameters:
- name: lat
description: latitude, from -90.00 to 90.00
required: true
in: query
schema:
description: latitude, from -90.00 to 90.00
example: 78.67
type: number
- name: lng
description: longitude, from -180.00 to 180.00
required: true
in: query
schema:
description: longitude, from -180.00 to 180.00
example: 115.67
type: number
- name: from
description: UV Index from value for protection datetime lookup. From 0 to 40.
required: true
in: query
schema:
description: UV Index from value for protection datetime lookup. From 0 to 40.
example: 2.5
type: number
- name: to
description: UV Index to value for protection datetime lookup. From 0 to 40.
required: true
in: query
schema:
description: UV Index to value for protection datetime lookup. From 0 to 40.
example: 3.6
type: number
- name: alt
description: Altitude in meters, from 0 to 10000m, 0m by default. If provided
the altitude correction factor will be applied to clear sky sea
level UV Index value.
required: false
in: query
schema:
description: Altitude in meters, from 0 to 10000m, 0m by default. If provided
the altitude correction factor will be applied to clear sky sea
level UV Index value.
example: 1050
type: number
- name: ozone
description: Ozone in du (Dobson Units), from 100 to 550du, the latest forecast
from OMI dataset is used by default.
required: false
in: query
schema:
description: Ozone in du (Dobson Units), from 100 to 550du, the latest forecast
from OMI dataset is used by default.
example: 304.5
type: number
- name: x-access-token
description: This header is used to send data that contains your OpenUV API key
required: true
in: header
schema:
title: x-access-token
description: This header is used to send data that contains your OpenUV API key
type: string
responses:
"200":
description: ""
content:
application/json:
schema:
type: object
$ref: "#/components/schemas/protectionResult"
components:
schemas:
protectionResult:
title: result
type: object
required:
- uv
- uv_time
- uv_max
- uv_max_time
- ozone
- ozone_time
properties:
uv:
type: number
uv_time:
type: string
format: date-time-only
uv_max:
type: number
uv_max_time:
type: string
format: date-time-only
ozone:
type: number
ozone_time:
type: string
format: date-time-only
forecast:
type: object
required:
- uv
- uv_time
properties:
uv:
type: number
uv_time:
type: string
format: date-time-only
Error:
type: object
required:
- error
properties:
error:
type: string
uvIndexResult:
title: result
type: object
required:
- from_time
- from_uv
- to_time
- to_uv
properties:
from_time:
type: string
format: date-time-only
from_uv:
type: number
to_time:
type: string
format: date-time-only
to_uv:
type: number
forecastResult:
title: result
type: array
uniqueItems: true
items:
$ref: "#/components/schemas/forecast"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment