openapi: 3.2.0
info:
title: Dtn Endpoints API
x-refined-note:
- x-logo differs across the merged source definitions and was not carried
version: '1.0'
description: 'Operations tagged Endpoints across 10 of this provider''s published API definitions: dtn-agency-bulletin-api-openapi.json, dtn-agency-bulletin-websocket-api-openapi.json, dtn-astronomical-api-openapi.json, dtn-climatology-api-openapi.json, dtn-marine-weather-api-openapi.json, dtn-precipitation-api-openapi.json, dtn-probabilistic-api-openapi.json, dtn-renewables-api-openapi.json, dtn-soil-api-openapi.json, dtn-weather-conditions-api-openapi.json. Each path carries the servers of the definition it was published in.'
servers:
- url: https://wxbulletin.api.dtn.com
- url: http://wxbulletin-ws.api.dtn.com
- url: http://agency-bulletin-ws.prd.wx.zones.dtn.com
- url: https://astronomical.api.dtn.com
- url: https://climatology.api.dtn.com
- url: https://weather.api.dtn.com
- url: https://precipitation.api.dtn.com
- url: https://probabilistic.api.dtn.com
- url: https://renewables.api.dtn.com
- url: https://soil.api.dtn.com
tags:
- name: Endpoints
description: The the Agency Bulletin API (ABA) is designed around two major endpoints, each offering unique functionalities tailored to your diverse weather bulletin data needs. Whether you require forecast and historical data for a single location, data for multiple location/timestamp pairs, or the associated metadata, our API has got you covered.
paths:
/v2/bulletins:
get:
tags:
- Endpoints
summary: Bulletins
description: "```shell \nGET https://wxbulletin.api.dtn.com/v2/bulletins\n```\n\nThis endpoint returns the latest active weather bulletins from the requested national meteorological agency. \nIt is the primary source of information for real-time weather alerts and updates.\n\nUnderstanding and Utilizing Key Query Parameters:\n- **Country:** \nUse this parameter to access all active weather bulletins within a specific country. \nThis parameter accepts ISO 3166-1 alpha-2 codes.\nExample: country=US\n\n- **startTime:**\nThis parameter allows you to filter alerts sent from a specific date and time onward, \nreturning all subsequent alerts. It requires timestamps in ISO 8601 date-time format as specified in RFC 3339.\nExample: startTime=2022-11-25T00:00:00\n\n- **endTime:**\nUse this parameter to receive alerts up to a specific timestamp, \nfiltering out any alerts sent after this date and time. The expected format is ISO 8601 date-time as per RFC 3339.\nExample: endTime=2022-11-26T00:00:00\n\n- **excludeGeometry:**\nThis parameter is crucial and is set to false by default, meaning the response will include detailed geometry of the \npolygons corresponding to each active warning. This can be particularly useful for understanding the exact impacted \nareas or for visualizing warnings in GIS applications. However, be mindful that including this detailed information \nmight substantially increase the payload size when dealing with numerous active bulletins. \nIf you prefer to exclude the detailed geometry and reduce payload size, set this parameter to true.\n\nQuery Example: `https://wxbulletin.api.dtn.com/v2/bulletins?country=US&showTotal=true&agency=NWS&startTime=2023-09-25T12:45:00&endTime=2023-09-25T12:47:00`"
operationId: get_bulletins_v2_bulletins_get
parameters:
- description: 'Specify the country code of the alerts request. This is a required parameter. The reference for acceptable values is ISO 3166 two-letter codes (alpha-2). example: US'
required: false
schema:
type: string
title: Country
description: 'Specify the country code of the alerts request. This is a required parameter. The reference for acceptable values is ISO 3166 two-letter codes (alpha-2). example: US'
name: country
in: query
- description: 'Specify the language the language to use in the text values of the alert. Values should follow RFC 3066. example: en-US'
required: false
schema:
type: string
title: Language
description: 'Specify the language the language to use in the text values of the alert. Values should follow RFC 3066. example: en-US'
name: language
in: query
- description: 'Specify the agency of the alert request. example: NWS'
required: false
schema:
type: string
title: Agency
description: 'Specify the agency of the alert request. example: NWS'
name: agency
in: query
- description: 'Specify the sender of the alerts request. example: w-nws.webmaster@noaa.gov'
required: false
schema:
type: string
title: Sender
description: 'Specify the sender of the alerts request. example: w-nws.webmaster@noaa.gov'
name: sender
in: query
- description: 'When specified, the API will return only alerts that match the specified event types. example: Flood Warning'
required: false
schema:
items:
type: string
type: array
title: Event
description: 'When specified, the API will return only alerts that match the specified event types. example: Flood Warning'
name: event
in: query
- description: 'Specify the date and time alerts are sent. When set, all alerts sent from this timestamp are returned. ISO8601 date-time format specified int RFC 3339. example: 2022-11-25T00:00:00'
required: false
schema:
type: string
format: date-time
title: Starttime
description: 'Specify the date and time alerts are sent. When set, all alerts sent from this timestamp are returned. ISO8601 date-time format specified int RFC 3339. example: 2022-11-25T00:00:00'
name: startTime
in: query
- description: 'Specify the date and time alerts are sent. When set, all alerts sent until this timestamp are returned. ISO8601 date-time format specified int RFC 3339. example: 2022-11-26T00:00:00'
required: false
schema:
type: string
format: date-time
title: Endtime
description: 'Specify the date and time alerts are sent. When set, all alerts sent until this timestamp are returned. ISO8601 date-time format specified int RFC 3339. example: 2022-11-26T00:00:00'
name: endTime
in: query
- description: Specify whether or not to include the geojson geometry for each alert.
required: false
schema:
type: boolean
title: Excludegeometry
description: Specify whether or not to include the geojson geometry for each alert.
default: false
name: excludeGeometry
in: query
- description: Specify whether or not to include total number of alerts.
required: false
schema:
type: boolean
title: Showtotal
description: Specify whether or not to include total number of alerts.
default: false
name: showTotal
in: query
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/GeoJsonAlertResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
security:
- clientCredentials: []
servers:
- url: https://wxbulletin.api.dtn.com
/v2/metadata:
get:
tags:
- Endpoints
summary: Metadata
description: "```shell \nGET https://wxbulletin.api.dtn.com/v2/metadata\n```\nThis endpoint provides metadata from each national meteorological agency, \ndetailing what events are published and in which languages, allowing developers to understand the range and scope of \navailable bulletins.\n\nUnderstanding and Utilizing Key Query Parameters:\n\n- Access this endpoint to retrieve a comprehensive list of all available meteorological agencies, \nthe events they publish, and the languages they support. As we continuously integrate support for new agencies into \nthis API, this endpoint serves as an excellent resource to stay updated on the most recent agencies and \ntheir corresponding published events.\n- event: Use this parameter to pinpoint a particular event. It also aids in identifying which agencies \nbroadcast that specific event type.\n\nQuery Example: `https://wxbulletin.api.dtn.com/v2/metadata?country=US&event=Flash`"
operationId: get_metadata_v2_metadata_get
parameters:
- description: 'Specify the country of the event type example: US'
required: false
schema:
items:
type: string
type: array
title: Country
description: 'Specify the country of the event type example: US'
name: country
in: query
- description: 'Specify the agency of the event type example: NWS'
required: false
schema:
items:
type: string
type: array
title: Agency
description: 'Specify the agency of the event type example: NWS'
name: agency
in: query
- description: 'Specify the language of the event types follow RFC 3066. example: en-US'
required: false
schema:
items:
type: string
type: array
title: Language
description: 'Specify the language of the event types follow RFC 3066. example: en-US'
name: language
in: query
- description: 'When specified, the API allows filtering based on specific event types. This can be used to narrow down search result. example: event=flood would return events like Flash Flood Watch, Flood Warning, Flash Flood Statement, Severe Flood Warning'
required: false
schema:
items:
type: string
type: array
title: Event
description: 'When specified, the API allows filtering based on specific event types. This can be used to narrow down search result. example: event=flood would return events like Flash Flood Watch, Flood Warning, Flash Flood Statement, Severe Flood Warning'
name: event
in: query
- description: 'When specified, the API allows filtering based on specific dtnEvent. This can be used to narrow down search result. example: dtnEvent=Wind would return events like Brisk Wind Advisory, Extreme Wind Warning, Lake Wind Advisory, High Wind Warning'
required: false
schema:
items:
type: string
type: array
title: Dtnevent
description: 'When specified, the API allows filtering based on specific dtnEvent. This can be used to narrow down search result. example: dtnEvent=Wind would return events like Brisk Wind Advisory, Extreme Wind Warning, Lake Wind Advisory, High Wind Warning'
name: dtnEvent
in: query
- description: 'When specified, the API allows filtering based on specific dtnEventCode. This can be used to narrow down search result. example: dtnEventCode=1 would return events under Snow likeLake Effect Snow Watch, Lake Effect Snow Warning, Lake Effect Snow Advisory, Snow Squall Warning'
required: false
schema:
items:
type: string
type: array
title: Dtneventcode
description: 'When specified, the API allows filtering based on specific dtnEventCode. This can be used to narrow down search result. example: dtnEventCode=1 would return events under Snow likeLake Effect Snow Watch, Lake Effect Snow Warning, Lake Effect Snow Advisory, Snow Squall Warning'
name: dtnEventCode
in: query
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/MetadataResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
security:
- clientCredentials: []
servers:
- url: https://wxbulletin.api.dtn.com
/v2/metadata/dtn:
get:
tags:
- Endpoints
summary: Metadata/dtn
description: "```shell \nGET https://wxbulletin.api.dtn.com/v2/metadata/dtn\n```\nThis endpoint provides metadata of dtn events.\n\nUnderstanding and Utilizing Key Query Parameters:\n\n- Access this endpoint to retrieve a comprehensive list of all available dtn events. \n- dtnEvent: Use this parameter to pinpoint a particular dtn event.\n\nQuery Example: `https://wxbulletin.api.dtn.com/v2/metadata/dtn?dtnEvent=Snow`"
operationId: get_metadata_dtn_v2_metadata_dtn_get
parameters:
- description: 'Specify the event code of dtn event example: NWS'
required: false
schema:
items:
type: string
type: array
title: Dtneventcode
description: 'Specify the event code of dtn event example: NWS'
name: dtnEventCode
in: query
- description: 'Specify the event name of dtn event example: Low Temperature'
required: false
schema:
items:
type: string
type: array
title: Dtnevent
description: 'Specify the event name of dtn event example: Low Temperature'
name: dtnEvent
in: query
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/MetadataDTNResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
security:
- clientCredentials: []
servers:
- url: https://wxbulletin.api.dtn.com
/v1:
get:
tags:
- Endpoints
summary: Stream
description: "\n```shell \nGET wss://wxbulletin-ws.api.dtn.com/v1/\n```\n\nThis endpoint returns the latest active weather bulletins from the requested national meteorological agency. \nIt is the primary source of information for real-time weather alerts and updates.\n\nUnderstanding and Utilizing Key Query Parameters:\n- **country:** \nUse this parameter to access all active weather bulletins within a specific country. \nThis parameter accepts ISO 3166-1 alpha-2 codes. This parameter cannot be used with the `lat/lon/radius` or the `bbox` parameters.
\nExample: `country=US`\n\n- **lat**, **lon**:\nUse these parameters to access all active weather bulletins that intersect a point location in the map. When used with,\nthe `radius` parameter, the active bulletins intersecting a circle with the lat/lon at the center and the radius in\nkilometers will be returned. This combination cannot be used with the `country` or the `bbox` parameters.
\nExample: `lat=52.52&lon=13.40`, `lat=52.52&lon=13.40&radius=50` \n\n- **bbox**:\nUse this parameter to access all active weather bulletins that intersect a bounding box with the format `minLon,minLat,maxLon,maxLat`.\nThis combination cannot be used with the `country` or the `lat/lon/radius` parameters.
\nExample: `bbox=30.1,45.1,30.5,45.5`, `bbox=13.10,52.66,13.77,52.37`\n\n- **excludeGeometry:**\nThis parameter is crucial and is set to false by default, meaning the response will include detailed geometry of the \npolygons corresponding to each active warning. This can be particularly useful for understanding the exact impacted \nareas or for visualizing warnings in GIS applications. However, be mindful that including this detailed information \nmight substantially increase the payload size when dealing with numerous active bulletins. \nIf you prefer to exclude the detailed geometry and reduce payload size, set this parameter to true.
\nExample: `excludeGeometry=True`\n\nQuery Examples:
\n- `wss://wxbulletin-ws.api.dtn.com/v1?country=US&excludeGeometry=true`
\n- `wss://wxbulletin-ws.api.dtn.com/v1?lon=13.4&lat=52.52&radius=5.5`
\n- `wss://wxbulletin-ws.api.dtn.com/v1?bbox=13.10,52.66,13.77,52.37`
\n"
operationId: get_v1_stream
security:
- clientCredentials: []
parameters:
- name: country
in: query
required: true
schema:
title: country
description: 'Specify the country code of the alerts request. This is a required parameter. The reference for acceptable values is ISO 3166 two-letter codes (alpha-2). '
maxLength: 2
minLength: 2
pattern: ^[a-zA-Z]*$
examples:
- US
- DE
- CA
- AU
- FR
required: true
type: string
description: 'Specify the country code of the alerts request. This is a required parameter. The reference for acceptable values is ISO 3166 two-letter codes (alpha-2). '
- name: lat
in: query
required: false
schema:
title: latitude
description: The latitude in decimal degrees. When specified, it must be used together with the `lon` parameter. This parameter can also be used with the `radius` parameter. This parameter cannot be used with the `country` or the `bbox` parameters.
minimum: -90
maximum: 90
examples:
- 35.67
type: number
description: The latitude in decimal degrees. When specified, it must be used together with the `lon` parameter. This parameter can also be used with the `radius` parameter. This parameter cannot be used with the `country` or the `bbox` parameters.
- name: lon
in: query
required: false
schema:
title: longitude
description: The longitude in decimal degrees. When specified, it must be used together with the `lat` parameter. This parameter can also be used with the `radius` parameter. This parameter cannot be used with the `country` or the `bbox` parameters.
minimum: -180
maximum: 180
examples:
- 139.65
type: number
description: The longitude in decimal degrees. When specified, it must be used together with the `lat` parameter. This parameter can also be used with the `radius` parameter. This parameter cannot be used with the `country` or the `bbox` parameters.
- name: radius
in: query
required: false
schema:
title: radius
description: The radius in km. When specified, alerts intersecting the circle with the POINT(`lon`,`lat`) as the center will be returned.This parameter cannot be used with the `country` or the `bbox` parameters.
exclusiveMinimum: 0
maximum: 3000
examples:
- 10
- 15.5
- 30
- 50.25
type: number
description: The radius in km. When specified, alerts intersecting the circle with the POINT(`lon`,`lat`) as the center will be returned.This parameter cannot be used with the `country` or the `bbox` parameters.
- name: bbox
in: query
required: false
schema:
title: bbox
description: The bounding box coordinates in the format `minLon,minLat,maxLon,maxLat`. This parameter cannot be used with the `country` or the `lat/lon/radius` parameters.
examples:
- 30.1,45.1,30.5,45.5
- 13.10,52.66,13.77,52.37
type: array
items:
type: number
description: The bounding box coordinates in the format `minLon,minLat,maxLon,maxLat`. This parameter cannot be used with the `country` or the `lat/lon/radius` parameters.
- name: language
in: query
required: false
schema:
title: language
description: 'Specify the language to use in the text values of the alert. Values should follow RFC 3066. '
maxLength: 5
minLength: 5
pattern: ^[a-zA-Z]{2}-[a-zA-Z]{2}$
examples:
- en-US
- en-GB
- de-DE
- fr-FR
- en-AU
- en-CA
type: string
description: 'Specify the language to use in the text values of the alert. Values should follow RFC 3066. '
- name: agency
in: query
required: false
schema:
title: agency
description: 'Specify the agency of the alert request. '
maxLength: 20
minLength: 3
pattern: ^[a-zA-Z]*$
examples:
- NWS
- DWD
- BOM
- UKMO
- METEOALARM
- ENVCA
- UKENVA
type: string
description: 'Specify the agency of the alert request. '
- name: event
in: query
required: false
schema:
title: event
description: 'When specified, the API will return only alerts that match the specified event types. '
examples:
- Flood Warning
- Severe Thunderstorm Warning, Gale Warning
type: array
items:
type: string
description: 'When specified, the API will return only alerts that match the specified event types. '
- name: excludeGeometry
in: query
required: false
schema:
title: excludeGeometry
description: Specify whether or not to include the root geojson geometry for each alert.
default: false
examples:
- true
- false
type: boolean
description: Specify whether or not to include the root geojson geometry for each alert.
responses:
'101':
description: Successful Response
content:
application/json:
schema:
properties:
id:
type: string
title: id
description: The identifier of the alert message
agency:
type: string
title: agency
description: Agency issuing the alert
country:
type: string
title: country
description: Country code of the alert
type:
type: string
title: type
description: Type of the GeoJSON object
default: Feature
geometry:
anyOf:
- type: object
title: Geometry
description: Geometry of the alert area
properties:
properties:
identifier:
type: string
title: Identifier
description: The identifier of the alert message
sender:
type: string
title: Sender
description: The identifier of the sender of the alert message
sent:
type: string
format: date-time
title: Sent
description: The time and date of the origination of the alert message
status:
type: string
title: Status
description: The code denoting the appropriate handling of the alert message
msgType:
type: string
title: Msgtype
description: The code denoting the nature of the alert message
scope:
type: string
title: Scope
description: The code denoting the intended distribution of the alert message
code:
type: string
title: Code
description: The code denoting the special handling of the alert message
source:
type: string
title: Source
description: The text identifying the source of the alert message
updated:
type: string
format: date-time
title: Updated
description: Date when the alert was last updated
restriction:
type: string
title: Restriction
description: The text describing the rule for limiting distribution of the restricted alert message
addresses:
type: string
title: Addresses
description: The group listing of intended recipients of the alert message
note:
type: string
title: Note
description: The text describing the purpose or significance of the alert message
references:
type: string
title: References
description: The group listing identifying earlier message(s) referenced by alert message
info:
items:
properties:
event:
type: string
title: Event
description: The text denoting the type of the subject event of the alert message
eventCode:
items:
properties:
valueName:
type: string
title: Valuename
description: Value name
value:
type: string
title: Value
description: Actual value
type: object
required:
- valueName
- value
title: EventCode
type: array
title: Eventcode
description: A system- specific code identifying the event type of the alert message
category:
type: string
title: Category
description: The code denoting the category of the subject event of the alert message
language:
type: string
title: Language
description: The code denoting the language of the info sub- element of the alert message
urgency:
type: string
title: Urgency
description: The code denoting the urgency of the subject event of the alert message
severity:
type: string
title: Severity
description: The code denoting the severity of the subject event of the alert message
certainty:
type: string
title: Certainty
description: The code denoting the certainty of the subject event of the alert message
responseType:
type: string
title: Responsetype
description: The code denoting the type of action recommended for the target audience
effective:
type: string
format: date-time
title: Effective
description: The effective time of the information of the alert message
onset:
type: string
format: date-time
title: Onset
description: The expected time of the beginning of the subject event of the alert message
expires:
type: string
format: date-time
title: Expires
description: The expiry time of the information of the alert message
audience:
type: string
title: Audience
description: The text describing the intended audience of the alert message
senderName:
type: string
title: Sendername
description: The text naming the originator of the alert message
headline:
type: string
title: Headline
description: The text headline of the alert message
description:
type: string
title: Description
description: The text describing the subject event of the alert message
instruction:
type: string
title: Instruction
description: The text describing the recommended action to be taken by recipients of the alert message
web:
type: string
title: Web
description: The identifier of the hyperlink associating additional information with the alert message
contact:
type: string
title: Contact
description: The text describing the contact for follow-up and confirmation of the alert message
parameters:
items:
properties:
valueName:
type: string
title: Valuename
description: Value name
value:
type: string
title: Value
description: Actual value
type: object
required:
- valueName
- value
title: Parameters
type: array
title: Parameters
description: A system- specific additional parameter associated with the alert message
area:
items:
properties:
areaDesc:
type: string
title: Areadesc
description: The text describing the affected area of the alert message
polygon:
type: object
title: Polygon
description: The paired values of points defining a polygon that delineates the affected area of the alert message
circle:
type: string
title: Circle
description: The paired values of a point and radius delineating the affected area of the alert message
ceiling:
type: number
title: Ceiling
description: The maximum altitude of the affected area of the alert message
altitude:
type: number
title: Altitude
description: The specific or minimum altitude of the affected area of the alert message
geocodes:
items:
properties:
valueName:
type: string
title: valueName
description: Value name
value:
type: string
title: value
description: Actual value
type: object
required:
- valueName
- value
title: Geocode
type: array
title: Geocodes
description: The geographic code delineating the affected area of the alert message
type: object
required:
- areaDesc
title: GeoJsonAlertInfoArea
type: array
title: Area
description: The container for all component parts of the area sub-element of the info sub- element of the alert message
type: object
required:
- event
- category
- language
- urgency
- severity
- certainty
- expires
- area
title: GeoJsonAlertInfo
type: array
title: Info
description: Additional information about the alert
type: object
required:
- identifier
- sender
- sent
- status
- msgType
- scope
- updated
- info
title: GeoJsonAlertProperties
dtnInfo:
properties:
dtnMsgType:
type: string
title: Dtnmsgtype
description: Specifies the type of message generated by the DTN
dtnExpires:
type: string
format: date-time
title: Dtnexpires
description: Specifies the date and time when the information in the alert message is set to expire, as generated by the DTN. This timestamp indicates until when the alert information remains valid and relevant.
dtnEvent:
type: string
title: Dtnevent
description: 'Represents the type of event for which the alert message is generated within the DTN '
dtnEventCode:
type: string
title: Dtneventcode
description: Provides a code associated with the specific event type, as defined by DTN, for which the alert message is generated.
dtnDisclaimer:
type: string
title: Dtndisclaimer
description: Provides a disclaimer regarding the information included in the alert message.
type: object
required:
- dtnMsgType
- dtnExpires
- dtnEvent
- dtnEventCode
- dtnDisclaimer
title: GeoJsonAlertDtnInfo
type: object
required:
- id
- agency
- country
- properties
- dtnInfo
title: GeoJsonAlert
example:
id: nws1364c1bdd210c7f036b66585590bcff39d46ea0f7c77a0a2e8f1db8651256caa
agency: NWS
country: US
type: Feature
geometry:
type: Polygon
coordinates:
- - - -98
- 40
- - -98
- 41
- - -97
- 41
- - -97
- 40
- - -98
- 40
properties:
identifier: nws1364c1bdd210c7f036b66585590bcff39d46ea0f7c77a0a2e8f1db8651256caa
sender: w-nws.webmaster@noaa.gov
sent: '2024-06-24T20:49:00'
status: Actual
msgType: Update
scope: Public
code: IPAWSv1.0
updated: '2024-06-24T20:49:00'
references: w-nws.webmaster@noaa.gov,urn:oid:2.49.0.1.840.0.29e524a2edad47b728e81f62a538ac730e40e49a.001.1,2024-06-24T02:54:00-05:00
info:
- event: Heat Advisory
eventCode:
- valueName: SAME
value: NWS
- valueName: NationalWeatherService
value: HTY
category: Met
language: en-US
urgency: Expected
severity: Moderate
certainty: Likely
responseType: Execute
effective: '2024-06-24T20:49:00'
onset: '2024-06-25T18:00:00'
expires: '2024-06-26T00:00:00'
senderName: NWS Hastings NE
headline: Heat Advisory issued June 24 at 3:49PM CDT until June 25 at 7:00PM CDT by NWS Hastings NE
description: '* WHAT...For the first Heat Advisory, heat index values up to 110
possible. For the second Heat Advisory, heat index values around
105 expected.
* WHERE...In Kansas, Jewell, Mitchell, Osborne, Phillips, Rooks, and
Smith Counties. In Nebraska, Nuckolls and Thayer Counties.
* WHEN...For the first Heat Advisory, until 8 PM CDT this evening.
For the second Heat Advisory, from 1 PM to 7 PM CDT Tuesday.
* IMPACTS...Hot temperatures and high humidity may cause heat
illnesses.'
instruction: 'Take extra precautions when outside. Wear lightweight and loose
fitting clothing. Try to limit strenuous activities to early morning
or evening. Take action when you see symptoms of heat exhaustion and
heat stroke. Drink plenty of fluids, stay in an air-conditioned
room, stay out of
the sun, and check up on relatives and neighbors.'
web: http://www.weather.gov
parameters:
- valueName: AWIPSidentifier
value: NPWGID
- valueName: WMOidentifier
value: WWUS73 KGID 242049
- valueName: NWSheadline
value: HEAT ADVISORY REMAINS IN EFFECT UNTIL 8 PM CDT THIS EVENING... ...HEAT ADVISORY REMAINS IN EFFECT FROM 1 PM TO 7 PM CDT TUESDAY
- valueName: BLOCKCHANNEL
value: EAS,NWEM,CMAS
- valueName: VTEC
value: /O.CON.KGID.HT.Y.0002.240625T1800Z-240626T0000Z/
- valueName: eventEndingTime
value: 2024-06-26T00:00:00+0000
- valueName: CAPversion
value: '1.2'
- valueName: originalID
value: 2.49.0.1.840.0.f950770a5e0de71a60b45e3820f5c39fcdfe4222.001.2
area:
- areaDesc: Phillips; Smith; Jewell; Rooks; Osborne; Mitchell; Nuckolls; Thayer
geocodes:
- valueName: UGC
value: KSZ005
- valueName: UGC
value: KSZ006
- valueName: UGC
value: KSZ007
- valueName: UGC
value: KSZ017
- valueName: UGC
value: KSZ018
- valueName: UGC
value: KSZ019
- valueName: UGC
value: NEZ086
- valueName: UGC
value: NEZ087
dtnInfo:
dtnMsgType: Update
dtnExpires: '2024-06-26T00:00:00'
dtnEvent: Heat
dtnEventCode: '4'
dtnDisclaimer: Any DTN expiration dates, times, and message types shown here are automatically generated by the DTN's system, not by the alerting agencies themselves. Additionally, the dtnEvent and dtnEventCode are DTN's normalized event parameters for uniformity and do not necessarily reflect the exact terminology of the issuing agency. To access the original event name as published by the agency, please refer to the event parameter in the response.
'401':
content:
application/json:
schema:
properties:
detail:
type: string
title: detail
description: Details about the authorization error
type: object
required:
- detail
title: AuthorizationErrorResponse
example:
detail: Could not validate credentials
description: Unauthorized
'422':
content:
application/json:
schema:
properties:
detail:
type: string
title: detail
description: Details about the validation error including any invalid query parameters
type: object
required:
- detail
title: ValidationErrorResponse
example:
detail: 'Validation Error. [''language'': invalid value. Examples: ''en-US'', ''de-DE'', ''fr-FR'', ''es-ES'', ''en-AU'']'
description: Unprocessable Entity
servers:
- url: http://wxbulletin-ws.api.dtn.com
- url: http://agency-bulletin-ws.prd.wx.zones.dtn.com
/v2/sun-moon:
get:
tags:
- Endpoints
summary: Sun and Moon
description: "This endpoint provides comprehensive astronomical data including sunrise and sunset times, current moon phase, and more related to the Sun's and Moon's status for any specific point on Earth. Specify the location and an optional date range up to 15 days long. The API responds with the requested data in GeoJSON format.\n\nUse query parameters to control the results in the response body:\n\n * Specify a location as latitude (`lat`) and longitude (`lon`).\n\n * Two important parameters are `startDate` and `endDate`:\n + The API returns data for the specified date range when both are specified.\n + The API returns data for the specified UTC day when only `startTime` is specified.\n + The API returns data for the current UTC day when neither are specified.\n\n * Complete example: `https://astronomical.api.dtn.com/v2/sun-moon?lat={lat}&lon={lon}&startDate={start_date}&endDate={end_date}`\n"
operationId: sunMoon
security:
- clientCredentials: []
parameters:
- in: header
name: Accept-Encoding
schema:
type: string
description: Use this request header to communicate which compression algorithms the client understands. The API supports gzip.
example: gzip
- in: header
name: Accept
schema:
type: string
description: Use this request header to specify an acceptable response media type.
example: application/json
- $ref: '#/components/parameters/lat'
- $ref: '#/components/parameters/lon'
- $ref: '#/components/parameters/startDate'
- $ref: '#/components/parameters/endDate'
responses:
'200':
description: A successful request.
content:
application/json:
schema:
$ref: '#/components/schemas/SunMoon'
'400':
$ref: '#/components/responses/bad-request'
'401':
$ref: '#/components/responses/unauthorized'
'406':
$ref: '#/components/responses/not-acceptable'
servers:
- url: https://astronomical.api.dtn.com
/v1/daily/ten-year:
get:
tags:
- Endpoints
summary: Daily Climatology
description: "This endpoint provides daily climatology parameters for any point on Earth. Specify the location, parameters of interest, and a date range up to 366 days (from January 1 through December 31, including February 29). Results are valid from local midnight-to-midnight at the requested location and not specific to any year.\n\nUse the query string to customize the results in the response body:\n\n * Specify a location as latitude (`lat`) and longitude (`lon`). These are required.\n\n * Specify `parameters` to filter the response to a specific, comma-separated list of environmental parameters. The API returns defaults when this is omitted.\n\n * Specify `startDate` and `endDate` (using `MM-DD` format for month and day), or `startDate` alone for just one date.\n\n * Specify `units=us-std` to receive values as United States customary (imperial) units. The API returns metric units by default and when `units=si-std` is expressly requested.\n\n * Specify the `interval` parameter to request aggregated data for parameters such as airTempAvgAvg.\n + **Format:** The interval must be in the format {n}, where {n} is an integer greater than 1 (e.g., 2, 6, or 12).\n\nAll together, a complete request looks like:\n\n```\nhttps://climatology.api.dtn.com/v1/daily/ten-year?lat={lat}&lon={lon}&startDate={start_date}&endDate={end_date}&interval={n}¶meters={param1,param2}&units={units}\n```\n"
operationId: dailyClimatology
security:
- clientCredentials: []
parameters:
- in: header
name: Accept-Encoding
schema:
type: string
description: Use this request header to communicate which compression algorithms the client understands. The API supports gzip.
example: gzip
- in: header
name: Accept
schema:
type: string
description: Use this request header to specify an acceptable response media type.
example: application/json
- name: lat
in: query
schema:
type: number
format: float
example: 35.47
required: true
- name: lon
in: query
schema:
type: number
format: float
example: -97.51
required: true
- name: startDate
in: query
schema:
type: string
format: date-time
example: 08-01
- name: endDate
in: query
schema:
type: string
format: date-time
example: 08-03
- name: parameters
in: query
style: form
explode: true
schema:
type: array
items:
type: string
example: airTempAvg,precipAmountAvg,windSpeedAvg
- name: units
in: query
schema:
type: string
example: us-std
responses:
'200':
description: A successful request.
content:
application/json:
schema:
type: object
properties:
url:
type: string
type:
type: string
features:
type: array
items:
type: object
properties:
type:
type: string
geometry:
type: object
properties:
type:
type: string
coordinates:
type: array
items:
type: number
properties:
type: object
properties:
08-01:
type: object
properties:
airTempAvg:
type: number
airTempStdDev:
type: number
airTempMaxAvg:
type: number
airTempMaxStdDev:
type: number
airTempMinAvg:
type: number
airTempMinStdDev:
type: number
dewPointAvg:
type: number
dewPointStdDev:
type: number
potentialEvapotranspirationAmountAvg:
type: number
longWaveRadiationAvg:
type: number
longWaveRadiationStdDev:
type: number
precipAmountAvg:
type: number
shortWaveRadiationAvg:
type: number
shortWaveRadiationStdDev:
type: number
surfacePressureAvg:
type: number
surfacePressureStdDev:
type: number
windSpeedAvg:
type: number
windSpeedStdDev:
type: number
example:
url: https://climatology.api.dtn.com/v1/daily/ten-year?lat=35.47&lon=-97.51¶meters=airTempAvg,airTempStdDev,airTempMaxAvg,airTempMaxStdDev,airTempMinAvg,airTempMinStdDev,dewPointAvg,dewPointStdDev,potentialEvapotranspirationAmountAvg,longWaveRadiationAvg,longWaveRadiationStdDev,precipAmountAvg,shortWaveRadiationAvg,shortWaveRadiationStdDev,surfacePressureAvg,surfacePressureStdDev,windSpeedAvg,windSpeedStdDev&startDate=08-01&endDate=08-03&units=us-std
type: FeatureCollection
features:
- type: Feature
geometry:
type: Point
coordinates:
- -97.51
- 35.47
properties:
08-01:
airTempAvg: 86
airTempStdDev: 2.7
airTempMaxAvg: 95
airTempMaxStdDev: 3.6
airTempMinAvg: 77
airTempMinStdDev: 2.2
dewPointAvg: 64.4
dewPointStdDev: 1.4
potentialEvapotranspirationAmountAvg: 0.2
longWaveRadiationAvg: 400
longWaveRadiationStdDev: 20
precipAmountAvg: 0.08
shortWaveRadiationAvg: 800
shortWaveRadiationStdDev: 50
surfacePressureAvg: 1015
surfacePressureStdDev: 3
windSpeedAvg: 7.8
windSpeedStdDev: 2.2
08-02:
airTempAvg: 87.8
airTempStdDev: 2.9
airTempMaxAvg: 96.8
airTempMaxStdDev: 3.8
airTempMinAvg: 78.8
airTempMinStdDev: 2.3
dewPointAvg: 65.3
dewPointStdDev: 1.6
potentialEvapotranspirationAmountAvg: 0.2
longWaveRadiationAvg: 405
longWaveRadiationStdDev: 22
precipAmountAvg: 0.06
shortWaveRadiationAvg: 820
shortWaveRadiationStdDev: 55
surfacePressureAvg: 1014
surfacePressureStdDev: 3.2
windSpeedAvg: 8.3
windSpeedStdDev: 2.5
08-03:
airTempAvg: 85.1
airTempStdDev: 2.5
airTempMaxAvg: 94.1
airTempMaxStdDev: 3.6
airTempMinAvg: 76.1
airTempMinStdDev: 2
dewPointAvg: 63.5
dewPointStdDev: 1.3
potentialEvapotranspirationAmountAvg: 0.19
longWaveRadiationAvg: 398
longWaveRadiationStdDev: 18
precipAmountAvg: 0.12
shortWaveRadiationAvg: 810
shortWaveRadiationStdDev: 52
surfacePressureAvg: 1016
surfacePressureStdDev: 2.8
windSpeedAvg: 7.4
windSpeedStdDev: 2
'400':
description: An invalid request.
content:
application/problem+json:
schema:
type: object
properties:
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
detail:
type: string
description: A human-readable description of the general error.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
errors:
type: array
description: An array of human-readable descriptions of specific errors.
items:
type: object
properties:
message:
type: string
parameter:
type: string
value:
type: array
items:
type: string
additionalProperties: false
example:
type: badRequest
title: Invalid Request
detail: Validation failed.
status: 400
instance: urn:dtn:climatology:/v1/daily:requestId:123e4567-e89b-12d3-a458-426614176000
errors:
- message: 'the following parameters are invalid: invalidParameter1,invalidParameter2'
parameter: parameters
value:
- invalidParameter1
- invalidParameter2
'401':
description: Unable to authenticate credentials.
content:
application/problem+json:
schema:
type: object
properties:
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
detail:
type: string
description: A human-readable description of the general error.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
example:
type: unauthorized
title: Error while authenticating the user.
detail: invalid token
status: 401
instance: urn:dtn:climatology:/v1/daily:requestId:123e4567-e89b-12d3-a458-426614176000
'406':
description: Unable to produce a response matching the Accept request header.
content:
application/problem+json:
schema:
type: object
properties:
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
detail:
type: string
description: A human-readable description of the general error.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
example:
type: notAcceptable
title: Not Acceptable
detail: The Accept header value is invalid or unsupported.
status: 406
instance: urn:dtn:climatology:/v1/daily:requestId:123e4567-e89b-12d3-a458-426614176000
x-codeSamples:
- lang: C + Libcurl
source: 'CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://climatology.api.dtn.com/v1/daily/ten-year?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startDate=SOME_STRING_VALUE&endDate=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Accept-Encoding: SOME_STRING_VALUE");
headers = curl_slist_append(headers, "Accept: SOME_STRING_VALUE");
headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);'
- lang: Csharp + Restsharp
source: 'var client = new RestClient("https://climatology.api.dtn.com/v1/daily/ten-year?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startDate=SOME_STRING_VALUE&endDate=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept-Encoding", "SOME_STRING_VALUE");
request.AddHeader("Accept", "SOME_STRING_VALUE");
request.AddHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
IRestResponse response = client.Execute(request);'
- lang: Go + Native
source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://climatology.api.dtn.com/v1/daily/ten-year?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startDate=SOME_STRING_VALUE&endDate=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n\treq.Header.Add(\"Accept\", \"SOME_STRING_VALUE\")\n\treq.Header.Add(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
- lang: Java + Okhttp
source: "OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n .url(\"https://climatology.api.dtn.com/v1/daily/ten-year?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startDate=SOME_STRING_VALUE&endDate=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\")\n .get()\n .addHeader(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n .addHeader(\"Accept\", \"SOME_STRING_VALUE\")\n .addHeader(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n .build();\n\nResponse response = client.newCall(request).execute();"
- lang: Java + Unirest
source: "HttpResponse response = Unirest.get(\"https://climatology.api.dtn.com/v1/daily/ten-year?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startDate=SOME_STRING_VALUE&endDate=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\")\n .header(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n .header(\"Accept\", \"SOME_STRING_VALUE\")\n .header(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n .asString();"
- lang: Javascript + Jquery
source: "const settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://climatology.api.dtn.com/v1/daily/ten-year?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startDate=SOME_STRING_VALUE&endDate=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\",\n \"method\": \"GET\",\n \"headers\": {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\n$.ajax(settings).done(function (response) {\n console.log(response);\n});"
- lang: Javascript + Xhr
source: "const data = null;\n\nconst xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === this.DONE) {\n console.log(this.responseText);\n }\n});\n\nxhr.open(\"GET\", \"https://climatology.api.dtn.com/v1/daily/ten-year?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startDate=SOME_STRING_VALUE&endDate=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\");\nxhr.setRequestHeader(\"Accept-Encoding\", \"SOME_STRING_VALUE\");\nxhr.setRequestHeader(\"Accept\", \"SOME_STRING_VALUE\");\nxhr.setRequestHeader(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\");\n\nxhr.send(data);"
- lang: Javascript + Jquery
source: "const settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://climatology.api.dtn.com/v1/daily/ten-year?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startDate=SOME_STRING_VALUE&endDate=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\",\n \"method\": \"GET\",\n \"headers\": {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\n$.ajax(settings).done(function (response) {\n console.log(response);\n});"
- lang: Node + Native
source: "const http = require(\"https\");\n\nconst options = {\n \"method\": \"GET\",\n \"hostname\": \"climatology.api.dtn.com\",\n \"port\": null,\n \"path\": \"/v1/daily/ten-year?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startDate=SOME_STRING_VALUE&endDate=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\",\n \"headers\": {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\nconst req = http.request(options, function (res) {\n const chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n const body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n});\n\nreq.end();"
- lang: Node + Request
source: "const request = require('request');\n\nconst options = {\n method: 'GET',\n url: 'https://climatology.api.dtn.com/v1/daily/ten-year',\n qs: {\n lat: 'SOME_NUMBER_VALUE',\n lon: 'SOME_NUMBER_VALUE',\n startDate: 'SOME_STRING_VALUE',\n endDate: 'SOME_STRING_VALUE',\n parameters: 'SOME_ARRAY_VALUE',\n units: 'SOME_STRING_VALUE'\n },\n headers: {\n 'Accept-Encoding': 'SOME_STRING_VALUE',\n Accept: 'SOME_STRING_VALUE',\n Authorization: 'Bearer REPLACE_BEARER_TOKEN'\n }\n};\n\nrequest(options, function (error, response, body) {\n if (error) throw new Error(error);\n\n console.log(body);\n});\n"
- lang: Node + Unirest
source: "const unirest = require(\"unirest\");\n\nconst req = unirest(\"GET\", \"https://climatology.api.dtn.com/v1/daily/ten-year\");\n\nreq.query({\n \"lat\": \"SOME_NUMBER_VALUE\",\n \"lon\": \"SOME_NUMBER_VALUE\",\n \"startDate\": \"SOME_STRING_VALUE\",\n \"endDate\": \"SOME_STRING_VALUE\",\n \"parameters\": \"SOME_ARRAY_VALUE\",\n \"units\": \"SOME_STRING_VALUE\"\n});\n\nreq.headers({\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n});\n\nreq.end(function (res) {\n if (res.error) throw new Error(res.error);\n\n console.log(res.body);\n});\n"
- lang: Objc + Nsurlsession
source: "#import \n\nNSDictionary *headers = @{ @\"Accept-Encoding\": @\"SOME_STRING_VALUE\",\n @\"Accept\": @\"SOME_STRING_VALUE\",\n @\"Authorization\": @\"Bearer REPLACE_BEARER_TOKEN\" };\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://climatology.api.dtn.com/v1/daily/ten-year?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startDate=SOME_STRING_VALUE&endDate=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\n[request setHTTPMethod:@\"GET\"];\n[request setAllHTTPHeaderFields:headers];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSLog(@\"%@\", httpResponse);\n }\n }];\n[dataTask resume];"
- lang: Ocaml + Cohttp
source: "open Cohttp_lwt_unix\nopen Cohttp\nopen Lwt\n\nlet uri = Uri.of_string \"https://climatology.api.dtn.com/v1/daily/ten-year?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startDate=SOME_STRING_VALUE&endDate=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\" in\nlet headers = Header.add_list (Header.init ()) [\n (\"Accept-Encoding\", \"SOME_STRING_VALUE\");\n (\"Accept\", \"SOME_STRING_VALUE\");\n (\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\");\n] in\n\nClient.call ~headers `GET uri\n>>= fun (res, body_stream) ->\n (* Do stuff with the result *)"
- lang: Php + Curl
source: " \"https://climatology.api.dtn.com/v1/daily/ten-year?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startDate=SOME_STRING_VALUE&endDate=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"GET\",\n CURLOPT_HTTPHEADER => [\n \"Accept: SOME_STRING_VALUE\",\n \"Accept-Encoding: SOME_STRING_VALUE\",\n \"Authorization: Bearer REPLACE_BEARER_TOKEN\"\n ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n echo \"cURL Error #:\" . $err;\n} else {\n echo $response;\n}"
- lang: Php + Http1
source: "setUrl('https://climatology.api.dtn.com/v1/daily/ten-year');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setQueryData([\n 'lat' => 'SOME_NUMBER_VALUE',\n 'lon' => 'SOME_NUMBER_VALUE',\n 'startDate' => 'SOME_STRING_VALUE',\n 'endDate' => 'SOME_STRING_VALUE',\n 'parameters' => 'SOME_ARRAY_VALUE',\n 'units' => 'SOME_STRING_VALUE'\n]);\n\n$request->setHeaders([\n 'Accept-Encoding' => 'SOME_STRING_VALUE',\n 'Accept' => 'SOME_STRING_VALUE',\n 'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'\n]);\n\ntry {\n $response = $request->send();\n\n echo $response->getBody();\n} catch (HttpException $ex) {\n echo $ex;\n}"
- lang: Php + Http2
source: "setRequestUrl('https://climatology.api.dtn.com/v1/daily/ten-year');\n$request->setRequestMethod('GET');\n$request->setQuery(new http\\QueryString([\n 'lat' => 'SOME_NUMBER_VALUE',\n 'lon' => 'SOME_NUMBER_VALUE',\n 'startDate' => 'SOME_STRING_VALUE',\n 'endDate' => 'SOME_STRING_VALUE',\n 'parameters' => 'SOME_ARRAY_VALUE',\n 'units' => 'SOME_STRING_VALUE'\n]));\n\n$request->setHeaders([\n 'Accept-Encoding' => 'SOME_STRING_VALUE',\n 'Accept' => 'SOME_STRING_VALUE',\n 'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"
- lang: Python + Python3
source: "import http.client\n\nconn = http.client.HTTPSConnection(\"climatology.api.dtn.com\")\n\nheaders = {\n 'Accept-Encoding': \"SOME_STRING_VALUE\",\n 'Accept': \"SOME_STRING_VALUE\",\n 'Authorization': \"Bearer REPLACE_BEARER_TOKEN\"\n }\n\nconn.request(\"GET\", \"/v1/daily/ten-year?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startDate=SOME_STRING_VALUE&endDate=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"
- lang: Python + Requests
source: "import requests\n\nurl = \"https://climatology.api.dtn.com/v1/daily/ten-year\"\n\nquerystring = {\"lat\":\"SOME_NUMBER_VALUE\",\"lon\":\"SOME_NUMBER_VALUE\",\"startDate\":\"SOME_STRING_VALUE\",\"endDate\":\"SOME_STRING_VALUE\",\"parameters\":\"SOME_ARRAY_VALUE\",\"units\":\"SOME_STRING_VALUE\"}\n\nheaders = {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\nprint(response.text)"
- lang: Ruby + Native
source: 'require ''uri''
require ''net/http''
require ''openssl''
url = URI("https://climatology.api.dtn.com/v1/daily/ten-year?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startDate=SOME_STRING_VALUE&endDate=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["Accept-Encoding"] = ''SOME_STRING_VALUE''
request["Accept"] = ''SOME_STRING_VALUE''
request["Authorization"] = ''Bearer REPLACE_BEARER_TOKEN''
response = http.request(request)
puts response.read_body'
- lang: Shell + Curl
source: "curl --request GET \\\n --url 'https://climatology.api.dtn.com/v1/daily/ten-year?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startDate=SOME_STRING_VALUE&endDate=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE' \\\n --header 'Accept: SOME_STRING_VALUE' \\\n --header 'Accept-Encoding: SOME_STRING_VALUE' \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'"
- lang: Shell + Httpie
source: "http GET 'https://climatology.api.dtn.com/v1/daily/ten-year?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startDate=SOME_STRING_VALUE&endDate=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE' \\\n Accept:SOME_STRING_VALUE \\\n Accept-Encoding:SOME_STRING_VALUE \\\n Authorization:'Bearer REPLACE_BEARER_TOKEN'"
- lang: Shell + Wget
source: "wget --quiet \\\n --method GET \\\n --header 'Accept-Encoding: SOME_STRING_VALUE' \\\n --header 'Accept: SOME_STRING_VALUE' \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \\\n --output-document \\\n - 'https://climatology.api.dtn.com/v1/daily/ten-year?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startDate=SOME_STRING_VALUE&endDate=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE'"
- lang: Swift + Nsurlsession
source: "import Foundation\n\nlet headers = [\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n]\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://climatology.api.dtn.com/v1/daily/ten-year?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startDate=SOME_STRING_VALUE&endDate=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\")! as URL,\n cachePolicy: .useProtocolCachePolicy,\n timeoutInterval: 10.0)\nrequest.httpMethod = \"GET\"\nrequest.allHTTPHeaderFields = headers\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n if (error != nil) {\n print(error)\n } else {\n let httpResponse = response as? HTTPURLResponse\n print(httpResponse)\n }\n})\n\ndataTask.resume()"
servers:
- url: https://climatology.api.dtn.com
/v1/parameters:
get:
tags:
- Endpoints
summary: Parameters
description: 'This endpoint provides helpful context in JSON format about the environmental parameters and operations that the other endpoints support.
Use the `name` query string parameter to filter environmental parameters by that name (for example, `name=airTempAvg`), or omit the query string to obtain all environmental parameters in the response.
'
operationId: parameters
security:
- clientCredentials: []
parameters:
- in: header
name: Accept-Encoding
schema:
type: string
description: Use this request header to communicate which compression algorithms the client understands. The API supports gzip.
example: gzip
- in: header
name: Accept
schema:
type: string
description: Use this request header to specify an acceptable response media type.
example: application/json
- in: query
name: name
schema:
type: string
description: The desired parameter name filter (optional).
example:
- airTempAvg
responses:
'200':
description: A successful request.
content:
application/json:
schema:
type: object
properties:
daily-climatology:
type: object
properties:
parameter name:
type: object
description: The name of the parameter.
properties:
metricUnit:
type: string
description: The metric unit used for this parameter.
imperialUnit:
type: string
description: The imperial unit used for this parameter.
type:
type: string
description: The parameter type.
description:
type: string
description: A description of what this parameter means.
notes:
type: string
description: Additional information related to this parameter.
aggregationMethods:
type: array
items:
type: string
description: Aggregation methods available to the parameter.
example:
airTempAvg:
metricUnit: Celsius
imperialUnit: Fahrenheit
type: number
description: Average daily air temperature at 2 meters above ground level.
notes: ''
aggregationMethods:
- Avg
'400':
description: An invalid request.
content:
application/problem+json:
schema:
type: object
properties:
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
detail:
type: string
description: A human-readable description of the general error.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
errors:
type: array
description: An array of human-readable descriptions of specific errors.
items:
type: object
properties:
message:
type: string
parameter:
type: string
value:
type: array
items:
type: string
additionalProperties: false
example:
type: badRequest
title: Invalid Request
detail: Validation failed.
status: 400
instance: urn:dtn:climatology:/v1/daily:requestId:123e4567-e89b-12d3-a458-426614176000
errors:
- message: 'the following parameters are invalid: invalidParameter1,invalidParameter2'
parameter: parameters
value:
- invalidParameter1
- invalidParameter2
'401':
description: Unable to authenticate credentials.
content:
application/problem+json:
schema:
type: object
properties:
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
detail:
type: string
description: A human-readable description of the general error.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
example:
type: unauthorized
title: Error while authenticating the user.
detail: invalid token
status: 401
instance: urn:dtn:climatology:/v1/daily:requestId:123e4567-e89b-12d3-a458-426614176000
'406':
description: Unable to produce a response matching the Accept request header.
content:
application/problem+json:
schema:
type: object
properties:
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
detail:
type: string
description: A human-readable description of the general error.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
example:
type: notAcceptable
title: Not Acceptable
detail: The Accept header value is invalid or unsupported.
status: 406
instance: urn:dtn:climatology:/v1/daily:requestId:123e4567-e89b-12d3-a458-426614176000
x-codeSamples:
- lang: C + Libcurl
source: 'CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://climatology.api.dtn.com/v1/parameters?name=airTempAvg");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Accept-Encoding: SOME_STRING_VALUE");
headers = curl_slist_append(headers, "Accept: SOME_STRING_VALUE");
headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);'
- lang: Csharp + Restsharp
source: 'var client = new RestClient("https://climatology.api.dtn.com/v1/parameters?name=airTempAvg");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept-Encoding", "SOME_STRING_VALUE");
request.AddHeader("Accept", "SOME_STRING_VALUE");
request.AddHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
IRestResponse response = client.Execute(request);'
- lang: Go + Native
source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://climatology.api.dtn.com/v1/parameters?name=airTempAvg\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n\treq.Header.Add(\"Accept\", \"SOME_STRING_VALUE\")\n\treq.Header.Add(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
- lang: Java + Okhttp
source: "OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n .url(\"https://climatology.api.dtn.com/v1/parameters?name=airTempAvg\")\n .get()\n .addHeader(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n .addHeader(\"Accept\", \"SOME_STRING_VALUE\")\n .addHeader(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n .build();\n\nResponse response = client.newCall(request).execute();"
- lang: Java + Unirest
source: "HttpResponse response = Unirest.get(\"https://climatology.api.dtn.com/v1/parameters?name=airTempAvg\")\n .header(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n .header(\"Accept\", \"SOME_STRING_VALUE\")\n .header(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n .asString();"
- lang: Javascript + Jquery
source: "const settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://climatology.api.dtn.com/v1/parameters?name=airTempAvg\",\n \"method\": \"GET\",\n \"headers\": {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\n$.ajax(settings).done(function (response) {\n console.log(response);\n});"
- lang: Javascript + Xhr
source: "const data = null;\n\nconst xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === this.DONE) {\n console.log(this.responseText);\n }\n});\n\nxhr.open(\"GET\", \"https://climatology.api.dtn.com/v1/parameters?name=airTempAvg\");\nxhr.setRequestHeader(\"Accept-Encoding\", \"SOME_STRING_VALUE\");\nxhr.setRequestHeader(\"Accept\", \"SOME_STRING_VALUE\");\nxhr.setRequestHeader(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\");\n\nxhr.send(data);"
- lang: Javascript + Jquery
source: "const settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://climatology.api.dtn.com/v1/parameters?name=airTempAvg\",\n \"method\": \"GET\",\n \"headers\": {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\n$.ajax(settings).done(function (response) {\n console.log(response);\n});"
- lang: Node + Native
source: "const http = require(\"https\");\n\nconst options = {\n \"method\": \"GET\",\n \"hostname\": \"climatology.api.dtn.com\",\n \"port\": null,\n \"path\": \"/v1/parameters?name=airTempAvg\",\n \"headers\": {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\nconst req = http.request(options, function (res) {\n const chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n const body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n});\n\nreq.end();"
- lang: Node + Request
source: "const request = require('request');\n\nconst options = {\n method: 'GET',\n url: 'https://climatology.api.dtn.com/v1/parameters',\n qs: {name: 'airTempAvg'},\n headers: {\n 'Accept-Encoding': 'SOME_STRING_VALUE',\n Accept: 'SOME_STRING_VALUE',\n Authorization: 'Bearer REPLACE_BEARER_TOKEN'\n }\n};\n\nrequest(options, function (error, response, body) {\n if (error) throw new Error(error);\n\n console.log(body);\n});\n"
- lang: Node + Unirest
source: "const unirest = require(\"unirest\");\n\nconst req = unirest(\"GET\", \"https://climatology.api.dtn.com/v1/parameters\");\n\nreq.query({\n \"name\": \"airTempAvg\"\n});\n\nreq.headers({\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n});\n\nreq.end(function (res) {\n if (res.error) throw new Error(res.error);\n\n console.log(res.body);\n});\n"
- lang: Objc + Nsurlsession
source: "#import \n\nNSDictionary *headers = @{ @\"Accept-Encoding\": @\"SOME_STRING_VALUE\",\n @\"Accept\": @\"SOME_STRING_VALUE\",\n @\"Authorization\": @\"Bearer REPLACE_BEARER_TOKEN\" };\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://climatology.api.dtn.com/v1/parameters?name=airTempAvg\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\n[request setHTTPMethod:@\"GET\"];\n[request setAllHTTPHeaderFields:headers];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSLog(@\"%@\", httpResponse);\n }\n }];\n[dataTask resume];"
- lang: Ocaml + Cohttp
source: "open Cohttp_lwt_unix\nopen Cohttp\nopen Lwt\n\nlet uri = Uri.of_string \"https://climatology.api.dtn.com/v1/parameters?name=airTempAvg\" in\nlet headers = Header.add_list (Header.init ()) [\n (\"Accept-Encoding\", \"SOME_STRING_VALUE\");\n (\"Accept\", \"SOME_STRING_VALUE\");\n (\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\");\n] in\n\nClient.call ~headers `GET uri\n>>= fun (res, body_stream) ->\n (* Do stuff with the result *)"
- lang: Php + Curl
source: " \"https://climatology.api.dtn.com/v1/parameters?name=airTempAvg\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"GET\",\n CURLOPT_HTTPHEADER => [\n \"Accept: SOME_STRING_VALUE\",\n \"Accept-Encoding: SOME_STRING_VALUE\",\n \"Authorization: Bearer REPLACE_BEARER_TOKEN\"\n ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n echo \"cURL Error #:\" . $err;\n} else {\n echo $response;\n}"
- lang: Php + Http1
source: "setUrl('https://climatology.api.dtn.com/v1/parameters');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setQueryData([\n 'name' => 'airTempAvg'\n]);\n\n$request->setHeaders([\n 'Accept-Encoding' => 'SOME_STRING_VALUE',\n 'Accept' => 'SOME_STRING_VALUE',\n 'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'\n]);\n\ntry {\n $response = $request->send();\n\n echo $response->getBody();\n} catch (HttpException $ex) {\n echo $ex;\n}"
- lang: Php + Http2
source: "setRequestUrl('https://climatology.api.dtn.com/v1/parameters');\n$request->setRequestMethod('GET');\n$request->setQuery(new http\\QueryString([\n 'name' => 'airTempAvg'\n]));\n\n$request->setHeaders([\n 'Accept-Encoding' => 'SOME_STRING_VALUE',\n 'Accept' => 'SOME_STRING_VALUE',\n 'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"
- lang: Python + Python3
source: "import http.client\n\nconn = http.client.HTTPSConnection(\"climatology.api.dtn.com\")\n\nheaders = {\n 'Accept-Encoding': \"SOME_STRING_VALUE\",\n 'Accept': \"SOME_STRING_VALUE\",\n 'Authorization': \"Bearer REPLACE_BEARER_TOKEN\"\n }\n\nconn.request(\"GET\", \"/v1/parameters?name=airTempAvg\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"
- lang: Python + Requests
source: "import requests\n\nurl = \"https://climatology.api.dtn.com/v1/parameters\"\n\nquerystring = {\"name\":\"airTempAvg\"}\n\nheaders = {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\nprint(response.text)"
- lang: Ruby + Native
source: 'require ''uri''
require ''net/http''
require ''openssl''
url = URI("https://climatology.api.dtn.com/v1/parameters?name=airTempAvg")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["Accept-Encoding"] = ''SOME_STRING_VALUE''
request["Accept"] = ''SOME_STRING_VALUE''
request["Authorization"] = ''Bearer REPLACE_BEARER_TOKEN''
response = http.request(request)
puts response.read_body'
- lang: Shell + Curl
source: "curl --request GET \\\n --url 'https://climatology.api.dtn.com/v1/parameters?name=airTempAvg' \\\n --header 'Accept: SOME_STRING_VALUE' \\\n --header 'Accept-Encoding: SOME_STRING_VALUE' \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'"
- lang: Shell + Httpie
source: "http GET 'https://climatology.api.dtn.com/v1/parameters?name=airTempAvg' \\\n Accept:SOME_STRING_VALUE \\\n Accept-Encoding:SOME_STRING_VALUE \\\n Authorization:'Bearer REPLACE_BEARER_TOKEN'"
- lang: Shell + Wget
source: "wget --quiet \\\n --method GET \\\n --header 'Accept-Encoding: SOME_STRING_VALUE' \\\n --header 'Accept: SOME_STRING_VALUE' \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \\\n --output-document \\\n - 'https://climatology.api.dtn.com/v1/parameters?name=airTempAvg'"
- lang: Swift + Nsurlsession
source: "import Foundation\n\nlet headers = [\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n]\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://climatology.api.dtn.com/v1/parameters?name=airTempAvg\")! as URL,\n cachePolicy: .useProtocolCachePolicy,\n timeoutInterval: 10.0)\nrequest.httpMethod = \"GET\"\nrequest.allHTTPHeaderFields = headers\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n if (error != nil) {\n print(error)\n } else {\n let httpResponse = response as? HTTPURLResponse\n print(httpResponse)\n }\n})\n\ndataTask.resume()"
servers:
- url: https://climatology.api.dtn.com
/v1/conditions/marine:
get:
tags:
- Endpoints
summary: Marine Conditions
description: "This endpoint provides forecast and historical conditions for any specific point in the ocean. Specify the location, the marine parameters of interest, and a time range up to 10 days long, from 10 years in the past to 10 days in the future. The API responds with the requested time series in GeoJSON format.\n\nCommon uses include weather monitoring, marine research, localized operations, and supply-chain management planning in ports and offshore platforms.\n\nUse query parameters to control the results in the response body:\n\n * Specify a location as latitude (`lat`) and longitude (`lon`).\n\n * Specify `parameters` to filter by specific marine weather parameters. Include multiple as comma-separated values. The API returns only defaults when no specific parameters are requested.\n\n * Two important parameters are `startTime` and `endTime`:\n + The API returns forecast data when `startTime` and `endTime` are in the future.\n + The API returns historical data when `startTime` and `endTime` are in the past.\n + The API returns only one exact timestamp when only `startTime` is specified.\n\n * Complete example: `https://weather.api.dtn.com/v1/conditions/marine?lat={lat}&lon={lon}&startTime={start_time}&endTime={end_time}¶meters={param1,param2}`\n"
operationId: marineConditions
security:
- clientCredentials: []
parameters:
- in: header
name: Accept-Encoding
schema:
type: string
description: Use this request header to communicate which compression algorithms the client understands. The API supports gzip.
example: gzip
- in: header
name: Accept
schema:
type: string
description: Use this request header to specify an acceptable response media type.
example: application/json
- name: lat
in: query
schema:
type: number
format: float
example: 55.81
required: true
- name: lon
in: query
schema:
type: number
format: float
example: 3.88
required: true
- name: startTime
in: query
schema:
type: string
format: date-time
example: '2023-06-30T10:00:00Z'
required: true
- name: endTime
in: query
schema:
type: string
format: date-time
example: '2023-07-07T10:00:00Z'
- name: parameters
in: query
style: form
explode: true
schema:
type: array
items:
type: string
example: airTemp,seaSurfaceTemp,windSpeed10m
responses:
'200':
description: A successful request.
content:
application/json:
schema:
oneOf:
- type: object
properties:
url:
type: string
type:
type: string
features:
type: array
items:
type: object
properties:
type:
type: string
geometry:
type: object
properties:
type:
type: string
coordinates:
type: array
items:
type: number
properties:
type: object
properties:
'2023-06-30T10:00:00Z':
type: object
properties:
airPressureMeanSeaLevel:
type: number
airTemp:
type: number
airTemp10m:
type: number
dewPoint:
type: number
lightningProb:
type: number
maximumWaveHeight:
type: number
meanWaveDirection:
type: number
meanWaveDirectionalSpreading:
type: number
meanWavePeriodTm02:
type: number
meanWavePeriodTmm10:
type: number
peakPeriod:
type: number
precipAmount1h:
type: number
precipProb:
type: number
relativeHumidity:
type: number
seaIceConcentration:
type: number
seaSurfaceTemp:
type: number
significantWaveHeight:
type: number
significantWaveHeightRiskP90:
type: number
totalCurrentDirection:
type: number
totalCurrentVelocity:
type: number
totalSwellMeanWaveDirection:
type: number
totalSwellMeanWaveDirectionalSpreading:
type: number
totalSwellMeanWavePeriodTm02:
type: number
totalSwellMeanWavePeriodTmm10:
type: number
totalSwellPeakPeriod:
type: number
totalSwellSignificantWaveHeight:
type: number
visibility:
type: number
weatherCode:
type: number
windDirection100m:
type: number
windDirection10m:
type: number
windDirection50m:
type: number
windGust100m:
type: number
windGust10m:
type: number
windGust50m:
type: number
windSpeed100m:
type: number
windSpeed10m:
type: number
windSpeed50m:
type: number
windWaveMeanWaveDirection:
type: number
windWaveMeanWaveDirectionalSpreading:
type: number
windWaveMeanWavePeriodTm02:
type: number
windWaveMeanWavePeriodTmm10:
type: number
windWavePeakPeriod:
type: number
windWaveSignificantWaveHeight:
type: number
example:
url: https://weather.api.dtn.com/v1/conditions/marine?lat=55.81&lon=3.88¶meters=airPressureMeanSeaLevel,airTemp,airTemp10m,dewPoint,lightningProb,maximumWaveHeight,meanWaveDirection,meanWaveDirectionalSpreading,meanWavePeriodTm02,meanWavePeriodTmm10,peakPeriod,precipAmount1h,precipProb,relativeHumidity,seaIceConcentration,seaSurfaceTemp,significantWaveHeight,significantWaveHeightRiskP90,totalCurrentDirection,totalCurrentVelocity,totalSwellMeanWaveDirection,totalSwellMeanWaveDirectionalSpreading,totalSwellMeanWavePeriodTm02,totalSwellMeanWavePeriodTmm10,totalSwellPeakPeriod,totalSwellSignificantWaveHeight,visibility,weatherCode,windDirection100m,windDirection10m,windDirection50m,windGust100m,windGust10m,windGust50m,windSpeed100m,windSpeed10m,windSpeed50m,windWaveMeanWaveDirection,windWaveMeanWaveDirectionalSpreading,windWaveMeanWavePeriodTm02,windWaveMeanWavePeriodTmm10,windWavePeakPeriod,windWaveSignificantWaveHeight,seaSurfaceHeightAnomalyAstronomic,seaSurfaceHeightAnomalyResidual,seaSurfaceHeightAnomalyTotal&startTime=2023-08-11T16:13:53Z&endTime=2023-08-11T19:13:53Z
type: FeatureCollection
features:
- type: Feature
geometry:
type: Point
coordinates:
- 3.88
- 55.81
properties:
'2023-08-11T16:00:00Z':
airPressureMeanSeaLevel: 1014.4
airTemp: 16.7
airTemp10m: 16.65
dewPoint: 15.6
lightningProb: 0
maximumWaveHeight: 2.06
meanWaveDirection: 259.95
meanWaveDirectionalSpreading: 64.07
meanWavePeriodTm02: 4.4
meanWavePeriodTmm10: 5.9
peakPeriod: 9.15
precipAmount1h: 0
precipProb: 0
relativeHumidity: 93
seaIceConcentration: 0
seaSurfaceTemp: 15.15
significantWaveHeight: 1.24
significantWaveHeightRiskP90: 1.35
totalCurrentDirection: 96.25
totalCurrentVelocity: 0.29
totalSwellMeanWaveDirection: 343.95
totalSwellMeanWaveDirectionalSpreading: 20.99
totalSwellMeanWavePeriodTm02: 7.25
totalSwellMeanWavePeriodTmm10: 8.25
totalSwellPeakPeriod: 9.15
totalSwellSignificantWaveHeight: 0.78
visibility: 24.04
weatherCode: 1
windDirection100m: 229
windDirection10m: 223
windDirection50m: 226
windGust100m: 11.4
windGust10m: 8.7
windGust50m: 10.6
windSpeed100m: 9.4
windSpeed10m: 6.7
windSpeed50m: 8.6
windWaveMeanWaveDirection: 211.75
windWaveMeanWaveDirectionalSpreading: 31.86
windWaveMeanWavePeriodTm02: 3.65
windWaveMeanWavePeriodTmm10: 4.25
windWavePeakPeriod: 4.7
windWaveSignificantWaveHeight: 0.95
seaSurfaceHeightAnomalyAstronomic: 0.06
seaSurfaceHeightAnomalyResidual: -0.01
seaSurfaceHeightAnomalyTotal: 0.04
'2023-08-11T17:00:00Z':
airPressureMeanSeaLevel: 1014.5
airTemp: 16.75
airTemp10m: 16.7
dewPoint: 15.6
lightningProb: 0
maximumWaveHeight: 2
meanWaveDirection: 257.85
meanWaveDirectionalSpreading: 63.72
meanWavePeriodTm02: 4.35
meanWavePeriodTmm10: 5.85
peakPeriod: 9.15
precipAmount1h: 0
precipProb: 0
relativeHumidity: 93
seaIceConcentration: 0
seaSurfaceTemp: 15.15
significantWaveHeight: 1.19
significantWaveHeightRiskP90: 1.31
totalCurrentDirection: 104.2
totalCurrentVelocity: 0.25
totalSwellMeanWaveDirection: 343.85
totalSwellMeanWaveDirectionalSpreading: 24.43
totalSwellMeanWavePeriodTm02: 7.2
totalSwellMeanWavePeriodTmm10: 8.2
totalSwellPeakPeriod: 9.15
totalSwellSignificantWaveHeight: 0.76
visibility: 24.43
weatherCode: 1
windDirection100m: 230
windDirection10m: 222
windDirection50m: 226
windGust100m: 11.05
windGust10m: 8.45
windGust50m: 10.25
windSpeed100m: 9.05
windSpeed10m: 6.45
windSpeed50m: 8.25
windWaveMeanWaveDirection: 212.4
windWaveMeanWaveDirectionalSpreading: 31.88
windWaveMeanWavePeriodTm02: 3.65
windWaveMeanWavePeriodTmm10: 4.25
windWavePeakPeriod: 4.7
windWaveSignificantWaveHeight: 0.93
seaSurfaceHeightAnomalyAstronomic: 0.15
seaSurfaceHeightAnomalyResidual: -0.03
seaSurfaceHeightAnomalyTotal: 0.13
'2023-08-11T18:00:00Z':
airPressureMeanSeaLevel: 1014.4
airTemp: 16.75
airTemp10m: 16.7
dewPoint: 15.55
lightningProb: 0
maximumWaveHeight: 1.93
meanWaveDirection: 255.65
meanWaveDirectionalSpreading: 63.6
meanWavePeriodTm02: 4.35
meanWavePeriodTmm10: 5.8
peakPeriod: 9.15
precipAmount1h: 0
precipProb: 0
relativeHumidity: 92.5
seaIceConcentration: 0
seaSurfaceTemp: 15.15
significantWaveHeight: 1.16
significantWaveHeightRiskP90: 1.27
totalCurrentDirection: 115.55
totalCurrentVelocity: 0.2
totalSwellMeanWaveDirection: 343.65
totalSwellMeanWaveDirectionalSpreading: 28.13
totalSwellMeanWavePeriodTm02: 7.15
totalSwellMeanWavePeriodTmm10: 8.15
totalSwellPeakPeriod: 9.15
totalSwellSignificantWaveHeight: 0.73
visibility: 24.05
weatherCode: 1
windDirection100m: 228
windDirection10m: 224
windDirection50m: 226
windGust100m: 10.8
windGust10m: 8.45
windGust50m: 10.1
windSpeed100m: 8.7
windSpeed10m: 6.35
windSpeed50m: 8
windWaveMeanWaveDirection: 212.5
windWaveMeanWaveDirectionalSpreading: 31.97
windWaveMeanWavePeriodTm02: 3.65
windWaveMeanWavePeriodTmm10: 4.25
windWavePeakPeriod: 4.7
windWaveSignificantWaveHeight: 0.9
seaSurfaceHeightAnomalyAstronomic: -0.04
seaSurfaceHeightAnomalyResidual: -0.01
seaSurfaceHeightAnomalyTotal: -0.06
'2023-08-11T19:00:00Z':
airPressureMeanSeaLevel: 1014.6
airTemp: 16.7
airTemp10m: 16.65
dewPoint: 15.5
lightningProb: 0
maximumWaveHeight: 1.87
meanWaveDirection: 254.4
meanWaveDirectionalSpreading: 63.82
meanWavePeriodTm02: 4.3
meanWavePeriodTmm10: 5.75
peakPeriod: 9.15
precipAmount1h: 0
precipProb: 0
relativeHumidity: 92.5
seaIceConcentration: 0
seaSurfaceTemp: 15.05
significantWaveHeight: 1.12
significantWaveHeightRiskP90: 1.23
totalCurrentDirection: 133.05
totalCurrentVelocity: 0.14
totalSwellMeanWaveDirection: 342.45
totalSwellMeanWaveDirectionalSpreading: 31.18
totalSwellMeanWavePeriodTm02: 7.05
totalSwellMeanWavePeriodTmm10: 8.1
totalSwellPeakPeriod: 9.15
totalSwellSignificantWaveHeight: 0.71
visibility: 24.06
weatherCode: 1
windDirection100m: 223
windDirection10m: 216
windDirection50m: 220
windGust100m: 10.05
windGust10m: 7.65
windGust50m: 9.35
windSpeed100m: 8.35
windSpeed10m: 5.95
windSpeed50m: 7.65
windWaveMeanWaveDirection: 211.35
windWaveMeanWaveDirectionalSpreading: 32
windWaveMeanWavePeriodTm02: 3.65
windWaveMeanWavePeriodTmm10: 4.2
windWavePeakPeriod: 4.7
windWaveSignificantWaveHeight: 0.86
seaSurfaceHeightAnomalyAstronomic: -0.13
seaSurfaceHeightAnomalyResidual: -0.04
seaSurfaceHeightAnomalyTotal: -0.16
'400':
description: An invalid request.
content:
application/problem+json:
schema:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: false
example:
type: bad-request
title: Invalid Request
detail: Validation failed.
status: 400
instance: urn:dtn:one-marine-weather-service:/v1/conditions/marine:requestId:123e4567-e89b-12d3-a458-426614176000
'401':
description: Unable to authenticate credentials.
content:
application/problem+json:
schema:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: false
example:
type: unauthorized
title: Error while authenticating the user.
detail: invalid token
status: 401
instance: urn:dtn:one-marine-weather-service:/v1/conditions/marine:requestId:123e4567-e89b-12d3-a458-426614176000
'406':
description: Unable to produce a response matching the Accept request header.
content:
application/problem+json:
schema:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: false
example:
type: not-acceptable
title: Not Acceptable
detail: The Accept header value is invalid or unsupported.
status: 406
instance: urn:dtn:one-marine-weather-service:/v1/conditions/marine:requestId:123e4567-e89b-12d3-a458-426614176000
x-codeSamples:
- lang: C + Libcurl
source: 'CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://weather.api.dtn.com/v1/conditions/marine?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Accept-Encoding: SOME_STRING_VALUE");
headers = curl_slist_append(headers, "Accept: SOME_STRING_VALUE");
headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);'
- lang: Csharp + Restsharp
source: 'var client = new RestClient("https://weather.api.dtn.com/v1/conditions/marine?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept-Encoding", "SOME_STRING_VALUE");
request.AddHeader("Accept", "SOME_STRING_VALUE");
request.AddHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
IRestResponse response = client.Execute(request);'
- lang: Go + Native
source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://weather.api.dtn.com/v1/conditions/marine?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n\treq.Header.Add(\"Accept\", \"SOME_STRING_VALUE\")\n\treq.Header.Add(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
- lang: Java + Okhttp
source: "OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n .url(\"https://weather.api.dtn.com/v1/conditions/marine?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE\")\n .get()\n .addHeader(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n .addHeader(\"Accept\", \"SOME_STRING_VALUE\")\n .addHeader(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n .build();\n\nResponse response = client.newCall(request).execute();"
- lang: Java + Unirest
source: "HttpResponse response = Unirest.get(\"https://weather.api.dtn.com/v1/conditions/marine?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE\")\n .header(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n .header(\"Accept\", \"SOME_STRING_VALUE\")\n .header(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n .asString();"
- lang: Javascript + Jquery
source: "const settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://weather.api.dtn.com/v1/conditions/marine?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE\",\n \"method\": \"GET\",\n \"headers\": {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\n$.ajax(settings).done(function (response) {\n console.log(response);\n});"
- lang: Javascript + Xhr
source: "const data = null;\n\nconst xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === this.DONE) {\n console.log(this.responseText);\n }\n});\n\nxhr.open(\"GET\", \"https://weather.api.dtn.com/v1/conditions/marine?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE\");\nxhr.setRequestHeader(\"Accept-Encoding\", \"SOME_STRING_VALUE\");\nxhr.setRequestHeader(\"Accept\", \"SOME_STRING_VALUE\");\nxhr.setRequestHeader(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\");\n\nxhr.send(data);"
- lang: Javascript + Jquery
source: "const settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://weather.api.dtn.com/v1/conditions/marine?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE\",\n \"method\": \"GET\",\n \"headers\": {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\n$.ajax(settings).done(function (response) {\n console.log(response);\n});"
- lang: Node + Native
source: "const http = require(\"https\");\n\nconst options = {\n \"method\": \"GET\",\n \"hostname\": \"weather.api.dtn.com\",\n \"port\": null,\n \"path\": \"/v1/conditions/marine?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE\",\n \"headers\": {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\nconst req = http.request(options, function (res) {\n const chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n const body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n});\n\nreq.end();"
- lang: Node + Request
source: "const request = require('request');\n\nconst options = {\n method: 'GET',\n url: 'https://weather.api.dtn.com/v1/conditions/marine',\n qs: {\n lat: 'SOME_NUMBER_VALUE',\n lon: 'SOME_NUMBER_VALUE',\n startTime: 'SOME_STRING_VALUE',\n endTime: 'SOME_STRING_VALUE',\n parameters: 'SOME_ARRAY_VALUE'\n },\n headers: {\n 'Accept-Encoding': 'SOME_STRING_VALUE',\n Accept: 'SOME_STRING_VALUE',\n Authorization: 'Bearer REPLACE_BEARER_TOKEN'\n }\n};\n\nrequest(options, function (error, response, body) {\n if (error) throw new Error(error);\n\n console.log(body);\n});\n"
- lang: Node + Unirest
source: "const unirest = require(\"unirest\");\n\nconst req = unirest(\"GET\", \"https://weather.api.dtn.com/v1/conditions/marine\");\n\nreq.query({\n \"lat\": \"SOME_NUMBER_VALUE\",\n \"lon\": \"SOME_NUMBER_VALUE\",\n \"startTime\": \"SOME_STRING_VALUE\",\n \"endTime\": \"SOME_STRING_VALUE\",\n \"parameters\": \"SOME_ARRAY_VALUE\"\n});\n\nreq.headers({\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n});\n\nreq.end(function (res) {\n if (res.error) throw new Error(res.error);\n\n console.log(res.body);\n});\n"
- lang: Objc + Nsurlsession
source: "#import \n\nNSDictionary *headers = @{ @\"Accept-Encoding\": @\"SOME_STRING_VALUE\",\n @\"Accept\": @\"SOME_STRING_VALUE\",\n @\"Authorization\": @\"Bearer REPLACE_BEARER_TOKEN\" };\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://weather.api.dtn.com/v1/conditions/marine?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\n[request setHTTPMethod:@\"GET\"];\n[request setAllHTTPHeaderFields:headers];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSLog(@\"%@\", httpResponse);\n }\n }];\n[dataTask resume];"
- lang: Ocaml + Cohttp
source: "open Cohttp_lwt_unix\nopen Cohttp\nopen Lwt\n\nlet uri = Uri.of_string \"https://weather.api.dtn.com/v1/conditions/marine?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE\" in\nlet headers = Header.add_list (Header.init ()) [\n (\"Accept-Encoding\", \"SOME_STRING_VALUE\");\n (\"Accept\", \"SOME_STRING_VALUE\");\n (\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\");\n] in\n\nClient.call ~headers `GET uri\n>>= fun (res, body_stream) ->\n (* Do stuff with the result *)"
- lang: Php + Curl
source: " \"https://weather.api.dtn.com/v1/conditions/marine?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"GET\",\n CURLOPT_HTTPHEADER => [\n \"Accept: SOME_STRING_VALUE\",\n \"Accept-Encoding: SOME_STRING_VALUE\",\n \"Authorization: Bearer REPLACE_BEARER_TOKEN\"\n ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n echo \"cURL Error #:\" . $err;\n} else {\n echo $response;\n}"
- lang: Php + Http1
source: "setUrl('https://weather.api.dtn.com/v1/conditions/marine');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setQueryData([\n 'lat' => 'SOME_NUMBER_VALUE',\n 'lon' => 'SOME_NUMBER_VALUE',\n 'startTime' => 'SOME_STRING_VALUE',\n 'endTime' => 'SOME_STRING_VALUE',\n 'parameters' => 'SOME_ARRAY_VALUE'\n]);\n\n$request->setHeaders([\n 'Accept-Encoding' => 'SOME_STRING_VALUE',\n 'Accept' => 'SOME_STRING_VALUE',\n 'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'\n]);\n\ntry {\n $response = $request->send();\n\n echo $response->getBody();\n} catch (HttpException $ex) {\n echo $ex;\n}"
- lang: Php + Http2
source: "setRequestUrl('https://weather.api.dtn.com/v1/conditions/marine');\n$request->setRequestMethod('GET');\n$request->setQuery(new http\\QueryString([\n 'lat' => 'SOME_NUMBER_VALUE',\n 'lon' => 'SOME_NUMBER_VALUE',\n 'startTime' => 'SOME_STRING_VALUE',\n 'endTime' => 'SOME_STRING_VALUE',\n 'parameters' => 'SOME_ARRAY_VALUE'\n]));\n\n$request->setHeaders([\n 'Accept-Encoding' => 'SOME_STRING_VALUE',\n 'Accept' => 'SOME_STRING_VALUE',\n 'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"
- lang: Python + Python3
source: "import http.client\n\nconn = http.client.HTTPSConnection(\"weather.api.dtn.com\")\n\nheaders = {\n 'Accept-Encoding': \"SOME_STRING_VALUE\",\n 'Accept': \"SOME_STRING_VALUE\",\n 'Authorization': \"Bearer REPLACE_BEARER_TOKEN\"\n }\n\nconn.request(\"GET\", \"/v1/conditions/marine?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"
- lang: Python + Requests
source: "import requests\n\nurl = \"https://weather.api.dtn.com/v1/conditions/marine\"\n\nquerystring = {\"lat\":\"SOME_NUMBER_VALUE\",\"lon\":\"SOME_NUMBER_VALUE\",\"startTime\":\"SOME_STRING_VALUE\",\"endTime\":\"SOME_STRING_VALUE\",\"parameters\":\"SOME_ARRAY_VALUE\"}\n\nheaders = {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\nprint(response.text)"
- lang: Ruby + Native
source: 'require ''uri''
require ''net/http''
require ''openssl''
url = URI("https://weather.api.dtn.com/v1/conditions/marine?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["Accept-Encoding"] = ''SOME_STRING_VALUE''
request["Accept"] = ''SOME_STRING_VALUE''
request["Authorization"] = ''Bearer REPLACE_BEARER_TOKEN''
response = http.request(request)
puts response.read_body'
- lang: Shell + Curl
source: "curl --request GET \\\n --url 'https://weather.api.dtn.com/v1/conditions/marine?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE' \\\n --header 'Accept: SOME_STRING_VALUE' \\\n --header 'Accept-Encoding: SOME_STRING_VALUE' \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'"
- lang: Shell + Httpie
source: "http GET 'https://weather.api.dtn.com/v1/conditions/marine?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE' \\\n Accept:SOME_STRING_VALUE \\\n Accept-Encoding:SOME_STRING_VALUE \\\n Authorization:'Bearer REPLACE_BEARER_TOKEN'"
- lang: Shell + Wget
source: "wget --quiet \\\n --method GET \\\n --header 'Accept-Encoding: SOME_STRING_VALUE' \\\n --header 'Accept: SOME_STRING_VALUE' \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \\\n --output-document \\\n - 'https://weather.api.dtn.com/v1/conditions/marine?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE'"
- lang: Swift + Nsurlsession
source: "import Foundation\n\nlet headers = [\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n]\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://weather.api.dtn.com/v1/conditions/marine?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE\")! as URL,\n cachePolicy: .useProtocolCachePolicy,\n timeoutInterval: 10.0)\nrequest.httpMethod = \"GET\"\nrequest.allHTTPHeaderFields = headers\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n if (error != nil) {\n print(error)\n } else {\n let httpResponse = response as? HTTPURLResponse\n print(httpResponse)\n }\n})\n\ndataTask.resume()"
servers:
- url: https://weather.api.dtn.com
/v1/conditions/marine/route:
post:
tags:
- Endpoints
summary: Marine Route
description: 'This endpoint is designed for complex shipping applications, route planning, and back-track vessel analysis. Submit up to 1000 waypoints and timestamps in a single request body. The API responds with the marine weather conditions for each location and timestamp pair in GeoJSON format.
Quota calculation: Please note that the quota charged is based on the number of locations or waypoints in your API requests, and not the number of requests. One request with 1000 locations uses the same API quota as 1000 requests with one location each.
'
operationId: marineRoute
security:
- clientCredentials: []
parameters:
- in: header
name: Accept-Encoding
schema:
type: string
description: Use this request header to communicate which compression algorithms the client understands. The API supports gzip.
example: gzip
- in: header
name: Accept
schema:
type: string
description: Use this request header to specify an acceptable response media type.
example: application/json
- name: parameters
in: query
style: form
explode: true
schema:
type: array
items:
type: string
example: airTemp,seaSurfaceTemp,windSpeed10m
requestBody:
required: true
content:
application/json:
schema:
type: array
items:
type: object
required:
- timestamp
- lat
- lon
properties:
timestamp:
type: string
format: date-time
lat:
type: number
format: float
lon:
type: number
format: float
parameters:
type: array
items:
type: string
example:
- timestamp: '2023-08-10T16:00:00Z'
lat: 55.81
lon: 3.88
parameters:
- airPressureMeanSeaLevel
- airTemp
- airTemp10m
- dewPoint
- lightningProb
- maximumWaveHeight
- meanWaveDirection
- meanWaveDirectionalSpreading
- meanWavePeriodTm02
- meanWavePeriodTmm10
- peakPeriod
- precipAmount1h
- precipProb
- relativeHumidity
- seaIceConcentration
- seaSurfaceTemp
- significantWaveHeight
- significantWaveHeightRiskP90
- totalCurrentDirection
- totalCurrentVelocity
- totalSwellMeanWaveDirection
- totalSwellMeanWaveDirectionalSpreading
- totalSwellMeanWavePeriodTm02
- totalSwellMeanWavePeriodTmm10
- totalSwellPeakPeriod
- totalSwellSignificantWaveHeight
- visibility
- weatherCode
- windDirection100m
- windDirection10m
- windDirection50m
- windGust100m
- windGust10m
- windGust50m
- windSpeed100m
- windSpeed10m
- windSpeed50m
- windWaveMeanWaveDirection
- windWaveMeanWaveDirectionalSpreading
- windWaveMeanWavePeriodTm02
- windWaveMeanWavePeriodTmm10
- windWavePeakPeriod
- windWaveSignificantWaveHeight
- timestamp: '2023-08-10T17:00:00Z'
lat: 57.48
lon: 2.49
parameters:
- airPressureMeanSeaLevel
- airTemp
- airTemp10m
- dewPoint
- lightningProb
- maximumWaveHeight
- meanWaveDirection
- meanWaveDirectionalSpreading
- meanWavePeriodTm02
- meanWavePeriodTmm10
- peakPeriod
- precipAmount1h
- precipProb
- relativeHumidity
- seaIceConcentration
- seaSurfaceTemp
- significantWaveHeight
- significantWaveHeightRiskP90
- totalCurrentDirection
- totalCurrentVelocity
- totalSwellMeanWaveDirection
- totalSwellMeanWaveDirectionalSpreading
- totalSwellMeanWavePeriodTm02
- totalSwellMeanWavePeriodTmm10
- totalSwellPeakPeriod
- totalSwellSignificantWaveHeight
- visibility
- weatherCode
- windDirection100m
- windDirection10m
- windDirection50m
- windGust100m
- windGust10m
- windGust50m
- windSpeed100m
- windSpeed10m
- windSpeed50m
- windWaveMeanWaveDirection
- windWaveMeanWaveDirectionalSpreading
- windWaveMeanWavePeriodTm02
- windWaveMeanWavePeriodTmm10
- windWavePeakPeriod
- windWaveSignificantWaveHeight
responses:
'200':
description: A successful request.
content:
application/json:
schema:
oneOf:
- type: object
properties:
url:
type: string
type:
type: string
features:
type: array
items:
type: object
properties:
type:
type: string
geometry:
type: object
properties:
type:
type: string
coordinates:
type: array
items:
type: number
properties:
type: object
properties:
'2023-06-30T10:00:00Z':
type: object
properties:
airPressureMeanSeaLevel:
type: number
airTemp:
type: number
airTemp10m:
type: number
dewPoint:
type: number
lightningProb:
type: number
maximumWaveHeight:
type: number
meanWaveDirection:
type: number
meanWaveDirectionalSpreading:
type: number
meanWavePeriodTm02:
type: number
meanWavePeriodTmm10:
type: number
peakPeriod:
type: number
precipAmount1h:
type: number
precipProb:
type: number
relativeHumidity:
type: number
seaIceConcentration:
type: number
seaSurfaceTemp:
type: number
significantWaveHeight:
type: number
significantWaveHeightRiskP90:
type: number
totalCurrentDirection:
type: number
totalCurrentVelocity:
type: number
totalSwellMeanWaveDirection:
type: number
totalSwellMeanWaveDirectionalSpreading:
type: number
totalSwellMeanWavePeriodTm02:
type: number
totalSwellMeanWavePeriodTmm10:
type: number
totalSwellPeakPeriod:
type: number
totalSwellSignificantWaveHeight:
type: number
visibility:
type: number
weatherCode:
type: number
windDirection100m:
type: number
windDirection10m:
type: number
windDirection50m:
type: number
windGust100m:
type: number
windGust10m:
type: number
windGust50m:
type: number
windSpeed100m:
type: number
windSpeed10m:
type: number
windSpeed50m:
type: number
windWaveMeanWaveDirection:
type: number
windWaveMeanWaveDirectionalSpreading:
type: number
windWaveMeanWavePeriodTm02:
type: number
windWaveMeanWavePeriodTmm10:
type: number
windWavePeakPeriod:
type: number
windWaveSignificantWaveHeight:
type: number
example:
url: https://weather.api.dtn.com/v1/conditions/marine?lat=55.81&lon=3.88¶meters=airPressureMeanSeaLevel,airTemp,airTemp10m,dewPoint,lightningProb,maximumWaveHeight,meanWaveDirection,meanWaveDirectionalSpreading,meanWavePeriodTm02,meanWavePeriodTmm10,peakPeriod,precipAmount1h,precipProb,relativeHumidity,seaIceConcentration,seaSurfaceTemp,significantWaveHeight,significantWaveHeightRiskP90,totalCurrentDirection,totalCurrentVelocity,totalSwellMeanWaveDirection,totalSwellMeanWaveDirectionalSpreading,totalSwellMeanWavePeriodTm02,totalSwellMeanWavePeriodTmm10,totalSwellPeakPeriod,totalSwellSignificantWaveHeight,visibility,weatherCode,windDirection100m,windDirection10m,windDirection50m,windGust100m,windGust10m,windGust50m,windSpeed100m,windSpeed10m,windSpeed50m,windWaveMeanWaveDirection,windWaveMeanWaveDirectionalSpreading,windWaveMeanWavePeriodTm02,windWaveMeanWavePeriodTmm10,windWavePeakPeriod,windWaveSignificantWaveHeight,seaSurfaceHeightAnomalyAstronomic,seaSurfaceHeightAnomalyResidual,seaSurfaceHeightAnomalyTotal&startTime=2023-08-11T16:13:53Z&endTime=2023-08-11T19:13:53Z
type: FeatureCollection
features:
- type: Feature
geometry:
type: Point
coordinates:
- 3.88
- 55.81
properties:
'2023-08-11T16:00:00Z':
airPressureMeanSeaLevel: 1014.4
airTemp: 16.7
airTemp10m: 16.65
dewPoint: 15.6
lightningProb: 0
maximumWaveHeight: 2.06
meanWaveDirection: 259.95
meanWaveDirectionalSpreading: 64.07
meanWavePeriodTm02: 4.4
meanWavePeriodTmm10: 5.9
peakPeriod: 9.15
precipAmount1h: 0
precipProb: 0
relativeHumidity: 93
seaIceConcentration: 0
seaSurfaceTemp: 15.15
significantWaveHeight: 1.24
significantWaveHeightRiskP90: 1.35
totalCurrentDirection: 96.25
totalCurrentVelocity: 0.29
totalSwellMeanWaveDirection: 343.95
totalSwellMeanWaveDirectionalSpreading: 20.99
totalSwellMeanWavePeriodTm02: 7.25
totalSwellMeanWavePeriodTmm10: 8.25
totalSwellPeakPeriod: 9.15
totalSwellSignificantWaveHeight: 0.78
visibility: 24.04
weatherCode: 1
windDirection100m: 229
windDirection10m: 223
windDirection50m: 226
windGust100m: 11.4
windGust10m: 8.7
windGust50m: 10.6
windSpeed100m: 9.4
windSpeed10m: 6.7
windSpeed50m: 8.6
windWaveMeanWaveDirection: 211.75
windWaveMeanWaveDirectionalSpreading: 31.86
windWaveMeanWavePeriodTm02: 3.65
windWaveMeanWavePeriodTmm10: 4.25
windWavePeakPeriod: 4.7
windWaveSignificantWaveHeight: 0.95
seaSurfaceHeightAnomalyAstronomic: 0.06
seaSurfaceHeightAnomalyResidual: -0.01
seaSurfaceHeightAnomalyTotal: 0.04
'2023-08-11T17:00:00Z':
airPressureMeanSeaLevel: 1014.5
airTemp: 16.75
airTemp10m: 16.7
dewPoint: 15.6
lightningProb: 0
maximumWaveHeight: 2
meanWaveDirection: 257.85
meanWaveDirectionalSpreading: 63.72
meanWavePeriodTm02: 4.35
meanWavePeriodTmm10: 5.85
peakPeriod: 9.15
precipAmount1h: 0
precipProb: 0
relativeHumidity: 93
seaIceConcentration: 0
seaSurfaceTemp: 15.15
significantWaveHeight: 1.19
significantWaveHeightRiskP90: 1.31
totalCurrentDirection: 104.2
totalCurrentVelocity: 0.25
totalSwellMeanWaveDirection: 343.85
totalSwellMeanWaveDirectionalSpreading: 24.43
totalSwellMeanWavePeriodTm02: 7.2
totalSwellMeanWavePeriodTmm10: 8.2
totalSwellPeakPeriod: 9.15
totalSwellSignificantWaveHeight: 0.76
visibility: 24.43
weatherCode: 1
windDirection100m: 230
windDirection10m: 222
windDirection50m: 226
windGust100m: 11.05
windGust10m: 8.45
windGust50m: 10.25
windSpeed100m: 9.05
windSpeed10m: 6.45
windSpeed50m: 8.25
windWaveMeanWaveDirection: 212.4
windWaveMeanWaveDirectionalSpreading: 31.88
windWaveMeanWavePeriodTm02: 3.65
windWaveMeanWavePeriodTmm10: 4.25
windWavePeakPeriod: 4.7
windWaveSignificantWaveHeight: 0.93
seaSurfaceHeightAnomalyAstronomic: 0.15
seaSurfaceHeightAnomalyResidual: -0.03
seaSurfaceHeightAnomalyTotal: 0.13
'2023-08-11T18:00:00Z':
airPressureMeanSeaLevel: 1014.4
airTemp: 16.75
airTemp10m: 16.7
dewPoint: 15.55
lightningProb: 0
maximumWaveHeight: 1.93
meanWaveDirection: 255.65
meanWaveDirectionalSpreading: 63.6
meanWavePeriodTm02: 4.35
meanWavePeriodTmm10: 5.8
peakPeriod: 9.15
precipAmount1h: 0
precipProb: 0
relativeHumidity: 92.5
seaIceConcentration: 0
seaSurfaceTemp: 15.15
significantWaveHeight: 1.16
significantWaveHeightRiskP90: 1.27
totalCurrentDirection: 115.55
totalCurrentVelocity: 0.2
totalSwellMeanWaveDirection: 343.65
totalSwellMeanWaveDirectionalSpreading: 28.13
totalSwellMeanWavePeriodTm02: 7.15
totalSwellMeanWavePeriodTmm10: 8.15
totalSwellPeakPeriod: 9.15
totalSwellSignificantWaveHeight: 0.73
visibility: 24.05
weatherCode: 1
windDirection100m: 228
windDirection10m: 224
windDirection50m: 226
windGust100m: 10.8
windGust10m: 8.45
windGust50m: 10.1
windSpeed100m: 8.7
windSpeed10m: 6.35
windSpeed50m: 8
windWaveMeanWaveDirection: 212.5
windWaveMeanWaveDirectionalSpreading: 31.97
windWaveMeanWavePeriodTm02: 3.65
windWaveMeanWavePeriodTmm10: 4.25
windWavePeakPeriod: 4.7
windWaveSignificantWaveHeight: 0.9
seaSurfaceHeightAnomalyAstronomic: -0.04
seaSurfaceHeightAnomalyResidual: -0.01
seaSurfaceHeightAnomalyTotal: -0.06
'2023-08-11T19:00:00Z':
airPressureMeanSeaLevel: 1014.6
airTemp: 16.7
airTemp10m: 16.65
dewPoint: 15.5
lightningProb: 0
maximumWaveHeight: 1.87
meanWaveDirection: 254.4
meanWaveDirectionalSpreading: 63.82
meanWavePeriodTm02: 4.3
meanWavePeriodTmm10: 5.75
peakPeriod: 9.15
precipAmount1h: 0
precipProb: 0
relativeHumidity: 92.5
seaIceConcentration: 0
seaSurfaceTemp: 15.05
significantWaveHeight: 1.12
significantWaveHeightRiskP90: 1.23
totalCurrentDirection: 133.05
totalCurrentVelocity: 0.14
totalSwellMeanWaveDirection: 342.45
totalSwellMeanWaveDirectionalSpreading: 31.18
totalSwellMeanWavePeriodTm02: 7.05
totalSwellMeanWavePeriodTmm10: 8.1
totalSwellPeakPeriod: 9.15
totalSwellSignificantWaveHeight: 0.71
visibility: 24.06
weatherCode: 1
windDirection100m: 223
windDirection10m: 216
windDirection50m: 220
windGust100m: 10.05
windGust10m: 7.65
windGust50m: 9.35
windSpeed100m: 8.35
windSpeed10m: 5.95
windSpeed50m: 7.65
windWaveMeanWaveDirection: 211.35
windWaveMeanWaveDirectionalSpreading: 32
windWaveMeanWavePeriodTm02: 3.65
windWaveMeanWavePeriodTmm10: 4.2
windWavePeakPeriod: 4.7
windWaveSignificantWaveHeight: 0.86
seaSurfaceHeightAnomalyAstronomic: -0.13
seaSurfaceHeightAnomalyResidual: -0.04
seaSurfaceHeightAnomalyTotal: -0.16
'400':
description: An invalid request.
content:
application/problem+json:
schema:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: false
example:
type: bad-request
title: Invalid Request
detail: Validation failed.
status: 400
instance: urn:dtn:one-marine-weather-service:/v1/conditions/marine:requestId:123e4567-e89b-12d3-a458-426614176000
'401':
description: Unable to authenticate credentials.
content:
application/problem+json:
schema:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: false
example:
type: unauthorized
title: Error while authenticating the user.
detail: invalid token
status: 401
instance: urn:dtn:one-marine-weather-service:/v1/conditions/marine:requestId:123e4567-e89b-12d3-a458-426614176000
'406':
description: Unable to produce a response matching the Accept request header.
content:
application/problem+json:
schema:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: false
example:
type: not-acceptable
title: Not Acceptable
detail: The Accept header value is invalid or unsupported.
status: 406
instance: urn:dtn:one-marine-weather-service:/v1/conditions/marine:requestId:123e4567-e89b-12d3-a458-426614176000
x-codeSamples:
- lang: C + Libcurl
source: 'CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "https://weather.api.dtn.com/v1/conditions/marine/route?parameters=SOME_ARRAY_VALUE");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
headers = curl_slist_append(headers, "Accept-Encoding: SOME_STRING_VALUE");
headers = curl_slist_append(headers, "Accept: SOME_STRING_VALUE");
headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "[{\"timestamp\":\"2023-08-10T16:00:00Z\",\"lat\":55.81,\"lon\":3.88,\"parameters\":[\"airPressureMeanSeaLevel\",\"airTemp\",\"airTemp10m\",\"dewPoint\",\"lightningProb\",\"maximumWaveHeight\",\"meanWaveDirection\",\"meanWaveDirectionalSpreading\",\"meanWavePeriodTm02\",\"meanWavePeriodTmm10\",\"peakPeriod\",\"precipAmount1h\",\"precipProb\",\"relativeHumidity\",\"seaIceConcentration\",\"seaSurfaceTemp\",\"significantWaveHeight\",\"significantWaveHeightRiskP90\",\"totalCurrentDirection\",\"totalCurrentVelocity\",\"totalSwellMeanWaveDirection\",\"totalSwellMeanWaveDirectionalSpreading\",\"totalSwellMeanWavePeriodTm02\",\"totalSwellMeanWavePeriodTmm10\",\"totalSwellPeakPeriod\",\"totalSwellSignificantWaveHeight\",\"visibility\",\"weatherCode\",\"windDirection100m\",\"windDirection10m\",\"windDirection50m\",\"windGust100m\",\"windGust10m\",\"windGust50m\",\"windSpeed100m\",\"windSpeed10m\",\"windSpeed50m\",\"windWaveMeanWaveDirection\",\"windWaveMeanWaveDirectionalSpreading\",\"windWaveMeanWavePeriodTm02\",\"windWaveMeanWavePeriodTmm10\",\"windWavePeakPeriod\",\"windWaveSignificantWaveHeight\"]},{\"timestamp\":\"2023-08-10T17:00:00Z\",\"lat\":57.48,\"lon\":2.49,\"parameters\":[\"airPressureMeanSeaLevel\",\"airTemp\",\"airTemp10m\",\"dewPoint\",\"lightningProb\",\"maximumWaveHeight\",\"meanWaveDirection\",\"meanWaveDirectionalSpreading\",\"meanWavePeriodTm02\",\"meanWavePeriodTmm10\",\"peakPeriod\",\"precipAmount1h\",\"precipProb\",\"relativeHumidity\",\"seaIceConcentration\",\"seaSurfaceTemp\",\"significantWaveHeight\",\"significantWaveHeightRiskP90\",\"totalCurrentDirection\",\"totalCurrentVelocity\",\"totalSwellMeanWaveDirection\",\"totalSwellMeanWaveDirectionalSpreading\",\"totalSwellMeanWavePeriodTm02\",\"totalSwellMeanWavePeriodTmm10\",\"totalSwellPeakPeriod\",\"totalSwellSignificantWaveHeight\",\"visibility\",\"weatherCode\",\"windDirection100m\",\"windDirection10m\",\"windDirection50m\",\"windGust100m\",\"windGust10m\",\"windGust50m\",\"windSpeed100m\",\"windSpeed10m\",\"windSpeed50m\",\"windWaveMeanWaveDirection\",\"windWaveMeanWaveDirectionalSpreading\",\"windWaveMeanWavePeriodTm02\",\"windWaveMeanWavePeriodTmm10\",\"windWavePeakPeriod\",\"windWaveSignificantWaveHeight\"]}]");
CURLcode ret = curl_easy_perform(hnd);'
- lang: Csharp + Restsharp
source: 'var client = new RestClient("https://weather.api.dtn.com/v1/conditions/marine/route?parameters=SOME_ARRAY_VALUE");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/json");
request.AddHeader("Accept-Encoding", "SOME_STRING_VALUE");
request.AddHeader("Accept", "SOME_STRING_VALUE");
request.AddHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
request.AddParameter("application/json", "[{\"timestamp\":\"2023-08-10T16:00:00Z\",\"lat\":55.81,\"lon\":3.88,\"parameters\":[\"airPressureMeanSeaLevel\",\"airTemp\",\"airTemp10m\",\"dewPoint\",\"lightningProb\",\"maximumWaveHeight\",\"meanWaveDirection\",\"meanWaveDirectionalSpreading\",\"meanWavePeriodTm02\",\"meanWavePeriodTmm10\",\"peakPeriod\",\"precipAmount1h\",\"precipProb\",\"relativeHumidity\",\"seaIceConcentration\",\"seaSurfaceTemp\",\"significantWaveHeight\",\"significantWaveHeightRiskP90\",\"totalCurrentDirection\",\"totalCurrentVelocity\",\"totalSwellMeanWaveDirection\",\"totalSwellMeanWaveDirectionalSpreading\",\"totalSwellMeanWavePeriodTm02\",\"totalSwellMeanWavePeriodTmm10\",\"totalSwellPeakPeriod\",\"totalSwellSignificantWaveHeight\",\"visibility\",\"weatherCode\",\"windDirection100m\",\"windDirection10m\",\"windDirection50m\",\"windGust100m\",\"windGust10m\",\"windGust50m\",\"windSpeed100m\",\"windSpeed10m\",\"windSpeed50m\",\"windWaveMeanWaveDirection\",\"windWaveMeanWaveDirectionalSpreading\",\"windWaveMeanWavePeriodTm02\",\"windWaveMeanWavePeriodTmm10\",\"windWavePeakPeriod\",\"windWaveSignificantWaveHeight\"]},{\"timestamp\":\"2023-08-10T17:00:00Z\",\"lat\":57.48,\"lon\":2.49,\"parameters\":[\"airPressureMeanSeaLevel\",\"airTemp\",\"airTemp10m\",\"dewPoint\",\"lightningProb\",\"maximumWaveHeight\",\"meanWaveDirection\",\"meanWaveDirectionalSpreading\",\"meanWavePeriodTm02\",\"meanWavePeriodTmm10\",\"peakPeriod\",\"precipAmount1h\",\"precipProb\",\"relativeHumidity\",\"seaIceConcentration\",\"seaSurfaceTemp\",\"significantWaveHeight\",\"significantWaveHeightRiskP90\",\"totalCurrentDirection\",\"totalCurrentVelocity\",\"totalSwellMeanWaveDirection\",\"totalSwellMeanWaveDirectionalSpreading\",\"totalSwellMeanWavePeriodTm02\",\"totalSwellMeanWavePeriodTmm10\",\"totalSwellPeakPeriod\",\"totalSwellSignificantWaveHeight\",\"visibility\",\"weatherCode\",\"windDirection100m\",\"windDirection10m\",\"windDirection50m\",\"windGust100m\",\"windGust10m\",\"windGust50m\",\"windSpeed100m\",\"windSpeed10m\",\"windSpeed50m\",\"windWaveMeanWaveDirection\",\"windWaveMeanWaveDirectionalSpreading\",\"windWaveMeanWavePeriodTm02\",\"windWaveMeanWavePeriodTmm10\",\"windWavePeakPeriod\",\"windWaveSignificantWaveHeight\"]}]", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);'
- lang: Go + Native
source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://weather.api.dtn.com/v1/conditions/marine/route?parameters=SOME_ARRAY_VALUE\"\n\n\tpayload := strings.NewReader(\"[{\\\"timestamp\\\":\\\"2023-08-10T16:00:00Z\\\",\\\"lat\\\":55.81,\\\"lon\\\":3.88,\\\"parameters\\\":[\\\"airPressureMeanSeaLevel\\\",\\\"airTemp\\\",\\\"airTemp10m\\\",\\\"dewPoint\\\",\\\"lightningProb\\\",\\\"maximumWaveHeight\\\",\\\"meanWaveDirection\\\",\\\"meanWaveDirectionalSpreading\\\",\\\"meanWavePeriodTm02\\\",\\\"meanWavePeriodTmm10\\\",\\\"peakPeriod\\\",\\\"precipAmount1h\\\",\\\"precipProb\\\",\\\"relativeHumidity\\\",\\\"seaIceConcentration\\\",\\\"seaSurfaceTemp\\\",\\\"significantWaveHeight\\\",\\\"significantWaveHeightRiskP90\\\",\\\"totalCurrentDirection\\\",\\\"totalCurrentVelocity\\\",\\\"totalSwellMeanWaveDirection\\\",\\\"totalSwellMeanWaveDirectionalSpreading\\\",\\\"totalSwellMeanWavePeriodTm02\\\",\\\"totalSwellMeanWavePeriodTmm10\\\",\\\"totalSwellPeakPeriod\\\",\\\"totalSwellSignificantWaveHeight\\\",\\\"visibility\\\",\\\"weatherCode\\\",\\\"windDirection100m\\\",\\\"windDirection10m\\\",\\\"windDirection50m\\\",\\\"windGust100m\\\",\\\"windGust10m\\\",\\\"windGust50m\\\",\\\"windSpeed100m\\\",\\\"windSpeed10m\\\",\\\"windSpeed50m\\\",\\\"windWaveMeanWaveDirection\\\",\\\"windWaveMeanWaveDirectionalSpreading\\\",\\\"windWaveMeanWavePeriodTm02\\\",\\\"windWaveMeanWavePeriodTmm10\\\",\\\"windWavePeakPeriod\\\",\\\"windWaveSignificantWaveHeight\\\"]},{\\\"timestamp\\\":\\\"2023-08-10T17:00:00Z\\\",\\\"lat\\\":57.48,\\\"lon\\\":2.49,\\\"parameters\\\":[\\\"airPressureMeanSeaLevel\\\",\\\"airTemp\\\",\\\"airTemp10m\\\",\\\"dewPoint\\\",\\\"lightningProb\\\",\\\"maximumWaveHeight\\\",\\\"meanWaveDirection\\\",\\\"meanWaveDirectionalSpreading\\\",\\\"meanWavePeriodTm02\\\",\\\"meanWavePeriodTmm10\\\",\\\"peakPeriod\\\",\\\"precipAmount1h\\\",\\\"precipProb\\\",\\\"relativeHumidity\\\",\\\"seaIceConcentration\\\",\\\"seaSurfaceTemp\\\",\\\"significantWaveHeight\\\",\\\"significantWaveHeightRiskP90\\\",\\\"totalCurrentDirection\\\",\\\"totalCurrentVelocity\\\",\\\"totalSwellMeanWaveDirection\\\",\\\"totalSwellMeanWaveDirectionalSpreading\\\",\\\"totalSwellMeanWavePeriodTm02\\\",\\\"totalSwellMeanWavePeriodTmm10\\\",\\\"totalSwellPeakPeriod\\\",\\\"totalSwellSignificantWaveHeight\\\",\\\"visibility\\\",\\\"weatherCode\\\",\\\"windDirection100m\\\",\\\"windDirection10m\\\",\\\"windDirection50m\\\",\\\"windGust100m\\\",\\\"windGust10m\\\",\\\"windGust50m\\\",\\\"windSpeed100m\\\",\\\"windSpeed10m\\\",\\\"windSpeed50m\\\",\\\"windWaveMeanWaveDirection\\\",\\\"windWaveMeanWaveDirectionalSpreading\\\",\\\"windWaveMeanWavePeriodTm02\\\",\\\"windWaveMeanWavePeriodTmm10\\\",\\\"windWavePeakPeriod\\\",\\\"windWaveSignificantWaveHeight\\\"]}]\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"content-type\", \"application/json\")\n\treq.Header.Add(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n\treq.Header.Add(\"Accept\", \"SOME_STRING_VALUE\")\n\treq.Header.Add(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
- lang: Java + Okhttp
source: "OkHttpClient client = new OkHttpClient();\n\nMediaType mediaType = MediaType.parse(\"application/json\");\nRequestBody body = RequestBody.create(mediaType, \"[{\\\"timestamp\\\":\\\"2023-08-10T16:00:00Z\\\",\\\"lat\\\":55.81,\\\"lon\\\":3.88,\\\"parameters\\\":[\\\"airPressureMeanSeaLevel\\\",\\\"airTemp\\\",\\\"airTemp10m\\\",\\\"dewPoint\\\",\\\"lightningProb\\\",\\\"maximumWaveHeight\\\",\\\"meanWaveDirection\\\",\\\"meanWaveDirectionalSpreading\\\",\\\"meanWavePeriodTm02\\\",\\\"meanWavePeriodTmm10\\\",\\\"peakPeriod\\\",\\\"precipAmount1h\\\",\\\"precipProb\\\",\\\"relativeHumidity\\\",\\\"seaIceConcentration\\\",\\\"seaSurfaceTemp\\\",\\\"significantWaveHeight\\\",\\\"significantWaveHeightRiskP90\\\",\\\"totalCurrentDirection\\\",\\\"totalCurrentVelocity\\\",\\\"totalSwellMeanWaveDirection\\\",\\\"totalSwellMeanWaveDirectionalSpreading\\\",\\\"totalSwellMeanWavePeriodTm02\\\",\\\"totalSwellMeanWavePeriodTmm10\\\",\\\"totalSwellPeakPeriod\\\",\\\"totalSwellSignificantWaveHeight\\\",\\\"visibility\\\",\\\"weatherCode\\\",\\\"windDirection100m\\\",\\\"windDirection10m\\\",\\\"windDirection50m\\\",\\\"windGust100m\\\",\\\"windGust10m\\\",\\\"windGust50m\\\",\\\"windSpeed100m\\\",\\\"windSpeed10m\\\",\\\"windSpeed50m\\\",\\\"windWaveMeanWaveDirection\\\",\\\"windWaveMeanWaveDirectionalSpreading\\\",\\\"windWaveMeanWavePeriodTm02\\\",\\\"windWaveMeanWavePeriodTmm10\\\",\\\"windWavePeakPeriod\\\",\\\"windWaveSignificantWaveHeight\\\"]},{\\\"timestamp\\\":\\\"2023-08-10T17:00:00Z\\\",\\\"lat\\\":57.48,\\\"lon\\\":2.49,\\\"parameters\\\":[\\\"airPressureMeanSeaLevel\\\",\\\"airTemp\\\",\\\"airTemp10m\\\",\\\"dewPoint\\\",\\\"lightningProb\\\",\\\"maximumWaveHeight\\\",\\\"meanWaveDirection\\\",\\\"meanWaveDirectionalSpreading\\\",\\\"meanWavePeriodTm02\\\",\\\"meanWavePeriodTmm10\\\",\\\"peakPeriod\\\",\\\"precipAmount1h\\\",\\\"precipProb\\\",\\\"relativeHumidity\\\",\\\"seaIceConcentration\\\",\\\"seaSurfaceTemp\\\",\\\"significantWaveHeight\\\",\\\"significantWaveHeightRiskP90\\\",\\\"totalCurrentDirection\\\",\\\"totalCurrentVelocity\\\",\\\"totalSwellMeanWaveDirection\\\",\\\"totalSwellMeanWaveDirectionalSpreading\\\",\\\"totalSwellMeanWavePeriodTm02\\\",\\\"totalSwellMeanWavePeriodTmm10\\\",\\\"totalSwellPeakPeriod\\\",\\\"totalSwellSignificantWaveHeight\\\",\\\"visibility\\\",\\\"weatherCode\\\",\\\"windDirection100m\\\",\\\"windDirection10m\\\",\\\"windDirection50m\\\",\\\"windGust100m\\\",\\\"windGust10m\\\",\\\"windGust50m\\\",\\\"windSpeed100m\\\",\\\"windSpeed10m\\\",\\\"windSpeed50m\\\",\\\"windWaveMeanWaveDirection\\\",\\\"windWaveMeanWaveDirectionalSpreading\\\",\\\"windWaveMeanWavePeriodTm02\\\",\\\"windWaveMeanWavePeriodTmm10\\\",\\\"windWavePeakPeriod\\\",\\\"windWaveSignificantWaveHeight\\\"]}]\");\nRequest request = new Request.Builder()\n .url(\"https://weather.api.dtn.com/v1/conditions/marine/route?parameters=SOME_ARRAY_VALUE\")\n .post(body)\n .addHeader(\"content-type\", \"application/json\")\n .addHeader(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n .addHeader(\"Accept\", \"SOME_STRING_VALUE\")\n .addHeader(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n .build();\n\nResponse response = client.newCall(request).execute();"
- lang: Java + Unirest
source: "HttpResponse response = Unirest.post(\"https://weather.api.dtn.com/v1/conditions/marine/route?parameters=SOME_ARRAY_VALUE\")\n .header(\"content-type\", \"application/json\")\n .header(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n .header(\"Accept\", \"SOME_STRING_VALUE\")\n .header(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n .body(\"[{\\\"timestamp\\\":\\\"2023-08-10T16:00:00Z\\\",\\\"lat\\\":55.81,\\\"lon\\\":3.88,\\\"parameters\\\":[\\\"airPressureMeanSeaLevel\\\",\\\"airTemp\\\",\\\"airTemp10m\\\",\\\"dewPoint\\\",\\\"lightningProb\\\",\\\"maximumWaveHeight\\\",\\\"meanWaveDirection\\\",\\\"meanWaveDirectionalSpreading\\\",\\\"meanWavePeriodTm02\\\",\\\"meanWavePeriodTmm10\\\",\\\"peakPeriod\\\",\\\"precipAmount1h\\\",\\\"precipProb\\\",\\\"relativeHumidity\\\",\\\"seaIceConcentration\\\",\\\"seaSurfaceTemp\\\",\\\"significantWaveHeight\\\",\\\"significantWaveHeightRiskP90\\\",\\\"totalCurrentDirection\\\",\\\"totalCurrentVelocity\\\",\\\"totalSwellMeanWaveDirection\\\",\\\"totalSwellMeanWaveDirectionalSpreading\\\",\\\"totalSwellMeanWavePeriodTm02\\\",\\\"totalSwellMeanWavePeriodTmm10\\\",\\\"totalSwellPeakPeriod\\\",\\\"totalSwellSignificantWaveHeight\\\",\\\"visibility\\\",\\\"weatherCode\\\",\\\"windDirection100m\\\",\\\"windDirection10m\\\",\\\"windDirection50m\\\",\\\"windGust100m\\\",\\\"windGust10m\\\",\\\"windGust50m\\\",\\\"windSpeed100m\\\",\\\"windSpeed10m\\\",\\\"windSpeed50m\\\",\\\"windWaveMeanWaveDirection\\\",\\\"windWaveMeanWaveDirectionalSpreading\\\",\\\"windWaveMeanWavePeriodTm02\\\",\\\"windWaveMeanWavePeriodTmm10\\\",\\\"windWavePeakPeriod\\\",\\\"windWaveSignificantWaveHeight\\\"]},{\\\"timestamp\\\":\\\"2023-08-10T17:00:00Z\\\",\\\"lat\\\":57.48,\\\"lon\\\":2.49,\\\"parameters\\\":[\\\"airPressureMeanSeaLevel\\\",\\\"airTemp\\\",\\\"airTemp10m\\\",\\\"dewPoint\\\",\\\"lightningProb\\\",\\\"maximumWaveHeight\\\",\\\"meanWaveDirection\\\",\\\"meanWaveDirectionalSpreading\\\",\\\"meanWavePeriodTm02\\\",\\\"meanWavePeriodTmm10\\\",\\\"peakPeriod\\\",\\\"precipAmount1h\\\",\\\"precipProb\\\",\\\"relativeHumidity\\\",\\\"seaIceConcentration\\\",\\\"seaSurfaceTemp\\\",\\\"significantWaveHeight\\\",\\\"significantWaveHeightRiskP90\\\",\\\"totalCurrentDirection\\\",\\\"totalCurrentVelocity\\\",\\\"totalSwellMeanWaveDirection\\\",\\\"totalSwellMeanWaveDirectionalSpreading\\\",\\\"totalSwellMeanWavePeriodTm02\\\",\\\"totalSwellMeanWavePeriodTmm10\\\",\\\"totalSwellPeakPeriod\\\",\\\"totalSwellSignificantWaveHeight\\\",\\\"visibility\\\",\\\"weatherCode\\\",\\\"windDirection100m\\\",\\\"windDirection10m\\\",\\\"windDirection50m\\\",\\\"windGust100m\\\",\\\"windGust10m\\\",\\\"windGust50m\\\",\\\"windSpeed100m\\\",\\\"windSpeed10m\\\",\\\"windSpeed50m\\\",\\\"windWaveMeanWaveDirection\\\",\\\"windWaveMeanWaveDirectionalSpreading\\\",\\\"windWaveMeanWavePeriodTm02\\\",\\\"windWaveMeanWavePeriodTmm10\\\",\\\"windWavePeakPeriod\\\",\\\"windWaveSignificantWaveHeight\\\"]}]\")\n .asString();"
- lang: Javascript + Jquery
source: "const settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://weather.api.dtn.com/v1/conditions/marine/route?parameters=SOME_ARRAY_VALUE\",\n \"method\": \"POST\",\n \"headers\": {\n \"content-type\": \"application/json\",\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n },\n \"processData\": false,\n \"data\": \"[{\\\"timestamp\\\":\\\"2023-08-10T16:00:00Z\\\",\\\"lat\\\":55.81,\\\"lon\\\":3.88,\\\"parameters\\\":[\\\"airPressureMeanSeaLevel\\\",\\\"airTemp\\\",\\\"airTemp10m\\\",\\\"dewPoint\\\",\\\"lightningProb\\\",\\\"maximumWaveHeight\\\",\\\"meanWaveDirection\\\",\\\"meanWaveDirectionalSpreading\\\",\\\"meanWavePeriodTm02\\\",\\\"meanWavePeriodTmm10\\\",\\\"peakPeriod\\\",\\\"precipAmount1h\\\",\\\"precipProb\\\",\\\"relativeHumidity\\\",\\\"seaIceConcentration\\\",\\\"seaSurfaceTemp\\\",\\\"significantWaveHeight\\\",\\\"significantWaveHeightRiskP90\\\",\\\"totalCurrentDirection\\\",\\\"totalCurrentVelocity\\\",\\\"totalSwellMeanWaveDirection\\\",\\\"totalSwellMeanWaveDirectionalSpreading\\\",\\\"totalSwellMeanWavePeriodTm02\\\",\\\"totalSwellMeanWavePeriodTmm10\\\",\\\"totalSwellPeakPeriod\\\",\\\"totalSwellSignificantWaveHeight\\\",\\\"visibility\\\",\\\"weatherCode\\\",\\\"windDirection100m\\\",\\\"windDirection10m\\\",\\\"windDirection50m\\\",\\\"windGust100m\\\",\\\"windGust10m\\\",\\\"windGust50m\\\",\\\"windSpeed100m\\\",\\\"windSpeed10m\\\",\\\"windSpeed50m\\\",\\\"windWaveMeanWaveDirection\\\",\\\"windWaveMeanWaveDirectionalSpreading\\\",\\\"windWaveMeanWavePeriodTm02\\\",\\\"windWaveMeanWavePeriodTmm10\\\",\\\"windWavePeakPeriod\\\",\\\"windWaveSignificantWaveHeight\\\"]},{\\\"timestamp\\\":\\\"2023-08-10T17:00:00Z\\\",\\\"lat\\\":57.48,\\\"lon\\\":2.49,\\\"parameters\\\":[\\\"airPressureMeanSeaLevel\\\",\\\"airTemp\\\",\\\"airTemp10m\\\",\\\"dewPoint\\\",\\\"lightningProb\\\",\\\"maximumWaveHeight\\\",\\\"meanWaveDirection\\\",\\\"meanWaveDirectionalSpreading\\\",\\\"meanWavePeriodTm02\\\",\\\"meanWavePeriodTmm10\\\",\\\"peakPeriod\\\",\\\"precipAmount1h\\\",\\\"precipProb\\\",\\\"relativeHumidity\\\",\\\"seaIceConcentration\\\",\\\"seaSurfaceTemp\\\",\\\"significantWaveHeight\\\",\\\"significantWaveHeightRiskP90\\\",\\\"totalCurrentDirection\\\",\\\"totalCurrentVelocity\\\",\\\"totalSwellMeanWaveDirection\\\",\\\"totalSwellMeanWaveDirectionalSpreading\\\",\\\"totalSwellMeanWavePeriodTm02\\\",\\\"totalSwellMeanWavePeriodTmm10\\\",\\\"totalSwellPeakPeriod\\\",\\\"totalSwellSignificantWaveHeight\\\",\\\"visibility\\\",\\\"weatherCode\\\",\\\"windDirection100m\\\",\\\"windDirection10m\\\",\\\"windDirection50m\\\",\\\"windGust100m\\\",\\\"windGust10m\\\",\\\"windGust50m\\\",\\\"windSpeed100m\\\",\\\"windSpeed10m\\\",\\\"windSpeed50m\\\",\\\"windWaveMeanWaveDirection\\\",\\\"windWaveMeanWaveDirectionalSpreading\\\",\\\"windWaveMeanWavePeriodTm02\\\",\\\"windWaveMeanWavePeriodTmm10\\\",\\\"windWavePeakPeriod\\\",\\\"windWaveSignificantWaveHeight\\\"]}]\"\n};\n\n$.ajax(settings).done(function (response) {\n console.log(response);\n});"
- lang: Javascript + Xhr
source: "const data = JSON.stringify([\n {\n \"timestamp\": \"2023-08-10T16:00:00Z\",\n \"lat\": 55.81,\n \"lon\": 3.88,\n \"parameters\": [\n \"airPressureMeanSeaLevel\",\n \"airTemp\",\n \"airTemp10m\",\n \"dewPoint\",\n \"lightningProb\",\n \"maximumWaveHeight\",\n \"meanWaveDirection\",\n \"meanWaveDirectionalSpreading\",\n \"meanWavePeriodTm02\",\n \"meanWavePeriodTmm10\",\n \"peakPeriod\",\n \"precipAmount1h\",\n \"precipProb\",\n \"relativeHumidity\",\n \"seaIceConcentration\",\n \"seaSurfaceTemp\",\n \"significantWaveHeight\",\n \"significantWaveHeightRiskP90\",\n \"totalCurrentDirection\",\n \"totalCurrentVelocity\",\n \"totalSwellMeanWaveDirection\",\n \"totalSwellMeanWaveDirectionalSpreading\",\n \"totalSwellMeanWavePeriodTm02\",\n \"totalSwellMeanWavePeriodTmm10\",\n \"totalSwellPeakPeriod\",\n \"totalSwellSignificantWaveHeight\",\n \"visibility\",\n \"weatherCode\",\n \"windDirection100m\",\n \"windDirection10m\",\n \"windDirection50m\",\n \"windGust100m\",\n \"windGust10m\",\n \"windGust50m\",\n \"windSpeed100m\",\n \"windSpeed10m\",\n \"windSpeed50m\",\n \"windWaveMeanWaveDirection\",\n \"windWaveMeanWaveDirectionalSpreading\",\n \"windWaveMeanWavePeriodTm02\",\n \"windWaveMeanWavePeriodTmm10\",\n \"windWavePeakPeriod\",\n \"windWaveSignificantWaveHeight\"\n ]\n },\n {\n \"timestamp\": \"2023-08-10T17:00:00Z\",\n \"lat\": 57.48,\n \"lon\": 2.49,\n \"parameters\": [\n \"airPressureMeanSeaLevel\",\n \"airTemp\",\n \"airTemp10m\",\n \"dewPoint\",\n \"lightningProb\",\n \"maximumWaveHeight\",\n \"meanWaveDirection\",\n \"meanWaveDirectionalSpreading\",\n \"meanWavePeriodTm02\",\n \"meanWavePeriodTmm10\",\n \"peakPeriod\",\n \"precipAmount1h\",\n \"precipProb\",\n \"relativeHumidity\",\n \"seaIceConcentration\",\n \"seaSurfaceTemp\",\n \"significantWaveHeight\",\n \"significantWaveHeightRiskP90\",\n \"totalCurrentDirection\",\n \"totalCurrentVelocity\",\n \"totalSwellMeanWaveDirection\",\n \"totalSwellMeanWaveDirectionalSpreading\",\n \"totalSwellMeanWavePeriodTm02\",\n \"totalSwellMeanWavePeriodTmm10\",\n \"totalSwellPeakPeriod\",\n \"totalSwellSignificantWaveHeight\",\n \"visibility\",\n \"weatherCode\",\n \"windDirection100m\",\n \"windDirection10m\",\n \"windDirection50m\",\n \"windGust100m\",\n \"windGust10m\",\n \"windGust50m\",\n \"windSpeed100m\",\n \"windSpeed10m\",\n \"windSpeed50m\",\n \"windWaveMeanWaveDirection\",\n \"windWaveMeanWaveDirectionalSpreading\",\n \"windWaveMeanWavePeriodTm02\",\n \"windWaveMeanWavePeriodTmm10\",\n \"windWavePeakPeriod\",\n \"windWaveSignificantWaveHeight\"\n ]\n }\n]);\n\nconst xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === this.DONE) {\n console.log(this.responseText);\n }\n});\n\nxhr.open(\"POST\", \"https://weather.api.dtn.com/v1/conditions/marine/route?parameters=SOME_ARRAY_VALUE\");\nxhr.setRequestHeader(\"content-type\", \"application/json\");\nxhr.setRequestHeader(\"Accept-Encoding\", \"SOME_STRING_VALUE\");\nxhr.setRequestHeader(\"Accept\", \"SOME_STRING_VALUE\");\nxhr.setRequestHeader(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\");\n\nxhr.send(data);"
- lang: Javascript + Jquery
source: "const settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://weather.api.dtn.com/v1/conditions/marine/route?parameters=SOME_ARRAY_VALUE\",\n \"method\": \"POST\",\n \"headers\": {\n \"content-type\": \"application/json\",\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n },\n \"processData\": false,\n \"data\": \"[{\\\"timestamp\\\":\\\"2023-08-10T16:00:00Z\\\",\\\"lat\\\":55.81,\\\"lon\\\":3.88,\\\"parameters\\\":[\\\"airPressureMeanSeaLevel\\\",\\\"airTemp\\\",\\\"airTemp10m\\\",\\\"dewPoint\\\",\\\"lightningProb\\\",\\\"maximumWaveHeight\\\",\\\"meanWaveDirection\\\",\\\"meanWaveDirectionalSpreading\\\",\\\"meanWavePeriodTm02\\\",\\\"meanWavePeriodTmm10\\\",\\\"peakPeriod\\\",\\\"precipAmount1h\\\",\\\"precipProb\\\",\\\"relativeHumidity\\\",\\\"seaIceConcentration\\\",\\\"seaSurfaceTemp\\\",\\\"significantWaveHeight\\\",\\\"significantWaveHeightRiskP90\\\",\\\"totalCurrentDirection\\\",\\\"totalCurrentVelocity\\\",\\\"totalSwellMeanWaveDirection\\\",\\\"totalSwellMeanWaveDirectionalSpreading\\\",\\\"totalSwellMeanWavePeriodTm02\\\",\\\"totalSwellMeanWavePeriodTmm10\\\",\\\"totalSwellPeakPeriod\\\",\\\"totalSwellSignificantWaveHeight\\\",\\\"visibility\\\",\\\"weatherCode\\\",\\\"windDirection100m\\\",\\\"windDirection10m\\\",\\\"windDirection50m\\\",\\\"windGust100m\\\",\\\"windGust10m\\\",\\\"windGust50m\\\",\\\"windSpeed100m\\\",\\\"windSpeed10m\\\",\\\"windSpeed50m\\\",\\\"windWaveMeanWaveDirection\\\",\\\"windWaveMeanWaveDirectionalSpreading\\\",\\\"windWaveMeanWavePeriodTm02\\\",\\\"windWaveMeanWavePeriodTmm10\\\",\\\"windWavePeakPeriod\\\",\\\"windWaveSignificantWaveHeight\\\"]},{\\\"timestamp\\\":\\\"2023-08-10T17:00:00Z\\\",\\\"lat\\\":57.48,\\\"lon\\\":2.49,\\\"parameters\\\":[\\\"airPressureMeanSeaLevel\\\",\\\"airTemp\\\",\\\"airTemp10m\\\",\\\"dewPoint\\\",\\\"lightningProb\\\",\\\"maximumWaveHeight\\\",\\\"meanWaveDirection\\\",\\\"meanWaveDirectionalSpreading\\\",\\\"meanWavePeriodTm02\\\",\\\"meanWavePeriodTmm10\\\",\\\"peakPeriod\\\",\\\"precipAmount1h\\\",\\\"precipProb\\\",\\\"relativeHumidity\\\",\\\"seaIceConcentration\\\",\\\"seaSurfaceTemp\\\",\\\"significantWaveHeight\\\",\\\"significantWaveHeightRiskP90\\\",\\\"totalCurrentDirection\\\",\\\"totalCurrentVelocity\\\",\\\"totalSwellMeanWaveDirection\\\",\\\"totalSwellMeanWaveDirectionalSpreading\\\",\\\"totalSwellMeanWavePeriodTm02\\\",\\\"totalSwellMeanWavePeriodTmm10\\\",\\\"totalSwellPeakPeriod\\\",\\\"totalSwellSignificantWaveHeight\\\",\\\"visibility\\\",\\\"weatherCode\\\",\\\"windDirection100m\\\",\\\"windDirection10m\\\",\\\"windDirection50m\\\",\\\"windGust100m\\\",\\\"windGust10m\\\",\\\"windGust50m\\\",\\\"windSpeed100m\\\",\\\"windSpeed10m\\\",\\\"windSpeed50m\\\",\\\"windWaveMeanWaveDirection\\\",\\\"windWaveMeanWaveDirectionalSpreading\\\",\\\"windWaveMeanWavePeriodTm02\\\",\\\"windWaveMeanWavePeriodTmm10\\\",\\\"windWavePeakPeriod\\\",\\\"windWaveSignificantWaveHeight\\\"]}]\"\n};\n\n$.ajax(settings).done(function (response) {\n console.log(response);\n});"
- lang: Node + Native
source: "const http = require(\"https\");\n\nconst options = {\n \"method\": \"POST\",\n \"hostname\": \"weather.api.dtn.com\",\n \"port\": null,\n \"path\": \"/v1/conditions/marine/route?parameters=SOME_ARRAY_VALUE\",\n \"headers\": {\n \"content-type\": \"application/json\",\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\nconst req = http.request(options, function (res) {\n const chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n const body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n});\n\nreq.write(JSON.stringify([\n {\n timestamp: '2023-08-10T16:00:00Z',\n lat: 55.81,\n lon: 3.88,\n parameters: [\n 'airPressureMeanSeaLevel',\n 'airTemp',\n 'airTemp10m',\n 'dewPoint',\n 'lightningProb',\n 'maximumWaveHeight',\n 'meanWaveDirection',\n 'meanWaveDirectionalSpreading',\n 'meanWavePeriodTm02',\n 'meanWavePeriodTmm10',\n 'peakPeriod',\n 'precipAmount1h',\n 'precipProb',\n 'relativeHumidity',\n 'seaIceConcentration',\n 'seaSurfaceTemp',\n 'significantWaveHeight',\n 'significantWaveHeightRiskP90',\n 'totalCurrentDirection',\n 'totalCurrentVelocity',\n 'totalSwellMeanWaveDirection',\n 'totalSwellMeanWaveDirectionalSpreading',\n 'totalSwellMeanWavePeriodTm02',\n 'totalSwellMeanWavePeriodTmm10',\n 'totalSwellPeakPeriod',\n 'totalSwellSignificantWaveHeight',\n 'visibility',\n 'weatherCode',\n 'windDirection100m',\n 'windDirection10m',\n 'windDirection50m',\n 'windGust100m',\n 'windGust10m',\n 'windGust50m',\n 'windSpeed100m',\n 'windSpeed10m',\n 'windSpeed50m',\n 'windWaveMeanWaveDirection',\n 'windWaveMeanWaveDirectionalSpreading',\n 'windWaveMeanWavePeriodTm02',\n 'windWaveMeanWavePeriodTmm10',\n 'windWavePeakPeriod',\n 'windWaveSignificantWaveHeight'\n ]\n },\n {\n timestamp: '2023-08-10T17:00:00Z',\n lat: 57.48,\n lon: 2.49,\n parameters: [\n 'airPressureMeanSeaLevel',\n 'airTemp',\n 'airTemp10m',\n 'dewPoint',\n 'lightningProb',\n 'maximumWaveHeight',\n 'meanWaveDirection',\n 'meanWaveDirectionalSpreading',\n 'meanWavePeriodTm02',\n 'meanWavePeriodTmm10',\n 'peakPeriod',\n 'precipAmount1h',\n 'precipProb',\n 'relativeHumidity',\n 'seaIceConcentration',\n 'seaSurfaceTemp',\n 'significantWaveHeight',\n 'significantWaveHeightRiskP90',\n 'totalCurrentDirection',\n 'totalCurrentVelocity',\n 'totalSwellMeanWaveDirection',\n 'totalSwellMeanWaveDirectionalSpreading',\n 'totalSwellMeanWavePeriodTm02',\n 'totalSwellMeanWavePeriodTmm10',\n 'totalSwellPeakPeriod',\n 'totalSwellSignificantWaveHeight',\n 'visibility',\n 'weatherCode',\n 'windDirection100m',\n 'windDirection10m',\n 'windDirection50m',\n 'windGust100m',\n 'windGust10m',\n 'windGust50m',\n 'windSpeed100m',\n 'windSpeed10m',\n 'windSpeed50m',\n 'windWaveMeanWaveDirection',\n 'windWaveMeanWaveDirectionalSpreading',\n 'windWaveMeanWavePeriodTm02',\n 'windWaveMeanWavePeriodTmm10',\n 'windWavePeakPeriod',\n 'windWaveSignificantWaveHeight'\n ]\n }\n]));\nreq.end();"
- lang: Node + Request
source: "const request = require('request');\n\nconst options = {\n method: 'POST',\n url: 'https://weather.api.dtn.com/v1/conditions/marine/route',\n qs: {parameters: 'SOME_ARRAY_VALUE'},\n headers: {\n 'content-type': 'application/json',\n 'Accept-Encoding': 'SOME_STRING_VALUE',\n Accept: 'SOME_STRING_VALUE',\n Authorization: 'Bearer REPLACE_BEARER_TOKEN'\n },\n body: [\n {\n timestamp: '2023-08-10T16:00:00Z',\n lat: 55.81,\n lon: 3.88,\n parameters: [\n 'airPressureMeanSeaLevel',\n 'airTemp',\n 'airTemp10m',\n 'dewPoint',\n 'lightningProb',\n 'maximumWaveHeight',\n 'meanWaveDirection',\n 'meanWaveDirectionalSpreading',\n 'meanWavePeriodTm02',\n 'meanWavePeriodTmm10',\n 'peakPeriod',\n 'precipAmount1h',\n 'precipProb',\n 'relativeHumidity',\n 'seaIceConcentration',\n 'seaSurfaceTemp',\n 'significantWaveHeight',\n 'significantWaveHeightRiskP90',\n 'totalCurrentDirection',\n 'totalCurrentVelocity',\n 'totalSwellMeanWaveDirection',\n 'totalSwellMeanWaveDirectionalSpreading',\n 'totalSwellMeanWavePeriodTm02',\n 'totalSwellMeanWavePeriodTmm10',\n 'totalSwellPeakPeriod',\n 'totalSwellSignificantWaveHeight',\n 'visibility',\n 'weatherCode',\n 'windDirection100m',\n 'windDirection10m',\n 'windDirection50m',\n 'windGust100m',\n 'windGust10m',\n 'windGust50m',\n 'windSpeed100m',\n 'windSpeed10m',\n 'windSpeed50m',\n 'windWaveMeanWaveDirection',\n 'windWaveMeanWaveDirectionalSpreading',\n 'windWaveMeanWavePeriodTm02',\n 'windWaveMeanWavePeriodTmm10',\n 'windWavePeakPeriod',\n 'windWaveSignificantWaveHeight'\n ]\n },\n {\n timestamp: '2023-08-10T17:00:00Z',\n lat: 57.48,\n lon: 2.49,\n parameters: [\n 'airPressureMeanSeaLevel',\n 'airTemp',\n 'airTemp10m',\n 'dewPoint',\n 'lightningProb',\n 'maximumWaveHeight',\n 'meanWaveDirection',\n 'meanWaveDirectionalSpreading',\n 'meanWavePeriodTm02',\n 'meanWavePeriodTmm10',\n 'peakPeriod',\n 'precipAmount1h',\n 'precipProb',\n 'relativeHumidity',\n 'seaIceConcentration',\n 'seaSurfaceTemp',\n 'significantWaveHeight',\n 'significantWaveHeightRiskP90',\n 'totalCurrentDirection',\n 'totalCurrentVelocity',\n 'totalSwellMeanWaveDirection',\n 'totalSwellMeanWaveDirectionalSpreading',\n 'totalSwellMeanWavePeriodTm02',\n 'totalSwellMeanWavePeriodTmm10',\n 'totalSwellPeakPeriod',\n 'totalSwellSignificantWaveHeight',\n 'visibility',\n 'weatherCode',\n 'windDirection100m',\n 'windDirection10m',\n 'windDirection50m',\n 'windGust100m',\n 'windGust10m',\n 'windGust50m',\n 'windSpeed100m',\n 'windSpeed10m',\n 'windSpeed50m',\n 'windWaveMeanWaveDirection',\n 'windWaveMeanWaveDirectionalSpreading',\n 'windWaveMeanWavePeriodTm02',\n 'windWaveMeanWavePeriodTmm10',\n 'windWavePeakPeriod',\n 'windWaveSignificantWaveHeight'\n ]\n }\n ],\n json: true\n};\n\nrequest(options, function (error, response, body) {\n if (error) throw new Error(error);\n\n console.log(body);\n});\n"
- lang: Node + Unirest
source: "const unirest = require(\"unirest\");\n\nconst req = unirest(\"POST\", \"https://weather.api.dtn.com/v1/conditions/marine/route\");\n\nreq.query({\n \"parameters\": \"SOME_ARRAY_VALUE\"\n});\n\nreq.headers({\n \"content-type\": \"application/json\",\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n});\n\nreq.type(\"json\");\nreq.send([\n {\n \"timestamp\": \"2023-08-10T16:00:00Z\",\n \"lat\": 55.81,\n \"lon\": 3.88,\n \"parameters\": [\n \"airPressureMeanSeaLevel\",\n \"airTemp\",\n \"airTemp10m\",\n \"dewPoint\",\n \"lightningProb\",\n \"maximumWaveHeight\",\n \"meanWaveDirection\",\n \"meanWaveDirectionalSpreading\",\n \"meanWavePeriodTm02\",\n \"meanWavePeriodTmm10\",\n \"peakPeriod\",\n \"precipAmount1h\",\n \"precipProb\",\n \"relativeHumidity\",\n \"seaIceConcentration\",\n \"seaSurfaceTemp\",\n \"significantWaveHeight\",\n \"significantWaveHeightRiskP90\",\n \"totalCurrentDirection\",\n \"totalCurrentVelocity\",\n \"totalSwellMeanWaveDirection\",\n \"totalSwellMeanWaveDirectionalSpreading\",\n \"totalSwellMeanWavePeriodTm02\",\n \"totalSwellMeanWavePeriodTmm10\",\n \"totalSwellPeakPeriod\",\n \"totalSwellSignificantWaveHeight\",\n \"visibility\",\n \"weatherCode\",\n \"windDirection100m\",\n \"windDirection10m\",\n \"windDirection50m\",\n \"windGust100m\",\n \"windGust10m\",\n \"windGust50m\",\n \"windSpeed100m\",\n \"windSpeed10m\",\n \"windSpeed50m\",\n \"windWaveMeanWaveDirection\",\n \"windWaveMeanWaveDirectionalSpreading\",\n \"windWaveMeanWavePeriodTm02\",\n \"windWaveMeanWavePeriodTmm10\",\n \"windWavePeakPeriod\",\n \"windWaveSignificantWaveHeight\"\n ]\n },\n {\n \"timestamp\": \"2023-08-10T17:00:00Z\",\n \"lat\": 57.48,\n \"lon\": 2.49,\n \"parameters\": [\n \"airPressureMeanSeaLevel\",\n \"airTemp\",\n \"airTemp10m\",\n \"dewPoint\",\n \"lightningProb\",\n \"maximumWaveHeight\",\n \"meanWaveDirection\",\n \"meanWaveDirectionalSpreading\",\n \"meanWavePeriodTm02\",\n \"meanWavePeriodTmm10\",\n \"peakPeriod\",\n \"precipAmount1h\",\n \"precipProb\",\n \"relativeHumidity\",\n \"seaIceConcentration\",\n \"seaSurfaceTemp\",\n \"significantWaveHeight\",\n \"significantWaveHeightRiskP90\",\n \"totalCurrentDirection\",\n \"totalCurrentVelocity\",\n \"totalSwellMeanWaveDirection\",\n \"totalSwellMeanWaveDirectionalSpreading\",\n \"totalSwellMeanWavePeriodTm02\",\n \"totalSwellMeanWavePeriodTmm10\",\n \"totalSwellPeakPeriod\",\n \"totalSwellSignificantWaveHeight\",\n \"visibility\",\n \"weatherCode\",\n \"windDirection100m\",\n \"windDirection10m\",\n \"windDirection50m\",\n \"windGust100m\",\n \"windGust10m\",\n \"windGust50m\",\n \"windSpeed100m\",\n \"windSpeed10m\",\n \"windSpeed50m\",\n \"windWaveMeanWaveDirection\",\n \"windWaveMeanWaveDirectionalSpreading\",\n \"windWaveMeanWavePeriodTm02\",\n \"windWaveMeanWavePeriodTmm10\",\n \"windWavePeakPeriod\",\n \"windWaveSignificantWaveHeight\"\n ]\n }\n]);\n\nreq.end(function (res) {\n if (res.error) throw new Error(res.error);\n\n console.log(res.body);\n});\n"
- lang: Objc + Nsurlsession
source: "#import \n\nNSDictionary *headers = @{ @\"content-type\": @\"application/json\",\n @\"Accept-Encoding\": @\"SOME_STRING_VALUE\",\n @\"Accept\": @\"SOME_STRING_VALUE\",\n @\"Authorization\": @\"Bearer REPLACE_BEARER_TOKEN\" };\nNSDictionary *parameters = @[ @{ @\"timestamp\": @\"2023-08-10T16:00:00Z\", @\"lat\": @55.81, @\"lon\": @3.88, @\"parameters\": @[ @\"airPressureMeanSeaLevel\", @\"airTemp\", @\"airTemp10m\", @\"dewPoint\", @\"lightningProb\", @\"maximumWaveHeight\", @\"meanWaveDirection\", @\"meanWaveDirectionalSpreading\", @\"meanWavePeriodTm02\", @\"meanWavePeriodTmm10\", @\"peakPeriod\", @\"precipAmount1h\", @\"precipProb\", @\"relativeHumidity\", @\"seaIceConcentration\", @\"seaSurfaceTemp\", @\"significantWaveHeight\", @\"significantWaveHeightRiskP90\", @\"totalCurrentDirection\", @\"totalCurrentVelocity\", @\"totalSwellMeanWaveDirection\", @\"totalSwellMeanWaveDirectionalSpreading\", @\"totalSwellMeanWavePeriodTm02\", @\"totalSwellMeanWavePeriodTmm10\", @\"totalSwellPeakPeriod\", @\"totalSwellSignificantWaveHeight\", @\"visibility\", @\"weatherCode\", @\"windDirection100m\", @\"windDirection10m\", @\"windDirection50m\", @\"windGust100m\", @\"windGust10m\", @\"windGust50m\", @\"windSpeed100m\", @\"windSpeed10m\", @\"windSpeed50m\", @\"windWaveMeanWaveDirection\", @\"windWaveMeanWaveDirectionalSpreading\", @\"windWaveMeanWavePeriodTm02\", @\"windWaveMeanWavePeriodTmm10\", @\"windWavePeakPeriod\", @\"windWaveSignificantWaveHeight\" ] },\n @{ @\"timestamp\": @\"2023-08-10T17:00:00Z\", @\"lat\": @57.48, @\"lon\": @2.49, @\"parameters\": @[ @\"airPressureMeanSeaLevel\", @\"airTemp\", @\"airTemp10m\", @\"dewPoint\", @\"lightningProb\", @\"maximumWaveHeight\", @\"meanWaveDirection\", @\"meanWaveDirectionalSpreading\", @\"meanWavePeriodTm02\", @\"meanWavePeriodTmm10\", @\"peakPeriod\", @\"precipAmount1h\", @\"precipProb\", @\"relativeHumidity\", @\"seaIceConcentration\", @\"seaSurfaceTemp\", @\"significantWaveHeight\", @\"significantWaveHeightRiskP90\", @\"totalCurrentDirection\", @\"totalCurrentVelocity\", @\"totalSwellMeanWaveDirection\", @\"totalSwellMeanWaveDirectionalSpreading\", @\"totalSwellMeanWavePeriodTm02\", @\"totalSwellMeanWavePeriodTmm10\", @\"totalSwellPeakPeriod\", @\"totalSwellSignificantWaveHeight\", @\"visibility\", @\"weatherCode\", @\"windDirection100m\", @\"windDirection10m\", @\"windDirection50m\", @\"windGust100m\", @\"windGust10m\", @\"windGust50m\", @\"windSpeed100m\", @\"windSpeed10m\", @\"windSpeed50m\", @\"windWaveMeanWaveDirection\", @\"windWaveMeanWaveDirectionalSpreading\", @\"windWaveMeanWavePeriodTm02\", @\"windWaveMeanWavePeriodTmm10\", @\"windWavePeakPeriod\", @\"windWaveSignificantWaveHeight\" ] } ];\n\nNSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://weather.api.dtn.com/v1/conditions/marine/route?parameters=SOME_ARRAY_VALUE\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\n[request setHTTPMethod:@\"POST\"];\n[request setAllHTTPHeaderFields:headers];\n[request setHTTPBody:postData];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSLog(@\"%@\", httpResponse);\n }\n }];\n[dataTask resume];"
- lang: Ocaml + Cohttp
source: "open Cohttp_lwt_unix\nopen Cohttp\nopen Lwt\n\nlet uri = Uri.of_string \"https://weather.api.dtn.com/v1/conditions/marine/route?parameters=SOME_ARRAY_VALUE\" in\nlet headers = Header.add_list (Header.init ()) [\n (\"content-type\", \"application/json\");\n (\"Accept-Encoding\", \"SOME_STRING_VALUE\");\n (\"Accept\", \"SOME_STRING_VALUE\");\n (\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\");\n] in\nlet body = Cohttp_lwt_body.of_string \"[{\\\"timestamp\\\":\\\"2023-08-10T16:00:00Z\\\",\\\"lat\\\":55.81,\\\"lon\\\":3.88,\\\"parameters\\\":[\\\"airPressureMeanSeaLevel\\\",\\\"airTemp\\\",\\\"airTemp10m\\\",\\\"dewPoint\\\",\\\"lightningProb\\\",\\\"maximumWaveHeight\\\",\\\"meanWaveDirection\\\",\\\"meanWaveDirectionalSpreading\\\",\\\"meanWavePeriodTm02\\\",\\\"meanWavePeriodTmm10\\\",\\\"peakPeriod\\\",\\\"precipAmount1h\\\",\\\"precipProb\\\",\\\"relativeHumidity\\\",\\\"seaIceConcentration\\\",\\\"seaSurfaceTemp\\\",\\\"significantWaveHeight\\\",\\\"significantWaveHeightRiskP90\\\",\\\"totalCurrentDirection\\\",\\\"totalCurrentVelocity\\\",\\\"totalSwellMeanWaveDirection\\\",\\\"totalSwellMeanWaveDirectionalSpreading\\\",\\\"totalSwellMeanWavePeriodTm02\\\",\\\"totalSwellMeanWavePeriodTmm10\\\",\\\"totalSwellPeakPeriod\\\",\\\"totalSwellSignificantWaveHeight\\\",\\\"visibility\\\",\\\"weatherCode\\\",\\\"windDirection100m\\\",\\\"windDirection10m\\\",\\\"windDirection50m\\\",\\\"windGust100m\\\",\\\"windGust10m\\\",\\\"windGust50m\\\",\\\"windSpeed100m\\\",\\\"windSpeed10m\\\",\\\"windSpeed50m\\\",\\\"windWaveMeanWaveDirection\\\",\\\"windWaveMeanWaveDirectionalSpreading\\\",\\\"windWaveMeanWavePeriodTm02\\\",\\\"windWaveMeanWavePeriodTmm10\\\",\\\"windWavePeakPeriod\\\",\\\"windWaveSignificantWaveHeight\\\"]},{\\\"timestamp\\\":\\\"2023-08-10T17:00:00Z\\\",\\\"lat\\\":57.48,\\\"lon\\\":2.49,\\\"parameters\\\":[\\\"airPressureMeanSeaLevel\\\",\\\"airTemp\\\",\\\"airTemp10m\\\",\\\"dewPoint\\\",\\\"lightningProb\\\",\\\"maximumWaveHeight\\\",\\\"meanWaveDirection\\\",\\\"meanWaveDirectionalSpreading\\\",\\\"meanWavePeriodTm02\\\",\\\"meanWavePeriodTmm10\\\",\\\"peakPeriod\\\",\\\"precipAmount1h\\\",\\\"precipProb\\\",\\\"relativeHumidity\\\",\\\"seaIceConcentration\\\",\\\"seaSurfaceTemp\\\",\\\"significantWaveHeight\\\",\\\"significantWaveHeightRiskP90\\\",\\\"totalCurrentDirection\\\",\\\"totalCurrentVelocity\\\",\\\"totalSwellMeanWaveDirection\\\",\\\"totalSwellMeanWaveDirectionalSpreading\\\",\\\"totalSwellMeanWavePeriodTm02\\\",\\\"totalSwellMeanWavePeriodTmm10\\\",\\\"totalSwellPeakPeriod\\\",\\\"totalSwellSignificantWaveHeight\\\",\\\"visibility\\\",\\\"weatherCode\\\",\\\"windDirection100m\\\",\\\"windDirection10m\\\",\\\"windDirection50m\\\",\\\"windGust100m\\\",\\\"windGust10m\\\",\\\"windGust50m\\\",\\\"windSpeed100m\\\",\\\"windSpeed10m\\\",\\\"windSpeed50m\\\",\\\"windWaveMeanWaveDirection\\\",\\\"windWaveMeanWaveDirectionalSpreading\\\",\\\"windWaveMeanWavePeriodTm02\\\",\\\"windWaveMeanWavePeriodTmm10\\\",\\\"windWavePeakPeriod\\\",\\\"windWaveSignificantWaveHeight\\\"]}]\" in\n\nClient.call ~headers ~body `POST uri\n>>= fun (res, body_stream) ->\n (* Do stuff with the result *)"
- lang: Php + Curl
source: " \"https://weather.api.dtn.com/v1/conditions/marine/route?parameters=SOME_ARRAY_VALUE\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_POSTFIELDS => \"[{\\\"timestamp\\\":\\\"2023-08-10T16:00:00Z\\\",\\\"lat\\\":55.81,\\\"lon\\\":3.88,\\\"parameters\\\":[\\\"airPressureMeanSeaLevel\\\",\\\"airTemp\\\",\\\"airTemp10m\\\",\\\"dewPoint\\\",\\\"lightningProb\\\",\\\"maximumWaveHeight\\\",\\\"meanWaveDirection\\\",\\\"meanWaveDirectionalSpreading\\\",\\\"meanWavePeriodTm02\\\",\\\"meanWavePeriodTmm10\\\",\\\"peakPeriod\\\",\\\"precipAmount1h\\\",\\\"precipProb\\\",\\\"relativeHumidity\\\",\\\"seaIceConcentration\\\",\\\"seaSurfaceTemp\\\",\\\"significantWaveHeight\\\",\\\"significantWaveHeightRiskP90\\\",\\\"totalCurrentDirection\\\",\\\"totalCurrentVelocity\\\",\\\"totalSwellMeanWaveDirection\\\",\\\"totalSwellMeanWaveDirectionalSpreading\\\",\\\"totalSwellMeanWavePeriodTm02\\\",\\\"totalSwellMeanWavePeriodTmm10\\\",\\\"totalSwellPeakPeriod\\\",\\\"totalSwellSignificantWaveHeight\\\",\\\"visibility\\\",\\\"weatherCode\\\",\\\"windDirection100m\\\",\\\"windDirection10m\\\",\\\"windDirection50m\\\",\\\"windGust100m\\\",\\\"windGust10m\\\",\\\"windGust50m\\\",\\\"windSpeed100m\\\",\\\"windSpeed10m\\\",\\\"windSpeed50m\\\",\\\"windWaveMeanWaveDirection\\\",\\\"windWaveMeanWaveDirectionalSpreading\\\",\\\"windWaveMeanWavePeriodTm02\\\",\\\"windWaveMeanWavePeriodTmm10\\\",\\\"windWavePeakPeriod\\\",\\\"windWaveSignificantWaveHeight\\\"]},{\\\"timestamp\\\":\\\"2023-08-10T17:00:00Z\\\",\\\"lat\\\":57.48,\\\"lon\\\":2.49,\\\"parameters\\\":[\\\"airPressureMeanSeaLevel\\\",\\\"airTemp\\\",\\\"airTemp10m\\\",\\\"dewPoint\\\",\\\"lightningProb\\\",\\\"maximumWaveHeight\\\",\\\"meanWaveDirection\\\",\\\"meanWaveDirectionalSpreading\\\",\\\"meanWavePeriodTm02\\\",\\\"meanWavePeriodTmm10\\\",\\\"peakPeriod\\\",\\\"precipAmount1h\\\",\\\"precipProb\\\",\\\"relativeHumidity\\\",\\\"seaIceConcentration\\\",\\\"seaSurfaceTemp\\\",\\\"significantWaveHeight\\\",\\\"significantWaveHeightRiskP90\\\",\\\"totalCurrentDirection\\\",\\\"totalCurrentVelocity\\\",\\\"totalSwellMeanWaveDirection\\\",\\\"totalSwellMeanWaveDirectionalSpreading\\\",\\\"totalSwellMeanWavePeriodTm02\\\",\\\"totalSwellMeanWavePeriodTmm10\\\",\\\"totalSwellPeakPeriod\\\",\\\"totalSwellSignificantWaveHeight\\\",\\\"visibility\\\",\\\"weatherCode\\\",\\\"windDirection100m\\\",\\\"windDirection10m\\\",\\\"windDirection50m\\\",\\\"windGust100m\\\",\\\"windGust10m\\\",\\\"windGust50m\\\",\\\"windSpeed100m\\\",\\\"windSpeed10m\\\",\\\"windSpeed50m\\\",\\\"windWaveMeanWaveDirection\\\",\\\"windWaveMeanWaveDirectionalSpreading\\\",\\\"windWaveMeanWavePeriodTm02\\\",\\\"windWaveMeanWavePeriodTmm10\\\",\\\"windWavePeakPeriod\\\",\\\"windWaveSignificantWaveHeight\\\"]}]\",\n CURLOPT_HTTPHEADER => [\n \"Accept: SOME_STRING_VALUE\",\n \"Accept-Encoding: SOME_STRING_VALUE\",\n \"Authorization: Bearer REPLACE_BEARER_TOKEN\",\n \"content-type: application/json\"\n ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n echo \"cURL Error #:\" . $err;\n} else {\n echo $response;\n}"
- lang: Php + Http1
source: "setUrl('https://weather.api.dtn.com/v1/conditions/marine/route');\n$request->setMethod(HTTP_METH_POST);\n\n$request->setQueryData([\n 'parameters' => 'SOME_ARRAY_VALUE'\n]);\n\n$request->setHeaders([\n 'content-type' => 'application/json',\n 'Accept-Encoding' => 'SOME_STRING_VALUE',\n 'Accept' => 'SOME_STRING_VALUE',\n 'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'\n]);\n\n$request->setBody('[{\"timestamp\":\"2023-08-10T16:00:00Z\",\"lat\":55.81,\"lon\":3.88,\"parameters\":[\"airPressureMeanSeaLevel\",\"airTemp\",\"airTemp10m\",\"dewPoint\",\"lightningProb\",\"maximumWaveHeight\",\"meanWaveDirection\",\"meanWaveDirectionalSpreading\",\"meanWavePeriodTm02\",\"meanWavePeriodTmm10\",\"peakPeriod\",\"precipAmount1h\",\"precipProb\",\"relativeHumidity\",\"seaIceConcentration\",\"seaSurfaceTemp\",\"significantWaveHeight\",\"significantWaveHeightRiskP90\",\"totalCurrentDirection\",\"totalCurrentVelocity\",\"totalSwellMeanWaveDirection\",\"totalSwellMeanWaveDirectionalSpreading\",\"totalSwellMeanWavePeriodTm02\",\"totalSwellMeanWavePeriodTmm10\",\"totalSwellPeakPeriod\",\"totalSwellSignificantWaveHeight\",\"visibility\",\"weatherCode\",\"windDirection100m\",\"windDirection10m\",\"windDirection50m\",\"windGust100m\",\"windGust10m\",\"windGust50m\",\"windSpeed100m\",\"windSpeed10m\",\"windSpeed50m\",\"windWaveMeanWaveDirection\",\"windWaveMeanWaveDirectionalSpreading\",\"windWaveMeanWavePeriodTm02\",\"windWaveMeanWavePeriodTmm10\",\"windWavePeakPeriod\",\"windWaveSignificantWaveHeight\"]},{\"timestamp\":\"2023-08-10T17:00:00Z\",\"lat\":57.48,\"lon\":2.49,\"parameters\":[\"airPressureMeanSeaLevel\",\"airTemp\",\"airTemp10m\",\"dewPoint\",\"lightningProb\",\"maximumWaveHeight\",\"meanWaveDirection\",\"meanWaveDirectionalSpreading\",\"meanWavePeriodTm02\",\"meanWavePeriodTmm10\",\"peakPeriod\",\"precipAmount1h\",\"precipProb\",\"relativeHumidity\",\"seaIceConcentration\",\"seaSurfaceTemp\",\"significantWaveHeight\",\"significantWaveHeightRiskP90\",\"totalCurrentDirection\",\"totalCurrentVelocity\",\"totalSwellMeanWaveDirection\",\"totalSwellMeanWaveDirectionalSpreading\",\"totalSwellMeanWavePeriodTm02\",\"totalSwellMeanWavePeriodTmm10\",\"totalSwellPeakPeriod\",\"totalSwellSignificantWaveHeight\",\"visibility\",\"weatherCode\",\"windDirection100m\",\"windDirection10m\",\"windDirection50m\",\"windGust100m\",\"windGust10m\",\"windGust50m\",\"windSpeed100m\",\"windSpeed10m\",\"windSpeed50m\",\"windWaveMeanWaveDirection\",\"windWaveMeanWaveDirectionalSpreading\",\"windWaveMeanWavePeriodTm02\",\"windWaveMeanWavePeriodTmm10\",\"windWavePeakPeriod\",\"windWaveSignificantWaveHeight\"]}]');\n\ntry {\n $response = $request->send();\n\n echo $response->getBody();\n} catch (HttpException $ex) {\n echo $ex;\n}"
- lang: Php + Http2
source: "append('[{\"timestamp\":\"2023-08-10T16:00:00Z\",\"lat\":55.81,\"lon\":3.88,\"parameters\":[\"airPressureMeanSeaLevel\",\"airTemp\",\"airTemp10m\",\"dewPoint\",\"lightningProb\",\"maximumWaveHeight\",\"meanWaveDirection\",\"meanWaveDirectionalSpreading\",\"meanWavePeriodTm02\",\"meanWavePeriodTmm10\",\"peakPeriod\",\"precipAmount1h\",\"precipProb\",\"relativeHumidity\",\"seaIceConcentration\",\"seaSurfaceTemp\",\"significantWaveHeight\",\"significantWaveHeightRiskP90\",\"totalCurrentDirection\",\"totalCurrentVelocity\",\"totalSwellMeanWaveDirection\",\"totalSwellMeanWaveDirectionalSpreading\",\"totalSwellMeanWavePeriodTm02\",\"totalSwellMeanWavePeriodTmm10\",\"totalSwellPeakPeriod\",\"totalSwellSignificantWaveHeight\",\"visibility\",\"weatherCode\",\"windDirection100m\",\"windDirection10m\",\"windDirection50m\",\"windGust100m\",\"windGust10m\",\"windGust50m\",\"windSpeed100m\",\"windSpeed10m\",\"windSpeed50m\",\"windWaveMeanWaveDirection\",\"windWaveMeanWaveDirectionalSpreading\",\"windWaveMeanWavePeriodTm02\",\"windWaveMeanWavePeriodTmm10\",\"windWavePeakPeriod\",\"windWaveSignificantWaveHeight\"]},{\"timestamp\":\"2023-08-10T17:00:00Z\",\"lat\":57.48,\"lon\":2.49,\"parameters\":[\"airPressureMeanSeaLevel\",\"airTemp\",\"airTemp10m\",\"dewPoint\",\"lightningProb\",\"maximumWaveHeight\",\"meanWaveDirection\",\"meanWaveDirectionalSpreading\",\"meanWavePeriodTm02\",\"meanWavePeriodTmm10\",\"peakPeriod\",\"precipAmount1h\",\"precipProb\",\"relativeHumidity\",\"seaIceConcentration\",\"seaSurfaceTemp\",\"significantWaveHeight\",\"significantWaveHeightRiskP90\",\"totalCurrentDirection\",\"totalCurrentVelocity\",\"totalSwellMeanWaveDirection\",\"totalSwellMeanWaveDirectionalSpreading\",\"totalSwellMeanWavePeriodTm02\",\"totalSwellMeanWavePeriodTmm10\",\"totalSwellPeakPeriod\",\"totalSwellSignificantWaveHeight\",\"visibility\",\"weatherCode\",\"windDirection100m\",\"windDirection10m\",\"windDirection50m\",\"windGust100m\",\"windGust10m\",\"windGust50m\",\"windSpeed100m\",\"windSpeed10m\",\"windSpeed50m\",\"windWaveMeanWaveDirection\",\"windWaveMeanWaveDirectionalSpreading\",\"windWaveMeanWavePeriodTm02\",\"windWaveMeanWavePeriodTmm10\",\"windWavePeakPeriod\",\"windWaveSignificantWaveHeight\"]}]');\n\n$request->setRequestUrl('https://weather.api.dtn.com/v1/conditions/marine/route');\n$request->setRequestMethod('POST');\n$request->setBody($body);\n\n$request->setQuery(new http\\QueryString([\n 'parameters' => 'SOME_ARRAY_VALUE'\n]));\n\n$request->setHeaders([\n 'content-type' => 'application/json',\n 'Accept-Encoding' => 'SOME_STRING_VALUE',\n 'Accept' => 'SOME_STRING_VALUE',\n 'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"
- lang: Python + Python3
source: "import http.client\n\nconn = http.client.HTTPSConnection(\"weather.api.dtn.com\")\n\npayload = \"[{\\\"timestamp\\\":\\\"2023-08-10T16:00:00Z\\\",\\\"lat\\\":55.81,\\\"lon\\\":3.88,\\\"parameters\\\":[\\\"airPressureMeanSeaLevel\\\",\\\"airTemp\\\",\\\"airTemp10m\\\",\\\"dewPoint\\\",\\\"lightningProb\\\",\\\"maximumWaveHeight\\\",\\\"meanWaveDirection\\\",\\\"meanWaveDirectionalSpreading\\\",\\\"meanWavePeriodTm02\\\",\\\"meanWavePeriodTmm10\\\",\\\"peakPeriod\\\",\\\"precipAmount1h\\\",\\\"precipProb\\\",\\\"relativeHumidity\\\",\\\"seaIceConcentration\\\",\\\"seaSurfaceTemp\\\",\\\"significantWaveHeight\\\",\\\"significantWaveHeightRiskP90\\\",\\\"totalCurrentDirection\\\",\\\"totalCurrentVelocity\\\",\\\"totalSwellMeanWaveDirection\\\",\\\"totalSwellMeanWaveDirectionalSpreading\\\",\\\"totalSwellMeanWavePeriodTm02\\\",\\\"totalSwellMeanWavePeriodTmm10\\\",\\\"totalSwellPeakPeriod\\\",\\\"totalSwellSignificantWaveHeight\\\",\\\"visibility\\\",\\\"weatherCode\\\",\\\"windDirection100m\\\",\\\"windDirection10m\\\",\\\"windDirection50m\\\",\\\"windGust100m\\\",\\\"windGust10m\\\",\\\"windGust50m\\\",\\\"windSpeed100m\\\",\\\"windSpeed10m\\\",\\\"windSpeed50m\\\",\\\"windWaveMeanWaveDirection\\\",\\\"windWaveMeanWaveDirectionalSpreading\\\",\\\"windWaveMeanWavePeriodTm02\\\",\\\"windWaveMeanWavePeriodTmm10\\\",\\\"windWavePeakPeriod\\\",\\\"windWaveSignificantWaveHeight\\\"]},{\\\"timestamp\\\":\\\"2023-08-10T17:00:00Z\\\",\\\"lat\\\":57.48,\\\"lon\\\":2.49,\\\"parameters\\\":[\\\"airPressureMeanSeaLevel\\\",\\\"airTemp\\\",\\\"airTemp10m\\\",\\\"dewPoint\\\",\\\"lightningProb\\\",\\\"maximumWaveHeight\\\",\\\"meanWaveDirection\\\",\\\"meanWaveDirectionalSpreading\\\",\\\"meanWavePeriodTm02\\\",\\\"meanWavePeriodTmm10\\\",\\\"peakPeriod\\\",\\\"precipAmount1h\\\",\\\"precipProb\\\",\\\"relativeHumidity\\\",\\\"seaIceConcentration\\\",\\\"seaSurfaceTemp\\\",\\\"significantWaveHeight\\\",\\\"significantWaveHeightRiskP90\\\",\\\"totalCurrentDirection\\\",\\\"totalCurrentVelocity\\\",\\\"totalSwellMeanWaveDirection\\\",\\\"totalSwellMeanWaveDirectionalSpreading\\\",\\\"totalSwellMeanWavePeriodTm02\\\",\\\"totalSwellMeanWavePeriodTmm10\\\",\\\"totalSwellPeakPeriod\\\",\\\"totalSwellSignificantWaveHeight\\\",\\\"visibility\\\",\\\"weatherCode\\\",\\\"windDirection100m\\\",\\\"windDirection10m\\\",\\\"windDirection50m\\\",\\\"windGust100m\\\",\\\"windGust10m\\\",\\\"windGust50m\\\",\\\"windSpeed100m\\\",\\\"windSpeed10m\\\",\\\"windSpeed50m\\\",\\\"windWaveMeanWaveDirection\\\",\\\"windWaveMeanWaveDirectionalSpreading\\\",\\\"windWaveMeanWavePeriodTm02\\\",\\\"windWaveMeanWavePeriodTmm10\\\",\\\"windWavePeakPeriod\\\",\\\"windWaveSignificantWaveHeight\\\"]}]\"\n\nheaders = {\n 'content-type': \"application/json\",\n 'Accept-Encoding': \"SOME_STRING_VALUE\",\n 'Accept': \"SOME_STRING_VALUE\",\n 'Authorization': \"Bearer REPLACE_BEARER_TOKEN\"\n }\n\nconn.request(\"POST\", \"/v1/conditions/marine/route?parameters=SOME_ARRAY_VALUE\", payload, headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"
- lang: Python + Requests
source: "import requests\n\nurl = \"https://weather.api.dtn.com/v1/conditions/marine/route\"\n\nquerystring = {\"parameters\":\"SOME_ARRAY_VALUE\"}\n\npayload = [\n {\n \"timestamp\": \"2023-08-10T16:00:00Z\",\n \"lat\": 55.81,\n \"lon\": 3.88,\n \"parameters\": [\"airPressureMeanSeaLevel\", \"airTemp\", \"airTemp10m\", \"dewPoint\", \"lightningProb\", \"maximumWaveHeight\", \"meanWaveDirection\", \"meanWaveDirectionalSpreading\", \"meanWavePeriodTm02\", \"meanWavePeriodTmm10\", \"peakPeriod\", \"precipAmount1h\", \"precipProb\", \"relativeHumidity\", \"seaIceConcentration\", \"seaSurfaceTemp\", \"significantWaveHeight\", \"significantWaveHeightRiskP90\", \"totalCurrentDirection\", \"totalCurrentVelocity\", \"totalSwellMeanWaveDirection\", \"totalSwellMeanWaveDirectionalSpreading\", \"totalSwellMeanWavePeriodTm02\", \"totalSwellMeanWavePeriodTmm10\", \"totalSwellPeakPeriod\", \"totalSwellSignificantWaveHeight\", \"visibility\", \"weatherCode\", \"windDirection100m\", \"windDirection10m\", \"windDirection50m\", \"windGust100m\", \"windGust10m\", \"windGust50m\", \"windSpeed100m\", \"windSpeed10m\", \"windSpeed50m\", \"windWaveMeanWaveDirection\", \"windWaveMeanWaveDirectionalSpreading\", \"windWaveMeanWavePeriodTm02\", \"windWaveMeanWavePeriodTmm10\", \"windWavePeakPeriod\", \"windWaveSignificantWaveHeight\"]\n },\n {\n \"timestamp\": \"2023-08-10T17:00:00Z\",\n \"lat\": 57.48,\n \"lon\": 2.49,\n \"parameters\": [\"airPressureMeanSeaLevel\", \"airTemp\", \"airTemp10m\", \"dewPoint\", \"lightningProb\", \"maximumWaveHeight\", \"meanWaveDirection\", \"meanWaveDirectionalSpreading\", \"meanWavePeriodTm02\", \"meanWavePeriodTmm10\", \"peakPeriod\", \"precipAmount1h\", \"precipProb\", \"relativeHumidity\", \"seaIceConcentration\", \"seaSurfaceTemp\", \"significantWaveHeight\", \"significantWaveHeightRiskP90\", \"totalCurrentDirection\", \"totalCurrentVelocity\", \"totalSwellMeanWaveDirection\", \"totalSwellMeanWaveDirectionalSpreading\", \"totalSwellMeanWavePeriodTm02\", \"totalSwellMeanWavePeriodTmm10\", \"totalSwellPeakPeriod\", \"totalSwellSignificantWaveHeight\", \"visibility\", \"weatherCode\", \"windDirection100m\", \"windDirection10m\", \"windDirection50m\", \"windGust100m\", \"windGust10m\", \"windGust50m\", \"windSpeed100m\", \"windSpeed10m\", \"windSpeed50m\", \"windWaveMeanWaveDirection\", \"windWaveMeanWaveDirectionalSpreading\", \"windWaveMeanWavePeriodTm02\", \"windWaveMeanWavePeriodTmm10\", \"windWavePeakPeriod\", \"windWaveSignificantWaveHeight\"]\n }\n]\nheaders = {\n \"content-type\": \"application/json\",\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers, params=querystring)\n\nprint(response.text)"
- lang: Ruby + Native
source: 'require ''uri''
require ''net/http''
require ''openssl''
url = URI("https://weather.api.dtn.com/v1/conditions/marine/route?parameters=SOME_ARRAY_VALUE")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["content-type"] = ''application/json''
request["Accept-Encoding"] = ''SOME_STRING_VALUE''
request["Accept"] = ''SOME_STRING_VALUE''
request["Authorization"] = ''Bearer REPLACE_BEARER_TOKEN''
request.body = "[{\"timestamp\":\"2023-08-10T16:00:00Z\",\"lat\":55.81,\"lon\":3.88,\"parameters\":[\"airPressureMeanSeaLevel\",\"airTemp\",\"airTemp10m\",\"dewPoint\",\"lightningProb\",\"maximumWaveHeight\",\"meanWaveDirection\",\"meanWaveDirectionalSpreading\",\"meanWavePeriodTm02\",\"meanWavePeriodTmm10\",\"peakPeriod\",\"precipAmount1h\",\"precipProb\",\"relativeHumidity\",\"seaIceConcentration\",\"seaSurfaceTemp\",\"significantWaveHeight\",\"significantWaveHeightRiskP90\",\"totalCurrentDirection\",\"totalCurrentVelocity\",\"totalSwellMeanWaveDirection\",\"totalSwellMeanWaveDirectionalSpreading\",\"totalSwellMeanWavePeriodTm02\",\"totalSwellMeanWavePeriodTmm10\",\"totalSwellPeakPeriod\",\"totalSwellSignificantWaveHeight\",\"visibility\",\"weatherCode\",\"windDirection100m\",\"windDirection10m\",\"windDirection50m\",\"windGust100m\",\"windGust10m\",\"windGust50m\",\"windSpeed100m\",\"windSpeed10m\",\"windSpeed50m\",\"windWaveMeanWaveDirection\",\"windWaveMeanWaveDirectionalSpreading\",\"windWaveMeanWavePeriodTm02\",\"windWaveMeanWavePeriodTmm10\",\"windWavePeakPeriod\",\"windWaveSignificantWaveHeight\"]},{\"timestamp\":\"2023-08-10T17:00:00Z\",\"lat\":57.48,\"lon\":2.49,\"parameters\":[\"airPressureMeanSeaLevel\",\"airTemp\",\"airTemp10m\",\"dewPoint\",\"lightningProb\",\"maximumWaveHeight\",\"meanWaveDirection\",\"meanWaveDirectionalSpreading\",\"meanWavePeriodTm02\",\"meanWavePeriodTmm10\",\"peakPeriod\",\"precipAmount1h\",\"precipProb\",\"relativeHumidity\",\"seaIceConcentration\",\"seaSurfaceTemp\",\"significantWaveHeight\",\"significantWaveHeightRiskP90\",\"totalCurrentDirection\",\"totalCurrentVelocity\",\"totalSwellMeanWaveDirection\",\"totalSwellMeanWaveDirectionalSpreading\",\"totalSwellMeanWavePeriodTm02\",\"totalSwellMeanWavePeriodTmm10\",\"totalSwellPeakPeriod\",\"totalSwellSignificantWaveHeight\",\"visibility\",\"weatherCode\",\"windDirection100m\",\"windDirection10m\",\"windDirection50m\",\"windGust100m\",\"windGust10m\",\"windGust50m\",\"windSpeed100m\",\"windSpeed10m\",\"windSpeed50m\",\"windWaveMeanWaveDirection\",\"windWaveMeanWaveDirectionalSpreading\",\"windWaveMeanWavePeriodTm02\",\"windWaveMeanWavePeriodTmm10\",\"windWavePeakPeriod\",\"windWaveSignificantWaveHeight\"]}]"
response = http.request(request)
puts response.read_body'
- lang: Shell + Curl
source: "curl --request POST \\\n --url 'https://weather.api.dtn.com/v1/conditions/marine/route?parameters=SOME_ARRAY_VALUE' \\\n --header 'Accept: SOME_STRING_VALUE' \\\n --header 'Accept-Encoding: SOME_STRING_VALUE' \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \\\n --header 'content-type: application/json' \\\n --data '[{\"timestamp\":\"2023-08-10T16:00:00Z\",\"lat\":55.81,\"lon\":3.88,\"parameters\":[\"airPressureMeanSeaLevel\",\"airTemp\",\"airTemp10m\",\"dewPoint\",\"lightningProb\",\"maximumWaveHeight\",\"meanWaveDirection\",\"meanWaveDirectionalSpreading\",\"meanWavePeriodTm02\",\"meanWavePeriodTmm10\",\"peakPeriod\",\"precipAmount1h\",\"precipProb\",\"relativeHumidity\",\"seaIceConcentration\",\"seaSurfaceTemp\",\"significantWaveHeight\",\"significantWaveHeightRiskP90\",\"totalCurrentDirection\",\"totalCurrentVelocity\",\"totalSwellMeanWaveDirection\",\"totalSwellMeanWaveDirectionalSpreading\",\"totalSwellMeanWavePeriodTm02\",\"totalSwellMeanWavePeriodTmm10\",\"totalSwellPeakPeriod\",\"totalSwellSignificantWaveHeight\",\"visibility\",\"weatherCode\",\"windDirection100m\",\"windDirection10m\",\"windDirection50m\",\"windGust100m\",\"windGust10m\",\"windGust50m\",\"windSpeed100m\",\"windSpeed10m\",\"windSpeed50m\",\"windWaveMeanWaveDirection\",\"windWaveMeanWaveDirectionalSpreading\",\"windWaveMeanWavePeriodTm02\",\"windWaveMeanWavePeriodTmm10\",\"windWavePeakPeriod\",\"windWaveSignificantWaveHeight\"]},{\"timestamp\":\"2023-08-10T17:00:00Z\",\"lat\":57.48,\"lon\":2.49,\"parameters\":[\"airPressureMeanSeaLevel\",\"airTemp\",\"airTemp10m\",\"dewPoint\",\"lightningProb\",\"maximumWaveHeight\",\"meanWaveDirection\",\"meanWaveDirectionalSpreading\",\"meanWavePeriodTm02\",\"meanWavePeriodTmm10\",\"peakPeriod\",\"precipAmount1h\",\"precipProb\",\"relativeHumidity\",\"seaIceConcentration\",\"seaSurfaceTemp\",\"significantWaveHeight\",\"significantWaveHeightRiskP90\",\"totalCurrentDirection\",\"totalCurrentVelocity\",\"totalSwellMeanWaveDirection\",\"totalSwellMeanWaveDirectionalSpreading\",\"totalSwellMeanWavePeriodTm02\",\"totalSwellMeanWavePeriodTmm10\",\"totalSwellPeakPeriod\",\"totalSwellSignificantWaveHeight\",\"visibility\",\"weatherCode\",\"windDirection100m\",\"windDirection10m\",\"windDirection50m\",\"windGust100m\",\"windGust10m\",\"windGust50m\",\"windSpeed100m\",\"windSpeed10m\",\"windSpeed50m\",\"windWaveMeanWaveDirection\",\"windWaveMeanWaveDirectionalSpreading\",\"windWaveMeanWavePeriodTm02\",\"windWaveMeanWavePeriodTmm10\",\"windWavePeakPeriod\",\"windWaveSignificantWaveHeight\"]}]'"
- lang: Shell + Httpie
source: "echo '[{\"timestamp\":\"2023-08-10T16:00:00Z\",\"lat\":55.81,\"lon\":3.88,\"parameters\":[\"airPressureMeanSeaLevel\",\"airTemp\",\"airTemp10m\",\"dewPoint\",\"lightningProb\",\"maximumWaveHeight\",\"meanWaveDirection\",\"meanWaveDirectionalSpreading\",\"meanWavePeriodTm02\",\"meanWavePeriodTmm10\",\"peakPeriod\",\"precipAmount1h\",\"precipProb\",\"relativeHumidity\",\"seaIceConcentration\",\"seaSurfaceTemp\",\"significantWaveHeight\",\"significantWaveHeightRiskP90\",\"totalCurrentDirection\",\"totalCurrentVelocity\",\"totalSwellMeanWaveDirection\",\"totalSwellMeanWaveDirectionalSpreading\",\"totalSwellMeanWavePeriodTm02\",\"totalSwellMeanWavePeriodTmm10\",\"totalSwellPeakPeriod\",\"totalSwellSignificantWaveHeight\",\"visibility\",\"weatherCode\",\"windDirection100m\",\"windDirection10m\",\"windDirection50m\",\"windGust100m\",\"windGust10m\",\"windGust50m\",\"windSpeed100m\",\"windSpeed10m\",\"windSpeed50m\",\"windWaveMeanWaveDirection\",\"windWaveMeanWaveDirectionalSpreading\",\"windWaveMeanWavePeriodTm02\",\"windWaveMeanWavePeriodTmm10\",\"windWavePeakPeriod\",\"windWaveSignificantWaveHeight\"]},{\"timestamp\":\"2023-08-10T17:00:00Z\",\"lat\":57.48,\"lon\":2.49,\"parameters\":[\"airPressureMeanSeaLevel\",\"airTemp\",\"airTemp10m\",\"dewPoint\",\"lightningProb\",\"maximumWaveHeight\",\"meanWaveDirection\",\"meanWaveDirectionalSpreading\",\"meanWavePeriodTm02\",\"meanWavePeriodTmm10\",\"peakPeriod\",\"precipAmount1h\",\"precipProb\",\"relativeHumidity\",\"seaIceConcentration\",\"seaSurfaceTemp\",\"significantWaveHeight\",\"significantWaveHeightRiskP90\",\"totalCurrentDirection\",\"totalCurrentVelocity\",\"totalSwellMeanWaveDirection\",\"totalSwellMeanWaveDirectionalSpreading\",\"totalSwellMeanWavePeriodTm02\",\"totalSwellMeanWavePeriodTmm10\",\"totalSwellPeakPeriod\",\"totalSwellSignificantWaveHeight\",\"visibility\",\"weatherCode\",\"windDirection100m\",\"windDirection10m\",\"windDirection50m\",\"windGust100m\",\"windGust10m\",\"windGust50m\",\"windSpeed100m\",\"windSpeed10m\",\"windSpeed50m\",\"windWaveMeanWaveDirection\",\"windWaveMeanWaveDirectionalSpreading\",\"windWaveMeanWavePeriodTm02\",\"windWaveMeanWavePeriodTmm10\",\"windWavePeakPeriod\",\"windWaveSignificantWaveHeight\"]}]' | \\\n http POST 'https://weather.api.dtn.com/v1/conditions/marine/route?parameters=SOME_ARRAY_VALUE' \\\n Accept:SOME_STRING_VALUE \\\n Accept-Encoding:SOME_STRING_VALUE \\\n Authorization:'Bearer REPLACE_BEARER_TOKEN' \\\n content-type:application/json"
- lang: Shell + Wget
source: "wget --quiet \\\n --method POST \\\n --header 'content-type: application/json' \\\n --header 'Accept-Encoding: SOME_STRING_VALUE' \\\n --header 'Accept: SOME_STRING_VALUE' \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \\\n --body-data '[{\"timestamp\":\"2023-08-10T16:00:00Z\",\"lat\":55.81,\"lon\":3.88,\"parameters\":[\"airPressureMeanSeaLevel\",\"airTemp\",\"airTemp10m\",\"dewPoint\",\"lightningProb\",\"maximumWaveHeight\",\"meanWaveDirection\",\"meanWaveDirectionalSpreading\",\"meanWavePeriodTm02\",\"meanWavePeriodTmm10\",\"peakPeriod\",\"precipAmount1h\",\"precipProb\",\"relativeHumidity\",\"seaIceConcentration\",\"seaSurfaceTemp\",\"significantWaveHeight\",\"significantWaveHeightRiskP90\",\"totalCurrentDirection\",\"totalCurrentVelocity\",\"totalSwellMeanWaveDirection\",\"totalSwellMeanWaveDirectionalSpreading\",\"totalSwellMeanWavePeriodTm02\",\"totalSwellMeanWavePeriodTmm10\",\"totalSwellPeakPeriod\",\"totalSwellSignificantWaveHeight\",\"visibility\",\"weatherCode\",\"windDirection100m\",\"windDirection10m\",\"windDirection50m\",\"windGust100m\",\"windGust10m\",\"windGust50m\",\"windSpeed100m\",\"windSpeed10m\",\"windSpeed50m\",\"windWaveMeanWaveDirection\",\"windWaveMeanWaveDirectionalSpreading\",\"windWaveMeanWavePeriodTm02\",\"windWaveMeanWavePeriodTmm10\",\"windWavePeakPeriod\",\"windWaveSignificantWaveHeight\"]},{\"timestamp\":\"2023-08-10T17:00:00Z\",\"lat\":57.48,\"lon\":2.49,\"parameters\":[\"airPressureMeanSeaLevel\",\"airTemp\",\"airTemp10m\",\"dewPoint\",\"lightningProb\",\"maximumWaveHeight\",\"meanWaveDirection\",\"meanWaveDirectionalSpreading\",\"meanWavePeriodTm02\",\"meanWavePeriodTmm10\",\"peakPeriod\",\"precipAmount1h\",\"precipProb\",\"relativeHumidity\",\"seaIceConcentration\",\"seaSurfaceTemp\",\"significantWaveHeight\",\"significantWaveHeightRiskP90\",\"totalCurrentDirection\",\"totalCurrentVelocity\",\"totalSwellMeanWaveDirection\",\"totalSwellMeanWaveDirectionalSpreading\",\"totalSwellMeanWavePeriodTm02\",\"totalSwellMeanWavePeriodTmm10\",\"totalSwellPeakPeriod\",\"totalSwellSignificantWaveHeight\",\"visibility\",\"weatherCode\",\"windDirection100m\",\"windDirection10m\",\"windDirection50m\",\"windGust100m\",\"windGust10m\",\"windGust50m\",\"windSpeed100m\",\"windSpeed10m\",\"windSpeed50m\",\"windWaveMeanWaveDirection\",\"windWaveMeanWaveDirectionalSpreading\",\"windWaveMeanWavePeriodTm02\",\"windWaveMeanWavePeriodTmm10\",\"windWavePeakPeriod\",\"windWaveSignificantWaveHeight\"]}]' \\\n --output-document \\\n - 'https://weather.api.dtn.com/v1/conditions/marine/route?parameters=SOME_ARRAY_VALUE'"
- lang: Swift + Nsurlsession
source: "import Foundation\n\nlet headers = [\n \"content-type\": \"application/json\",\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n]\nlet parameters = [\n [\n \"timestamp\": \"2023-08-10T16:00:00Z\",\n \"lat\": 55.81,\n \"lon\": 3.88,\n \"parameters\": [\"airPressureMeanSeaLevel\", \"airTemp\", \"airTemp10m\", \"dewPoint\", \"lightningProb\", \"maximumWaveHeight\", \"meanWaveDirection\", \"meanWaveDirectionalSpreading\", \"meanWavePeriodTm02\", \"meanWavePeriodTmm10\", \"peakPeriod\", \"precipAmount1h\", \"precipProb\", \"relativeHumidity\", \"seaIceConcentration\", \"seaSurfaceTemp\", \"significantWaveHeight\", \"significantWaveHeightRiskP90\", \"totalCurrentDirection\", \"totalCurrentVelocity\", \"totalSwellMeanWaveDirection\", \"totalSwellMeanWaveDirectionalSpreading\", \"totalSwellMeanWavePeriodTm02\", \"totalSwellMeanWavePeriodTmm10\", \"totalSwellPeakPeriod\", \"totalSwellSignificantWaveHeight\", \"visibility\", \"weatherCode\", \"windDirection100m\", \"windDirection10m\", \"windDirection50m\", \"windGust100m\", \"windGust10m\", \"windGust50m\", \"windSpeed100m\", \"windSpeed10m\", \"windSpeed50m\", \"windWaveMeanWaveDirection\", \"windWaveMeanWaveDirectionalSpreading\", \"windWaveMeanWavePeriodTm02\", \"windWaveMeanWavePeriodTmm10\", \"windWavePeakPeriod\", \"windWaveSignificantWaveHeight\"]\n ],\n [\n \"timestamp\": \"2023-08-10T17:00:00Z\",\n \"lat\": 57.48,\n \"lon\": 2.49,\n \"parameters\": [\"airPressureMeanSeaLevel\", \"airTemp\", \"airTemp10m\", \"dewPoint\", \"lightningProb\", \"maximumWaveHeight\", \"meanWaveDirection\", \"meanWaveDirectionalSpreading\", \"meanWavePeriodTm02\", \"meanWavePeriodTmm10\", \"peakPeriod\", \"precipAmount1h\", \"precipProb\", \"relativeHumidity\", \"seaIceConcentration\", \"seaSurfaceTemp\", \"significantWaveHeight\", \"significantWaveHeightRiskP90\", \"totalCurrentDirection\", \"totalCurrentVelocity\", \"totalSwellMeanWaveDirection\", \"totalSwellMeanWaveDirectionalSpreading\", \"totalSwellMeanWavePeriodTm02\", \"totalSwellMeanWavePeriodTmm10\", \"totalSwellPeakPeriod\", \"totalSwellSignificantWaveHeight\", \"visibility\", \"weatherCode\", \"windDirection100m\", \"windDirection10m\", \"windDirection50m\", \"windGust100m\", \"windGust10m\", \"windGust50m\", \"windSpeed100m\", \"windSpeed10m\", \"windSpeed50m\", \"windWaveMeanWaveDirection\", \"windWaveMeanWaveDirectionalSpreading\", \"windWaveMeanWavePeriodTm02\", \"windWaveMeanWavePeriodTmm10\", \"windWavePeakPeriod\", \"windWaveSignificantWaveHeight\"]\n ]\n] as [String : Any]\n\nlet postData = JSONSerialization.data(withJSONObject: parameters, options: [])\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://weather.api.dtn.com/v1/conditions/marine/route?parameters=SOME_ARRAY_VALUE\")! as URL,\n cachePolicy: .useProtocolCachePolicy,\n timeoutInterval: 10.0)\nrequest.httpMethod = \"POST\"\nrequest.allHTTPHeaderFields = headers\nrequest.httpBody = postData as Data\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n if (error != nil) {\n print(error)\n } else {\n let httpResponse = response as? HTTPURLResponse\n print(httpResponse)\n }\n})\n\ndataTask.resume()"
servers:
- url: https://weather.api.dtn.com
/v1/conditions/marine/wave-partitions:
get:
tags:
- Endpoints
summary: Wave Partitions
description: "This endpoint provides a forecast for unique wave partition parameters. Like the Marine Conditions endpoint, specify the location, the marine parameters of interest, and a time range up to 10 days long, from now to 10 days in the future. The API responds with the requested time series in GeoJSON format.\n\nUse query parameters to control the results in the response body:\n\n * Specify a location as latitude (`lat`) and longitude (`lon`).\n\n * Specify `parameters` to filter by specific marine weather parameters. Include multiple as comma-separated values. The API returns only defaults when no specific parameters are requested.\n\n * Two important parameters are `startTime` and `endTime`:\n + The API returns forecast data when `startTime` and `endTime` are in the future.\n + The API returns only one exact timestamp when only `startTime` is specified.\n\n * Complete example: `https://weather.api.dtn.com/v1/conditions/marine/wave-partitions?lat={lat}&lon={lon}&startTime={start_time}&endTime={end_time}¶meters={param1,param2}`\n"
operationId: wavePartitions
security:
- clientCredentials: []
parameters:
- in: header
name: Accept-Encoding
schema:
type: string
description: Use this request header to communicate which compression algorithms the client understands. The API supports gzip.
example: gzip
- in: header
name: Accept
schema:
type: string
description: Use this request header to specify an acceptable response media type.
example: application/json
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
url:
type: string
type:
type: string
features:
type: array
items:
type: object
properties:
type:
type: string
geometry:
type: object
properties:
type:
type: string
coordinates:
type: array
items:
type: number
properties:
type: object
properties:
'2024-05-20T10:00:00Z':
type: object
properties:
significantWaveHeightPart1Of6:
type: number
significantWaveHeightPart2Of6:
type: number
significantWaveHeightPart3Of6:
type: number
significantWaveHeightPart4Of6:
type: number
significantWaveHeightPart5Of6:
type: number
significantWaveHeightPart6Of6:
type: number
peakPeriodPart1Of6:
type: number
peakPeriodPart2Of6:
type: number
peakPeriodPart3Of6:
type: number
peakPeriodPart4Of6:
type: number
peakPeriodPart5Of6:
type: number
peakPeriodPart6Of6:
type: number
meanWaveDirectionalSpreadingPart1Of6:
type: number
meanWaveDirectionalSpreadingPart2Of6:
type: number
meanWaveDirectionalSpreadingPart3Of6:
type: number
meanWaveDirectionalSpreadingPart4Of6:
type: number
meanWaveDirectionalSpreadingPart5Of6:
type: number
meanWaveDirectionalSpreadingPart6Of6:
type: number
meanWaveDirectionPart1Of6:
type: number
meanWaveDirectionPart2Of6:
type: number
meanWaveDirectionPart3Of6:
type: number
meanWaveDirectionPart4Of6:
type: number
meanWaveDirectionPart5Of6:
type: number
meanWaveDirectionPart6Of6:
type: number
example:
url: https://weather.api.dtn.com/v1/conditions/marine/wave-partitions?lat=55.81&lon=3.88¶meters=meanWaveDirectionPart1Of6,meanWaveDirectionPart2Of6,meanWaveDirectionPart3Of6,meanWaveDirectionPart4Of6,meanWaveDirectionPart5Of6,meanWaveDirectionPart6Of6,meanWaveDirectionalSpreadingPart1Of6,meanWaveDirectionalSpreadingPart2Of6,meanWaveDirectionalSpreadingPart3Of6,meanWaveDirectionalSpreadingPart4Of6,meanWaveDirectionalSpreadingPart5Of6,meanWaveDirectionalSpreadingPart6Of6,peakPeriodPart1Of6,peakPeriodPart2Of6,peakPeriodPart3Of6,peakPeriodPart4Of6,peakPeriodPart5Of6,peakPeriodPart6Of6,significantWaveHeightPart1Of6,significantWaveHeightPart2Of6,significantWaveHeightPart3Of6,significantWaveHeightPart4Of6,significantWaveHeightPart5Of6,significantWaveHeightPart6Of6&startTime=2024-05-15T16:13:53Z&endTime=2024-05-15T18:13:53Z
type: FeatureCollection
features:
- type: Feature
geometry:
type: Point
coordinates:
- 3.88
- 55.81
properties:
'2024-05-15T16:00:00Z':
meanWaveDirectionPart1Of6: 108.3,
meanWaveDirectionPart2Of6: 42.5,
meanWaveDirectionPart3Of6: 45.7,
meanWaveDirectionPart4Of6: 198.6,
meanWaveDirectionPart5Of6: 44.2,
meanWaveDirectionPart6Of6: 134.1,
meanWaveDirectionalSpreadingPart1Of6: 35,
meanWaveDirectionalSpreadingPart2Of6: 13.45,
meanWaveDirectionalSpreadingPart3Of6: 14.82,
meanWaveDirectionalSpreadingPart4Of6: 9.3,
meanWaveDirectionalSpreadingPart5Of6: 10.32,
meanWaveDirectionalSpreadingPart6Of6: 12.34,
peakPeriodPart1Of6: 6.3,
peakPeriodPart2Of6: 5.2,
peakPeriodPart3Of6: 5.2,
peakPeriodPart4Of6: 4.75,
peakPeriodPart5Of6: 4.89,
peakPeriodPart6Of6: 5.2,
significantWaveHeightPart1Of6: 1.72,
significantWaveHeightPart2Of6: 0.57,
significantWaveHeightPart3Of6: 0.63,
significantWaveHeightPart4Of6: 0.16,
significantWaveHeightPart5Of6: 0.12,
significantWaveHeightPart6Of6: 0.11
'2024-05-15T17:00:00Z':
meanWaveDirectionPart1Of6: 115,
meanWaveDirectionPart2Of6: 41.8,
meanWaveDirectionPart3Of6: 41.4,
meanWaveDirectionPart4Of6: 36.6,
meanWaveDirectionPart5Of6: 190,
meanWaveDirectionPart6Of6: 130.1,
meanWaveDirectionalSpreadingPart1Of6: 29.2,
meanWaveDirectionalSpreadingPart2Of6: 13.4,
meanWaveDirectionalSpreadingPart3Of6: 13.3,
meanWaveDirectionalSpreadingPart4Of6: 12.13,
meanWaveDirectionalSpreadingPart5Of6: 0,
meanWaveDirectionalSpreadingPart6Of6: 12.11,
peakPeriodPart1Of6: 6.3,
peakPeriodPart2Of6: 5.2,
peakPeriodPart3Of6: 5.2,
peakPeriodPart4Of6: 6.3,
peakPeriodPart5Of6: 4.75,
peakPeriodPart6Of6: 4.1,
significantWaveHeightPart1Of6: 1.65,
significantWaveHeightPart2Of6: 0.58,
significantWaveHeightPart3Of6: 0.59,
significantWaveHeightPart4Of6: 0.34,
significantWaveHeightPart5Of6: 0.08,
significantWaveHeightPart6Of6: 0.15
'2024-05-15T18:00:00Z':
meanWaveDirectionPart1Of6: 107.2,
meanWaveDirectionPart2Of6: 63.55,
meanWaveDirectionPart3Of6: 40.65,
meanWaveDirectionPart4Of6: 35.9,
meanWaveDirectionPart5Of6: 108.1,
meanWaveDirectionPart6Of6: 77.1,
meanWaveDirectionalSpreadingPart1Of6: 35.1,
meanWaveDirectionalSpreadingPart2Of6: 15.16,
meanWaveDirectionalSpreadingPart3Of6: 13.56,
meanWaveDirectionalSpreadingPart4Of6: 12.4,
meanWaveDirectionalSpreadingPart5Of6: 12.1,
meanWaveDirectionalSpreadingPart6Of6: 13.9,
peakPeriodPart1Of6: 6.3,
peakPeriodPart2Of6: 5.5,
peakPeriodPart3Of6: 5.2,
peakPeriodPart4Of6: 6.3,
peakPeriodPart5Of6: 5.2,
peakPeriodPart6Of6: 5.9,
significantWaveHeightPart1Of6: 1.79,
significantWaveHeightPart2Of6: 0.83,
significantWaveHeightPart3Of6: 0.6,
significantWaveHeightPart4Of6: 0.33,
significantWaveHeightPart5Of6: 0.78,
significantWaveHeightPart6Of6: 1.55
responses:
'200':
description: A successful request.
content:
application/json:
schema:
oneOf:
- type: object
properties:
url:
type: string
type:
type: string
features:
type: array
items:
type: object
properties:
type:
type: string
geometry:
type: object
properties:
type:
type: string
coordinates:
type: array
items:
type: number
properties:
type: object
properties:
'2024-05-20T10:00:00Z':
type: object
properties:
significantWaveHeightPart1Of6:
type: number
significantWaveHeightPart2Of6:
type: number
significantWaveHeightPart3Of6:
type: number
significantWaveHeightPart4Of6:
type: number
significantWaveHeightPart5Of6:
type: number
significantWaveHeightPart6Of6:
type: number
peakPeriodPart1Of6:
type: number
peakPeriodPart2Of6:
type: number
peakPeriodPart3Of6:
type: number
peakPeriodPart4Of6:
type: number
peakPeriodPart5Of6:
type: number
peakPeriodPart6Of6:
type: number
meanWaveDirectionalSpreadingPart1Of6:
type: number
meanWaveDirectionalSpreadingPart2Of6:
type: number
meanWaveDirectionalSpreadingPart3Of6:
type: number
meanWaveDirectionalSpreadingPart4Of6:
type: number
meanWaveDirectionalSpreadingPart5Of6:
type: number
meanWaveDirectionalSpreadingPart6Of6:
type: number
meanWaveDirectionPart1Of6:
type: number
meanWaveDirectionPart2Of6:
type: number
meanWaveDirectionPart3Of6:
type: number
meanWaveDirectionPart4Of6:
type: number
meanWaveDirectionPart5Of6:
type: number
meanWaveDirectionPart6Of6:
type: number
example:
url: https://weather.api.dtn.com/v1/conditions/marine/wave-partitions?lat=55.81&lon=3.88¶meters=meanWaveDirectionPart1Of6,meanWaveDirectionPart2Of6,meanWaveDirectionPart3Of6,meanWaveDirectionPart4Of6,meanWaveDirectionPart5Of6,meanWaveDirectionPart6Of6,meanWaveDirectionalSpreadingPart1Of6,meanWaveDirectionalSpreadingPart2Of6,meanWaveDirectionalSpreadingPart3Of6,meanWaveDirectionalSpreadingPart4Of6,meanWaveDirectionalSpreadingPart5Of6,meanWaveDirectionalSpreadingPart6Of6,peakPeriodPart1Of6,peakPeriodPart2Of6,peakPeriodPart3Of6,peakPeriodPart4Of6,peakPeriodPart5Of6,peakPeriodPart6Of6,significantWaveHeightPart1Of6,significantWaveHeightPart2Of6,significantWaveHeightPart3Of6,significantWaveHeightPart4Of6,significantWaveHeightPart5Of6,significantWaveHeightPart6Of6&startTime=2024-05-15T16:13:53Z&endTime=2024-05-15T18:13:53Z
type: FeatureCollection
features:
- type: Feature
geometry:
type: Point
coordinates:
- 3.88
- 55.81
properties:
'2024-05-15T16:00:00Z':
meanWaveDirectionPart1Of6: 108.3,
meanWaveDirectionPart2Of6: 42.5,
meanWaveDirectionPart3Of6: 45.7,
meanWaveDirectionPart4Of6: 198.6,
meanWaveDirectionPart5Of6: 44.2,
meanWaveDirectionPart6Of6: 134.1,
meanWaveDirectionalSpreadingPart1Of6: 35,
meanWaveDirectionalSpreadingPart2Of6: 13.45,
meanWaveDirectionalSpreadingPart3Of6: 14.82,
meanWaveDirectionalSpreadingPart4Of6: 9.3,
meanWaveDirectionalSpreadingPart5Of6: 10.32,
meanWaveDirectionalSpreadingPart6Of6: 12.34,
peakPeriodPart1Of6: 6.3,
peakPeriodPart2Of6: 5.2,
peakPeriodPart3Of6: 5.2,
peakPeriodPart4Of6: 4.75,
peakPeriodPart5Of6: 4.89,
peakPeriodPart6Of6: 5.2,
significantWaveHeightPart1Of6: 1.72,
significantWaveHeightPart2Of6: 0.57,
significantWaveHeightPart3Of6: 0.63,
significantWaveHeightPart4Of6: 0.16,
significantWaveHeightPart5Of6: 0.12,
significantWaveHeightPart6Of6: 0.11
'2024-05-15T17:00:00Z':
meanWaveDirectionPart1Of6: 115,
meanWaveDirectionPart2Of6: 41.8,
meanWaveDirectionPart3Of6: 41.4,
meanWaveDirectionPart4Of6: 36.6,
meanWaveDirectionPart5Of6: 190,
meanWaveDirectionPart6Of6: 130.1,
meanWaveDirectionalSpreadingPart1Of6: 29.2,
meanWaveDirectionalSpreadingPart2Of6: 13.4,
meanWaveDirectionalSpreadingPart3Of6: 13.3,
meanWaveDirectionalSpreadingPart4Of6: 12.13,
meanWaveDirectionalSpreadingPart5Of6: 0,
meanWaveDirectionalSpreadingPart6Of6: 12.11,
peakPeriodPart1Of6: 6.3,
peakPeriodPart2Of6: 5.2,
peakPeriodPart3Of6: 5.2,
peakPeriodPart4Of6: 6.3,
peakPeriodPart5Of6: 4.75,
peakPeriodPart6Of6: 4.1,
significantWaveHeightPart1Of6: 1.65,
significantWaveHeightPart2Of6: 0.58,
significantWaveHeightPart3Of6: 0.59,
significantWaveHeightPart4Of6: 0.34,
significantWaveHeightPart5Of6: 0.08,
significantWaveHeightPart6Of6: 0.15
'2024-05-15T18:00:00Z':
meanWaveDirectionPart1Of6: 107.2,
meanWaveDirectionPart2Of6: 63.55,
meanWaveDirectionPart3Of6: 40.65,
meanWaveDirectionPart4Of6: 35.9,
meanWaveDirectionPart5Of6: 108.1,
meanWaveDirectionPart6Of6: 77.1,
meanWaveDirectionalSpreadingPart1Of6: 35.1,
meanWaveDirectionalSpreadingPart2Of6: 15.16,
meanWaveDirectionalSpreadingPart3Of6: 13.56,
meanWaveDirectionalSpreadingPart4Of6: 12.4,
meanWaveDirectionalSpreadingPart5Of6: 12.1,
meanWaveDirectionalSpreadingPart6Of6: 13.9,
peakPeriodPart1Of6: 6.3,
peakPeriodPart2Of6: 5.5,
peakPeriodPart3Of6: 5.2,
peakPeriodPart4Of6: 6.3,
peakPeriodPart5Of6: 5.2,
peakPeriodPart6Of6: 5.9,
significantWaveHeightPart1Of6: 1.79,
significantWaveHeightPart2Of6: 0.83,
significantWaveHeightPart3Of6: 0.6,
significantWaveHeightPart4Of6: 0.33,
significantWaveHeightPart5Of6: 0.78,
significantWaveHeightPart6Of6: 1.55
'400':
description: An invalid request.
content:
application/problem+json:
schema:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: false
example:
type: bad-request
title: Invalid Request
detail: Validation failed.
status: 400
instance: urn:dtn:one-marine-weather-service:/v1/conditions/marine:requestId:123e4567-e89b-12d3-a458-426614176000
'401':
description: Unable to authenticate credentials.
content:
application/problem+json:
schema:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: false
example:
type: unauthorized
title: Error while authenticating the user.
detail: invalid token
status: 401
instance: urn:dtn:one-marine-weather-service:/v1/conditions/marine:requestId:123e4567-e89b-12d3-a458-426614176000
'406':
description: Unable to produce a response matching the Accept request header.
content:
application/problem+json:
schema:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: false
example:
type: not-acceptable
title: Not Acceptable
detail: The Accept header value is invalid or unsupported.
status: 406
instance: urn:dtn:one-marine-weather-service:/v1/conditions/marine:requestId:123e4567-e89b-12d3-a458-426614176000
x-codeSamples:
- lang: C + Libcurl
source: 'CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://weather.api.dtn.com/v1/conditions/marine/wave-partitions");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
headers = curl_slist_append(headers, "Accept-Encoding: SOME_STRING_VALUE");
headers = curl_slist_append(headers, "Accept: SOME_STRING_VALUE");
headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"url\":\"https://weather.api.dtn.com/v1/conditions/marine/wave-partitions?lat=55.81&lon=3.88¶meters=meanWaveDirectionPart1Of6,meanWaveDirectionPart2Of6,meanWaveDirectionPart3Of6,meanWaveDirectionPart4Of6,meanWaveDirectionPart5Of6,meanWaveDirectionPart6Of6,meanWaveDirectionalSpreadingPart1Of6,meanWaveDirectionalSpreadingPart2Of6,meanWaveDirectionalSpreadingPart3Of6,meanWaveDirectionalSpreadingPart4Of6,meanWaveDirectionalSpreadingPart5Of6,meanWaveDirectionalSpreadingPart6Of6,peakPeriodPart1Of6,peakPeriodPart2Of6,peakPeriodPart3Of6,peakPeriodPart4Of6,peakPeriodPart5Of6,peakPeriodPart6Of6,significantWaveHeightPart1Of6,significantWaveHeightPart2Of6,significantWaveHeightPart3Of6,significantWaveHeightPart4Of6,significantWaveHeightPart5Of6,significantWaveHeightPart6Of6&startTime=2024-05-15T16:13:53Z&endTime=2024-05-15T18:13:53Z\",\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[3.88,55.81]},\"properties\":{\"2024-05-15T16:00:00Z\":{\"meanWaveDirectionPart1Of6\":\"108.3,\",\"meanWaveDirectionPart2Of6\":\"42.5,\",\"meanWaveDirectionPart3Of6\":\"45.7,\",\"meanWaveDirectionPart4Of6\":\"198.6,\",\"meanWaveDirectionPart5Of6\":\"44.2,\",\"meanWaveDirectionPart6Of6\":\"134.1,\",\"meanWaveDirectionalSpreadingPart1Of6\":\"35,\",\"meanWaveDirectionalSpreadingPart2Of6\":\"13.45,\",\"meanWaveDirectionalSpreadingPart3Of6\":\"14.82,\",\"meanWaveDirectionalSpreadingPart4Of6\":\"9.3,\",\"meanWaveDirectionalSpreadingPart5Of6\":\"10.32,\",\"meanWaveDirectionalSpreadingPart6Of6\":\"12.34,\",\"peakPeriodPart1Of6\":\"6.3,\",\"peakPeriodPart2Of6\":\"5.2,\",\"peakPeriodPart3Of6\":\"5.2,\",\"peakPeriodPart4Of6\":\"4.75,\",\"peakPeriodPart5Of6\":\"4.89,\",\"peakPeriodPart6Of6\":\"5.2,\",\"significantWaveHeightPart1Of6\":\"1.72,\",\"significantWaveHeightPart2Of6\":\"0.57,\",\"significantWaveHeightPart3Of6\":\"0.63,\",\"significantWaveHeightPart4Of6\":\"0.16,\",\"significantWaveHeightPart5Of6\":\"0.12,\",\"significantWaveHeightPart6Of6\":0.11},\"2024-05-15T17:00:00Z\":{\"meanWaveDirectionPart1Of6\":\"115,\",\"meanWaveDirectionPart2Of6\":\"41.8,\",\"meanWaveDirectionPart3Of6\":\"41.4,\",\"meanWaveDirectionPart4Of6\":\"36.6,\",\"meanWaveDirectionPart5Of6\":\"190,\",\"meanWaveDirectionPart6Of6\":\"130.1,\",\"meanWaveDirectionalSpreadingPart1Of6\":\"29.2,\",\"meanWaveDirectionalSpreadingPart2Of6\":\"13.4,\",\"meanWaveDirectionalSpreadingPart3Of6\":\"13.3,\",\"meanWaveDirectionalSpreadingPart4Of6\":\"12.13,\",\"meanWaveDirectionalSpreadingPart5Of6\":\"0,\",\"meanWaveDirectionalSpreadingPart6Of6\":\"12.11,\",\"peakPeriodPart1Of6\":\"6.3,\",\"peakPeriodPart2Of6\":\"5.2,\",\"peakPeriodPart3Of6\":\"5.2,\",\"peakPeriodPart4Of6\":\"6.3,\",\"peakPeriodPart5Of6\":\"4.75,\",\"peakPeriodPart6Of6\":\"4.1,\",\"significantWaveHeightPart1Of6\":\"1.65,\",\"significantWaveHeightPart2Of6\":\"0.58,\",\"significantWaveHeightPart3Of6\":\"0.59,\",\"significantWaveHeightPart4Of6\":\"0.34,\",\"significantWaveHeightPart5Of6\":\"0.08,\",\"significantWaveHeightPart6Of6\":0.15},\"2024-05-15T18:00:00Z\":{\"meanWaveDirectionPart1Of6\":\"107.2,\",\"meanWaveDirectionPart2Of6\":\"63.55,\",\"meanWaveDirectionPart3Of6\":\"40.65,\",\"meanWaveDirectionPart4Of6\":\"35.9,\",\"meanWaveDirectionPart5Of6\":\"108.1,\",\"meanWaveDirectionPart6Of6\":\"77.1,\",\"meanWaveDirectionalSpreadingPart1Of6\":\"35.1,\",\"meanWaveDirectionalSpreadingPart2Of6\":\"15.16,\",\"meanWaveDirectionalSpreadingPart3Of6\":\"13.56,\",\"meanWaveDirectionalSpreadingPart4Of6\":\"12.4,\",\"meanWaveDirectionalSpreadingPart5Of6\":\"12.1,\",\"meanWaveDirectionalSpreadingPart6Of6\":\"13.9,\",\"peakPeriodPart1Of6\":\"6.3,\",\"peakPeriodPart2Of6\":\"5.5,\",\"peakPeriodPart3Of6\":\"5.2,\",\"peakPeriodPart4Of6\":\"6.3,\",\"peakPeriodPart5Of6\":\"5.2,\",\"peakPeriodPart6Of6\":\"5.9,\",\"significantWaveHeightPart1Of6\":\"1.79,\",\"significantWaveHeightPart2Of6\":\"0.83,\",\"significantWaveHeightPart3Of6\":\"0.6,\",\"significantWaveHeightPart4Of6\":\"0.33,\",\"significantWaveHeightPart5Of6\":\"0.78,\",\"significantWaveHeightPart6Of6\":1.55}}}]}");
CURLcode ret = curl_easy_perform(hnd);'
- lang: Csharp + Restsharp
source: 'var client = new RestClient("https://weather.api.dtn.com/v1/conditions/marine/wave-partitions");
var request = new RestRequest(Method.GET);
request.AddHeader("content-type", "application/json");
request.AddHeader("Accept-Encoding", "SOME_STRING_VALUE");
request.AddHeader("Accept", "SOME_STRING_VALUE");
request.AddHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
request.AddParameter("application/json", "{\"url\":\"https://weather.api.dtn.com/v1/conditions/marine/wave-partitions?lat=55.81&lon=3.88¶meters=meanWaveDirectionPart1Of6,meanWaveDirectionPart2Of6,meanWaveDirectionPart3Of6,meanWaveDirectionPart4Of6,meanWaveDirectionPart5Of6,meanWaveDirectionPart6Of6,meanWaveDirectionalSpreadingPart1Of6,meanWaveDirectionalSpreadingPart2Of6,meanWaveDirectionalSpreadingPart3Of6,meanWaveDirectionalSpreadingPart4Of6,meanWaveDirectionalSpreadingPart5Of6,meanWaveDirectionalSpreadingPart6Of6,peakPeriodPart1Of6,peakPeriodPart2Of6,peakPeriodPart3Of6,peakPeriodPart4Of6,peakPeriodPart5Of6,peakPeriodPart6Of6,significantWaveHeightPart1Of6,significantWaveHeightPart2Of6,significantWaveHeightPart3Of6,significantWaveHeightPart4Of6,significantWaveHeightPart5Of6,significantWaveHeightPart6Of6&startTime=2024-05-15T16:13:53Z&endTime=2024-05-15T18:13:53Z\",\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[3.88,55.81]},\"properties\":{\"2024-05-15T16:00:00Z\":{\"meanWaveDirectionPart1Of6\":\"108.3,\",\"meanWaveDirectionPart2Of6\":\"42.5,\",\"meanWaveDirectionPart3Of6\":\"45.7,\",\"meanWaveDirectionPart4Of6\":\"198.6,\",\"meanWaveDirectionPart5Of6\":\"44.2,\",\"meanWaveDirectionPart6Of6\":\"134.1,\",\"meanWaveDirectionalSpreadingPart1Of6\":\"35,\",\"meanWaveDirectionalSpreadingPart2Of6\":\"13.45,\",\"meanWaveDirectionalSpreadingPart3Of6\":\"14.82,\",\"meanWaveDirectionalSpreadingPart4Of6\":\"9.3,\",\"meanWaveDirectionalSpreadingPart5Of6\":\"10.32,\",\"meanWaveDirectionalSpreadingPart6Of6\":\"12.34,\",\"peakPeriodPart1Of6\":\"6.3,\",\"peakPeriodPart2Of6\":\"5.2,\",\"peakPeriodPart3Of6\":\"5.2,\",\"peakPeriodPart4Of6\":\"4.75,\",\"peakPeriodPart5Of6\":\"4.89,\",\"peakPeriodPart6Of6\":\"5.2,\",\"significantWaveHeightPart1Of6\":\"1.72,\",\"significantWaveHeightPart2Of6\":\"0.57,\",\"significantWaveHeightPart3Of6\":\"0.63,\",\"significantWaveHeightPart4Of6\":\"0.16,\",\"significantWaveHeightPart5Of6\":\"0.12,\",\"significantWaveHeightPart6Of6\":0.11},\"2024-05-15T17:00:00Z\":{\"meanWaveDirectionPart1Of6\":\"115,\",\"meanWaveDirectionPart2Of6\":\"41.8,\",\"meanWaveDirectionPart3Of6\":\"41.4,\",\"meanWaveDirectionPart4Of6\":\"36.6,\",\"meanWaveDirectionPart5Of6\":\"190,\",\"meanWaveDirectionPart6Of6\":\"130.1,\",\"meanWaveDirectionalSpreadingPart1Of6\":\"29.2,\",\"meanWaveDirectionalSpreadingPart2Of6\":\"13.4,\",\"meanWaveDirectionalSpreadingPart3Of6\":\"13.3,\",\"meanWaveDirectionalSpreadingPart4Of6\":\"12.13,\",\"meanWaveDirectionalSpreadingPart5Of6\":\"0,\",\"meanWaveDirectionalSpreadingPart6Of6\":\"12.11,\",\"peakPeriodPart1Of6\":\"6.3,\",\"peakPeriodPart2Of6\":\"5.2,\",\"peakPeriodPart3Of6\":\"5.2,\",\"peakPeriodPart4Of6\":\"6.3,\",\"peakPeriodPart5Of6\":\"4.75,\",\"peakPeriodPart6Of6\":\"4.1,\",\"significantWaveHeightPart1Of6\":\"1.65,\",\"significantWaveHeightPart2Of6\":\"0.58,\",\"significantWaveHeightPart3Of6\":\"0.59,\",\"significantWaveHeightPart4Of6\":\"0.34,\",\"significantWaveHeightPart5Of6\":\"0.08,\",\"significantWaveHeightPart6Of6\":0.15},\"2024-05-15T18:00:00Z\":{\"meanWaveDirectionPart1Of6\":\"107.2,\",\"meanWaveDirectionPart2Of6\":\"63.55,\",\"meanWaveDirectionPart3Of6\":\"40.65,\",\"meanWaveDirectionPart4Of6\":\"35.9,\",\"meanWaveDirectionPart5Of6\":\"108.1,\",\"meanWaveDirectionPart6Of6\":\"77.1,\",\"meanWaveDirectionalSpreadingPart1Of6\":\"35.1,\",\"meanWaveDirectionalSpreadingPart2Of6\":\"15.16,\",\"meanWaveDirectionalSpreadingPart3Of6\":\"13.56,\",\"meanWaveDirectionalSpreadingPart4Of6\":\"12.4,\",\"meanWaveDirectionalSpreadingPart5Of6\":\"12.1,\",\"meanWaveDirectionalSpreadingPart6Of6\":\"13.9,\",\"peakPeriodPart1Of6\":\"6.3,\",\"peakPeriodPart2Of6\":\"5.5,\",\"peakPeriodPart3Of6\":\"5.2,\",\"peakPeriodPart4Of6\":\"6.3,\",\"peakPeriodPart5Of6\":\"5.2,\",\"peakPeriodPart6Of6\":\"5.9,\",\"significantWaveHeightPart1Of6\":\"1.79,\",\"significantWaveHeightPart2Of6\":\"0.83,\",\"significantWaveHeightPart3Of6\":\"0.6,\",\"significantWaveHeightPart4Of6\":\"0.33,\",\"significantWaveHeightPart5Of6\":\"0.78,\",\"significantWaveHeightPart6Of6\":1.55}}}]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);'
- lang: Go + Native
source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://weather.api.dtn.com/v1/conditions/marine/wave-partitions\"\n\n\tpayload := strings.NewReader(\"{\\\"url\\\":\\\"https://weather.api.dtn.com/v1/conditions/marine/wave-partitions?lat=55.81&lon=3.88¶meters=meanWaveDirectionPart1Of6,meanWaveDirectionPart2Of6,meanWaveDirectionPart3Of6,meanWaveDirectionPart4Of6,meanWaveDirectionPart5Of6,meanWaveDirectionPart6Of6,meanWaveDirectionalSpreadingPart1Of6,meanWaveDirectionalSpreadingPart2Of6,meanWaveDirectionalSpreadingPart3Of6,meanWaveDirectionalSpreadingPart4Of6,meanWaveDirectionalSpreadingPart5Of6,meanWaveDirectionalSpreadingPart6Of6,peakPeriodPart1Of6,peakPeriodPart2Of6,peakPeriodPart3Of6,peakPeriodPart4Of6,peakPeriodPart5Of6,peakPeriodPart6Of6,significantWaveHeightPart1Of6,significantWaveHeightPart2Of6,significantWaveHeightPart3Of6,significantWaveHeightPart4Of6,significantWaveHeightPart5Of6,significantWaveHeightPart6Of6&startTime=2024-05-15T16:13:53Z&endTime=2024-05-15T18:13:53Z\\\",\\\"type\\\":\\\"FeatureCollection\\\",\\\"features\\\":[{\\\"type\\\":\\\"Feature\\\",\\\"geometry\\\":{\\\"type\\\":\\\"Point\\\",\\\"coordinates\\\":[3.88,55.81]},\\\"properties\\\":{\\\"2024-05-15T16:00:00Z\\\":{\\\"meanWaveDirectionPart1Of6\\\":\\\"108.3,\\\",\\\"meanWaveDirectionPart2Of6\\\":\\\"42.5,\\\",\\\"meanWaveDirectionPart3Of6\\\":\\\"45.7,\\\",\\\"meanWaveDirectionPart4Of6\\\":\\\"198.6,\\\",\\\"meanWaveDirectionPart5Of6\\\":\\\"44.2,\\\",\\\"meanWaveDirectionPart6Of6\\\":\\\"134.1,\\\",\\\"meanWaveDirectionalSpreadingPart1Of6\\\":\\\"35,\\\",\\\"meanWaveDirectionalSpreadingPart2Of6\\\":\\\"13.45,\\\",\\\"meanWaveDirectionalSpreadingPart3Of6\\\":\\\"14.82,\\\",\\\"meanWaveDirectionalSpreadingPart4Of6\\\":\\\"9.3,\\\",\\\"meanWaveDirectionalSpreadingPart5Of6\\\":\\\"10.32,\\\",\\\"meanWaveDirectionalSpreadingPart6Of6\\\":\\\"12.34,\\\",\\\"peakPeriodPart1Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart2Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart3Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart4Of6\\\":\\\"4.75,\\\",\\\"peakPeriodPart5Of6\\\":\\\"4.89,\\\",\\\"peakPeriodPart6Of6\\\":\\\"5.2,\\\",\\\"significantWaveHeightPart1Of6\\\":\\\"1.72,\\\",\\\"significantWaveHeightPart2Of6\\\":\\\"0.57,\\\",\\\"significantWaveHeightPart3Of6\\\":\\\"0.63,\\\",\\\"significantWaveHeightPart4Of6\\\":\\\"0.16,\\\",\\\"significantWaveHeightPart5Of6\\\":\\\"0.12,\\\",\\\"significantWaveHeightPart6Of6\\\":0.11},\\\"2024-05-15T17:00:00Z\\\":{\\\"meanWaveDirectionPart1Of6\\\":\\\"115,\\\",\\\"meanWaveDirectionPart2Of6\\\":\\\"41.8,\\\",\\\"meanWaveDirectionPart3Of6\\\":\\\"41.4,\\\",\\\"meanWaveDirectionPart4Of6\\\":\\\"36.6,\\\",\\\"meanWaveDirectionPart5Of6\\\":\\\"190,\\\",\\\"meanWaveDirectionPart6Of6\\\":\\\"130.1,\\\",\\\"meanWaveDirectionalSpreadingPart1Of6\\\":\\\"29.2,\\\",\\\"meanWaveDirectionalSpreadingPart2Of6\\\":\\\"13.4,\\\",\\\"meanWaveDirectionalSpreadingPart3Of6\\\":\\\"13.3,\\\",\\\"meanWaveDirectionalSpreadingPart4Of6\\\":\\\"12.13,\\\",\\\"meanWaveDirectionalSpreadingPart5Of6\\\":\\\"0,\\\",\\\"meanWaveDirectionalSpreadingPart6Of6\\\":\\\"12.11,\\\",\\\"peakPeriodPart1Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart2Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart3Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart4Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart5Of6\\\":\\\"4.75,\\\",\\\"peakPeriodPart6Of6\\\":\\\"4.1,\\\",\\\"significantWaveHeightPart1Of6\\\":\\\"1.65,\\\",\\\"significantWaveHeightPart2Of6\\\":\\\"0.58,\\\",\\\"significantWaveHeightPart3Of6\\\":\\\"0.59,\\\",\\\"significantWaveHeightPart4Of6\\\":\\\"0.34,\\\",\\\"significantWaveHeightPart5Of6\\\":\\\"0.08,\\\",\\\"significantWaveHeightPart6Of6\\\":0.15},\\\"2024-05-15T18:00:00Z\\\":{\\\"meanWaveDirectionPart1Of6\\\":\\\"107.2,\\\",\\\"meanWaveDirectionPart2Of6\\\":\\\"63.55,\\\",\\\"meanWaveDirectionPart3Of6\\\":\\\"40.65,\\\",\\\"meanWaveDirectionPart4Of6\\\":\\\"35.9,\\\",\\\"meanWaveDirectionPart5Of6\\\":\\\"108.1,\\\",\\\"meanWaveDirectionPart6Of6\\\":\\\"77.1,\\\",\\\"meanWaveDirectionalSpreadingPart1Of6\\\":\\\"35.1,\\\",\\\"meanWaveDirectionalSpreadingPart2Of6\\\":\\\"15.16,\\\",\\\"meanWaveDirectionalSpreadingPart3Of6\\\":\\\"13.56,\\\",\\\"meanWaveDirectionalSpreadingPart4Of6\\\":\\\"12.4,\\\",\\\"meanWaveDirectionalSpreadingPart5Of6\\\":\\\"12.1,\\\",\\\"meanWaveDirectionalSpreadingPart6Of6\\\":\\\"13.9,\\\",\\\"peakPeriodPart1Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart2Of6\\\":\\\"5.5,\\\",\\\"peakPeriodPart3Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart4Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart5Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart6Of6\\\":\\\"5.9,\\\",\\\"significantWaveHeightPart1Of6\\\":\\\"1.79,\\\",\\\"significantWaveHeightPart2Of6\\\":\\\"0.83,\\\",\\\"significantWaveHeightPart3Of6\\\":\\\"0.6,\\\",\\\"significantWaveHeightPart4Of6\\\":\\\"0.33,\\\",\\\"significantWaveHeightPart5Of6\\\":\\\"0.78,\\\",\\\"significantWaveHeightPart6Of6\\\":1.55}}}]}\")\n\n\treq, _ := http.NewRequest(\"GET\", url, payload)\n\n\treq.Header.Add(\"content-type\", \"application/json\")\n\treq.Header.Add(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n\treq.Header.Add(\"Accept\", \"SOME_STRING_VALUE\")\n\treq.Header.Add(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
- lang: Java + Okhttp
source: "OkHttpClient client = new OkHttpClient();\n\nMediaType mediaType = MediaType.parse(\"application/json\");\nRequestBody body = RequestBody.create(mediaType, \"{\\\"url\\\":\\\"https://weather.api.dtn.com/v1/conditions/marine/wave-partitions?lat=55.81&lon=3.88¶meters=meanWaveDirectionPart1Of6,meanWaveDirectionPart2Of6,meanWaveDirectionPart3Of6,meanWaveDirectionPart4Of6,meanWaveDirectionPart5Of6,meanWaveDirectionPart6Of6,meanWaveDirectionalSpreadingPart1Of6,meanWaveDirectionalSpreadingPart2Of6,meanWaveDirectionalSpreadingPart3Of6,meanWaveDirectionalSpreadingPart4Of6,meanWaveDirectionalSpreadingPart5Of6,meanWaveDirectionalSpreadingPart6Of6,peakPeriodPart1Of6,peakPeriodPart2Of6,peakPeriodPart3Of6,peakPeriodPart4Of6,peakPeriodPart5Of6,peakPeriodPart6Of6,significantWaveHeightPart1Of6,significantWaveHeightPart2Of6,significantWaveHeightPart3Of6,significantWaveHeightPart4Of6,significantWaveHeightPart5Of6,significantWaveHeightPart6Of6&startTime=2024-05-15T16:13:53Z&endTime=2024-05-15T18:13:53Z\\\",\\\"type\\\":\\\"FeatureCollection\\\",\\\"features\\\":[{\\\"type\\\":\\\"Feature\\\",\\\"geometry\\\":{\\\"type\\\":\\\"Point\\\",\\\"coordinates\\\":[3.88,55.81]},\\\"properties\\\":{\\\"2024-05-15T16:00:00Z\\\":{\\\"meanWaveDirectionPart1Of6\\\":\\\"108.3,\\\",\\\"meanWaveDirectionPart2Of6\\\":\\\"42.5,\\\",\\\"meanWaveDirectionPart3Of6\\\":\\\"45.7,\\\",\\\"meanWaveDirectionPart4Of6\\\":\\\"198.6,\\\",\\\"meanWaveDirectionPart5Of6\\\":\\\"44.2,\\\",\\\"meanWaveDirectionPart6Of6\\\":\\\"134.1,\\\",\\\"meanWaveDirectionalSpreadingPart1Of6\\\":\\\"35,\\\",\\\"meanWaveDirectionalSpreadingPart2Of6\\\":\\\"13.45,\\\",\\\"meanWaveDirectionalSpreadingPart3Of6\\\":\\\"14.82,\\\",\\\"meanWaveDirectionalSpreadingPart4Of6\\\":\\\"9.3,\\\",\\\"meanWaveDirectionalSpreadingPart5Of6\\\":\\\"10.32,\\\",\\\"meanWaveDirectionalSpreadingPart6Of6\\\":\\\"12.34,\\\",\\\"peakPeriodPart1Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart2Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart3Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart4Of6\\\":\\\"4.75,\\\",\\\"peakPeriodPart5Of6\\\":\\\"4.89,\\\",\\\"peakPeriodPart6Of6\\\":\\\"5.2,\\\",\\\"significantWaveHeightPart1Of6\\\":\\\"1.72,\\\",\\\"significantWaveHeightPart2Of6\\\":\\\"0.57,\\\",\\\"significantWaveHeightPart3Of6\\\":\\\"0.63,\\\",\\\"significantWaveHeightPart4Of6\\\":\\\"0.16,\\\",\\\"significantWaveHeightPart5Of6\\\":\\\"0.12,\\\",\\\"significantWaveHeightPart6Of6\\\":0.11},\\\"2024-05-15T17:00:00Z\\\":{\\\"meanWaveDirectionPart1Of6\\\":\\\"115,\\\",\\\"meanWaveDirectionPart2Of6\\\":\\\"41.8,\\\",\\\"meanWaveDirectionPart3Of6\\\":\\\"41.4,\\\",\\\"meanWaveDirectionPart4Of6\\\":\\\"36.6,\\\",\\\"meanWaveDirectionPart5Of6\\\":\\\"190,\\\",\\\"meanWaveDirectionPart6Of6\\\":\\\"130.1,\\\",\\\"meanWaveDirectionalSpreadingPart1Of6\\\":\\\"29.2,\\\",\\\"meanWaveDirectionalSpreadingPart2Of6\\\":\\\"13.4,\\\",\\\"meanWaveDirectionalSpreadingPart3Of6\\\":\\\"13.3,\\\",\\\"meanWaveDirectionalSpreadingPart4Of6\\\":\\\"12.13,\\\",\\\"meanWaveDirectionalSpreadingPart5Of6\\\":\\\"0,\\\",\\\"meanWaveDirectionalSpreadingPart6Of6\\\":\\\"12.11,\\\",\\\"peakPeriodPart1Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart2Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart3Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart4Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart5Of6\\\":\\\"4.75,\\\",\\\"peakPeriodPart6Of6\\\":\\\"4.1,\\\",\\\"significantWaveHeightPart1Of6\\\":\\\"1.65,\\\",\\\"significantWaveHeightPart2Of6\\\":\\\"0.58,\\\",\\\"significantWaveHeightPart3Of6\\\":\\\"0.59,\\\",\\\"significantWaveHeightPart4Of6\\\":\\\"0.34,\\\",\\\"significantWaveHeightPart5Of6\\\":\\\"0.08,\\\",\\\"significantWaveHeightPart6Of6\\\":0.15},\\\"2024-05-15T18:00:00Z\\\":{\\\"meanWaveDirectionPart1Of6\\\":\\\"107.2,\\\",\\\"meanWaveDirectionPart2Of6\\\":\\\"63.55,\\\",\\\"meanWaveDirectionPart3Of6\\\":\\\"40.65,\\\",\\\"meanWaveDirectionPart4Of6\\\":\\\"35.9,\\\",\\\"meanWaveDirectionPart5Of6\\\":\\\"108.1,\\\",\\\"meanWaveDirectionPart6Of6\\\":\\\"77.1,\\\",\\\"meanWaveDirectionalSpreadingPart1Of6\\\":\\\"35.1,\\\",\\\"meanWaveDirectionalSpreadingPart2Of6\\\":\\\"15.16,\\\",\\\"meanWaveDirectionalSpreadingPart3Of6\\\":\\\"13.56,\\\",\\\"meanWaveDirectionalSpreadingPart4Of6\\\":\\\"12.4,\\\",\\\"meanWaveDirectionalSpreadingPart5Of6\\\":\\\"12.1,\\\",\\\"meanWaveDirectionalSpreadingPart6Of6\\\":\\\"13.9,\\\",\\\"peakPeriodPart1Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart2Of6\\\":\\\"5.5,\\\",\\\"peakPeriodPart3Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart4Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart5Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart6Of6\\\":\\\"5.9,\\\",\\\"significantWaveHeightPart1Of6\\\":\\\"1.79,\\\",\\\"significantWaveHeightPart2Of6\\\":\\\"0.83,\\\",\\\"significantWaveHeightPart3Of6\\\":\\\"0.6,\\\",\\\"significantWaveHeightPart4Of6\\\":\\\"0.33,\\\",\\\"significantWaveHeightPart5Of6\\\":\\\"0.78,\\\",\\\"significantWaveHeightPart6Of6\\\":1.55}}}]}\");\nRequest request = new Request.Builder()\n .url(\"https://weather.api.dtn.com/v1/conditions/marine/wave-partitions\")\n .get()\n .addHeader(\"content-type\", \"application/json\")\n .addHeader(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n .addHeader(\"Accept\", \"SOME_STRING_VALUE\")\n .addHeader(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n .build();\n\nResponse response = client.newCall(request).execute();"
- lang: Java + Unirest
source: "HttpResponse response = Unirest.get(\"https://weather.api.dtn.com/v1/conditions/marine/wave-partitions\")\n .header(\"content-type\", \"application/json\")\n .header(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n .header(\"Accept\", \"SOME_STRING_VALUE\")\n .header(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n .body(\"{\\\"url\\\":\\\"https://weather.api.dtn.com/v1/conditions/marine/wave-partitions?lat=55.81&lon=3.88¶meters=meanWaveDirectionPart1Of6,meanWaveDirectionPart2Of6,meanWaveDirectionPart3Of6,meanWaveDirectionPart4Of6,meanWaveDirectionPart5Of6,meanWaveDirectionPart6Of6,meanWaveDirectionalSpreadingPart1Of6,meanWaveDirectionalSpreadingPart2Of6,meanWaveDirectionalSpreadingPart3Of6,meanWaveDirectionalSpreadingPart4Of6,meanWaveDirectionalSpreadingPart5Of6,meanWaveDirectionalSpreadingPart6Of6,peakPeriodPart1Of6,peakPeriodPart2Of6,peakPeriodPart3Of6,peakPeriodPart4Of6,peakPeriodPart5Of6,peakPeriodPart6Of6,significantWaveHeightPart1Of6,significantWaveHeightPart2Of6,significantWaveHeightPart3Of6,significantWaveHeightPart4Of6,significantWaveHeightPart5Of6,significantWaveHeightPart6Of6&startTime=2024-05-15T16:13:53Z&endTime=2024-05-15T18:13:53Z\\\",\\\"type\\\":\\\"FeatureCollection\\\",\\\"features\\\":[{\\\"type\\\":\\\"Feature\\\",\\\"geometry\\\":{\\\"type\\\":\\\"Point\\\",\\\"coordinates\\\":[3.88,55.81]},\\\"properties\\\":{\\\"2024-05-15T16:00:00Z\\\":{\\\"meanWaveDirectionPart1Of6\\\":\\\"108.3,\\\",\\\"meanWaveDirectionPart2Of6\\\":\\\"42.5,\\\",\\\"meanWaveDirectionPart3Of6\\\":\\\"45.7,\\\",\\\"meanWaveDirectionPart4Of6\\\":\\\"198.6,\\\",\\\"meanWaveDirectionPart5Of6\\\":\\\"44.2,\\\",\\\"meanWaveDirectionPart6Of6\\\":\\\"134.1,\\\",\\\"meanWaveDirectionalSpreadingPart1Of6\\\":\\\"35,\\\",\\\"meanWaveDirectionalSpreadingPart2Of6\\\":\\\"13.45,\\\",\\\"meanWaveDirectionalSpreadingPart3Of6\\\":\\\"14.82,\\\",\\\"meanWaveDirectionalSpreadingPart4Of6\\\":\\\"9.3,\\\",\\\"meanWaveDirectionalSpreadingPart5Of6\\\":\\\"10.32,\\\",\\\"meanWaveDirectionalSpreadingPart6Of6\\\":\\\"12.34,\\\",\\\"peakPeriodPart1Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart2Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart3Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart4Of6\\\":\\\"4.75,\\\",\\\"peakPeriodPart5Of6\\\":\\\"4.89,\\\",\\\"peakPeriodPart6Of6\\\":\\\"5.2,\\\",\\\"significantWaveHeightPart1Of6\\\":\\\"1.72,\\\",\\\"significantWaveHeightPart2Of6\\\":\\\"0.57,\\\",\\\"significantWaveHeightPart3Of6\\\":\\\"0.63,\\\",\\\"significantWaveHeightPart4Of6\\\":\\\"0.16,\\\",\\\"significantWaveHeightPart5Of6\\\":\\\"0.12,\\\",\\\"significantWaveHeightPart6Of6\\\":0.11},\\\"2024-05-15T17:00:00Z\\\":{\\\"meanWaveDirectionPart1Of6\\\":\\\"115,\\\",\\\"meanWaveDirectionPart2Of6\\\":\\\"41.8,\\\",\\\"meanWaveDirectionPart3Of6\\\":\\\"41.4,\\\",\\\"meanWaveDirectionPart4Of6\\\":\\\"36.6,\\\",\\\"meanWaveDirectionPart5Of6\\\":\\\"190,\\\",\\\"meanWaveDirectionPart6Of6\\\":\\\"130.1,\\\",\\\"meanWaveDirectionalSpreadingPart1Of6\\\":\\\"29.2,\\\",\\\"meanWaveDirectionalSpreadingPart2Of6\\\":\\\"13.4,\\\",\\\"meanWaveDirectionalSpreadingPart3Of6\\\":\\\"13.3,\\\",\\\"meanWaveDirectionalSpreadingPart4Of6\\\":\\\"12.13,\\\",\\\"meanWaveDirectionalSpreadingPart5Of6\\\":\\\"0,\\\",\\\"meanWaveDirectionalSpreadingPart6Of6\\\":\\\"12.11,\\\",\\\"peakPeriodPart1Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart2Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart3Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart4Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart5Of6\\\":\\\"4.75,\\\",\\\"peakPeriodPart6Of6\\\":\\\"4.1,\\\",\\\"significantWaveHeightPart1Of6\\\":\\\"1.65,\\\",\\\"significantWaveHeightPart2Of6\\\":\\\"0.58,\\\",\\\"significantWaveHeightPart3Of6\\\":\\\"0.59,\\\",\\\"significantWaveHeightPart4Of6\\\":\\\"0.34,\\\",\\\"significantWaveHeightPart5Of6\\\":\\\"0.08,\\\",\\\"significantWaveHeightPart6Of6\\\":0.15},\\\"2024-05-15T18:00:00Z\\\":{\\\"meanWaveDirectionPart1Of6\\\":\\\"107.2,\\\",\\\"meanWaveDirectionPart2Of6\\\":\\\"63.55,\\\",\\\"meanWaveDirectionPart3Of6\\\":\\\"40.65,\\\",\\\"meanWaveDirectionPart4Of6\\\":\\\"35.9,\\\",\\\"meanWaveDirectionPart5Of6\\\":\\\"108.1,\\\",\\\"meanWaveDirectionPart6Of6\\\":\\\"77.1,\\\",\\\"meanWaveDirectionalSpreadingPart1Of6\\\":\\\"35.1,\\\",\\\"meanWaveDirectionalSpreadingPart2Of6\\\":\\\"15.16,\\\",\\\"meanWaveDirectionalSpreadingPart3Of6\\\":\\\"13.56,\\\",\\\"meanWaveDirectionalSpreadingPart4Of6\\\":\\\"12.4,\\\",\\\"meanWaveDirectionalSpreadingPart5Of6\\\":\\\"12.1,\\\",\\\"meanWaveDirectionalSpreadingPart6Of6\\\":\\\"13.9,\\\",\\\"peakPeriodPart1Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart2Of6\\\":\\\"5.5,\\\",\\\"peakPeriodPart3Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart4Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart5Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart6Of6\\\":\\\"5.9,\\\",\\\"significantWaveHeightPart1Of6\\\":\\\"1.79,\\\",\\\"significantWaveHeightPart2Of6\\\":\\\"0.83,\\\",\\\"significantWaveHeightPart3Of6\\\":\\\"0.6,\\\",\\\"significantWaveHeightPart4Of6\\\":\\\"0.33,\\\",\\\"significantWaveHeightPart5Of6\\\":\\\"0.78,\\\",\\\"significantWaveHeightPart6Of6\\\":1.55}}}]}\")\n .asString();"
- lang: Javascript + Jquery
source: "const settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://weather.api.dtn.com/v1/conditions/marine/wave-partitions\",\n \"method\": \"GET\",\n \"headers\": {\n \"content-type\": \"application/json\",\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n },\n \"processData\": false,\n \"data\": \"{\\\"url\\\":\\\"https://weather.api.dtn.com/v1/conditions/marine/wave-partitions?lat=55.81&lon=3.88¶meters=meanWaveDirectionPart1Of6,meanWaveDirectionPart2Of6,meanWaveDirectionPart3Of6,meanWaveDirectionPart4Of6,meanWaveDirectionPart5Of6,meanWaveDirectionPart6Of6,meanWaveDirectionalSpreadingPart1Of6,meanWaveDirectionalSpreadingPart2Of6,meanWaveDirectionalSpreadingPart3Of6,meanWaveDirectionalSpreadingPart4Of6,meanWaveDirectionalSpreadingPart5Of6,meanWaveDirectionalSpreadingPart6Of6,peakPeriodPart1Of6,peakPeriodPart2Of6,peakPeriodPart3Of6,peakPeriodPart4Of6,peakPeriodPart5Of6,peakPeriodPart6Of6,significantWaveHeightPart1Of6,significantWaveHeightPart2Of6,significantWaveHeightPart3Of6,significantWaveHeightPart4Of6,significantWaveHeightPart5Of6,significantWaveHeightPart6Of6&startTime=2024-05-15T16:13:53Z&endTime=2024-05-15T18:13:53Z\\\",\\\"type\\\":\\\"FeatureCollection\\\",\\\"features\\\":[{\\\"type\\\":\\\"Feature\\\",\\\"geometry\\\":{\\\"type\\\":\\\"Point\\\",\\\"coordinates\\\":[3.88,55.81]},\\\"properties\\\":{\\\"2024-05-15T16:00:00Z\\\":{\\\"meanWaveDirectionPart1Of6\\\":\\\"108.3,\\\",\\\"meanWaveDirectionPart2Of6\\\":\\\"42.5,\\\",\\\"meanWaveDirectionPart3Of6\\\":\\\"45.7,\\\",\\\"meanWaveDirectionPart4Of6\\\":\\\"198.6,\\\",\\\"meanWaveDirectionPart5Of6\\\":\\\"44.2,\\\",\\\"meanWaveDirectionPart6Of6\\\":\\\"134.1,\\\",\\\"meanWaveDirectionalSpreadingPart1Of6\\\":\\\"35,\\\",\\\"meanWaveDirectionalSpreadingPart2Of6\\\":\\\"13.45,\\\",\\\"meanWaveDirectionalSpreadingPart3Of6\\\":\\\"14.82,\\\",\\\"meanWaveDirectionalSpreadingPart4Of6\\\":\\\"9.3,\\\",\\\"meanWaveDirectionalSpreadingPart5Of6\\\":\\\"10.32,\\\",\\\"meanWaveDirectionalSpreadingPart6Of6\\\":\\\"12.34,\\\",\\\"peakPeriodPart1Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart2Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart3Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart4Of6\\\":\\\"4.75,\\\",\\\"peakPeriodPart5Of6\\\":\\\"4.89,\\\",\\\"peakPeriodPart6Of6\\\":\\\"5.2,\\\",\\\"significantWaveHeightPart1Of6\\\":\\\"1.72,\\\",\\\"significantWaveHeightPart2Of6\\\":\\\"0.57,\\\",\\\"significantWaveHeightPart3Of6\\\":\\\"0.63,\\\",\\\"significantWaveHeightPart4Of6\\\":\\\"0.16,\\\",\\\"significantWaveHeightPart5Of6\\\":\\\"0.12,\\\",\\\"significantWaveHeightPart6Of6\\\":0.11},\\\"2024-05-15T17:00:00Z\\\":{\\\"meanWaveDirectionPart1Of6\\\":\\\"115,\\\",\\\"meanWaveDirectionPart2Of6\\\":\\\"41.8,\\\",\\\"meanWaveDirectionPart3Of6\\\":\\\"41.4,\\\",\\\"meanWaveDirectionPart4Of6\\\":\\\"36.6,\\\",\\\"meanWaveDirectionPart5Of6\\\":\\\"190,\\\",\\\"meanWaveDirectionPart6Of6\\\":\\\"130.1,\\\",\\\"meanWaveDirectionalSpreadingPart1Of6\\\":\\\"29.2,\\\",\\\"meanWaveDirectionalSpreadingPart2Of6\\\":\\\"13.4,\\\",\\\"meanWaveDirectionalSpreadingPart3Of6\\\":\\\"13.3,\\\",\\\"meanWaveDirectionalSpreadingPart4Of6\\\":\\\"12.13,\\\",\\\"meanWaveDirectionalSpreadingPart5Of6\\\":\\\"0,\\\",\\\"meanWaveDirectionalSpreadingPart6Of6\\\":\\\"12.11,\\\",\\\"peakPeriodPart1Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart2Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart3Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart4Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart5Of6\\\":\\\"4.75,\\\",\\\"peakPeriodPart6Of6\\\":\\\"4.1,\\\",\\\"significantWaveHeightPart1Of6\\\":\\\"1.65,\\\",\\\"significantWaveHeightPart2Of6\\\":\\\"0.58,\\\",\\\"significantWaveHeightPart3Of6\\\":\\\"0.59,\\\",\\\"significantWaveHeightPart4Of6\\\":\\\"0.34,\\\",\\\"significantWaveHeightPart5Of6\\\":\\\"0.08,\\\",\\\"significantWaveHeightPart6Of6\\\":0.15},\\\"2024-05-15T18:00:00Z\\\":{\\\"meanWaveDirectionPart1Of6\\\":\\\"107.2,\\\",\\\"meanWaveDirectionPart2Of6\\\":\\\"63.55,\\\",\\\"meanWaveDirectionPart3Of6\\\":\\\"40.65,\\\",\\\"meanWaveDirectionPart4Of6\\\":\\\"35.9,\\\",\\\"meanWaveDirectionPart5Of6\\\":\\\"108.1,\\\",\\\"meanWaveDirectionPart6Of6\\\":\\\"77.1,\\\",\\\"meanWaveDirectionalSpreadingPart1Of6\\\":\\\"35.1,\\\",\\\"meanWaveDirectionalSpreadingPart2Of6\\\":\\\"15.16,\\\",\\\"meanWaveDirectionalSpreadingPart3Of6\\\":\\\"13.56,\\\",\\\"meanWaveDirectionalSpreadingPart4Of6\\\":\\\"12.4,\\\",\\\"meanWaveDirectionalSpreadingPart5Of6\\\":\\\"12.1,\\\",\\\"meanWaveDirectionalSpreadingPart6Of6\\\":\\\"13.9,\\\",\\\"peakPeriodPart1Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart2Of6\\\":\\\"5.5,\\\",\\\"peakPeriodPart3Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart4Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart5Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart6Of6\\\":\\\"5.9,\\\",\\\"significantWaveHeightPart1Of6\\\":\\\"1.79,\\\",\\\"significantWaveHeightPart2Of6\\\":\\\"0.83,\\\",\\\"significantWaveHeightPart3Of6\\\":\\\"0.6,\\\",\\\"significantWaveHeightPart4Of6\\\":\\\"0.33,\\\",\\\"significantWaveHeightPart5Of6\\\":\\\"0.78,\\\",\\\"significantWaveHeightPart6Of6\\\":1.55}}}]}\"\n};\n\n$.ajax(settings).done(function (response) {\n console.log(response);\n});"
- lang: Javascript + Xhr
source: "const data = JSON.stringify({\n \"url\": \"https://weather.api.dtn.com/v1/conditions/marine/wave-partitions?lat=55.81&lon=3.88¶meters=meanWaveDirectionPart1Of6,meanWaveDirectionPart2Of6,meanWaveDirectionPart3Of6,meanWaveDirectionPart4Of6,meanWaveDirectionPart5Of6,meanWaveDirectionPart6Of6,meanWaveDirectionalSpreadingPart1Of6,meanWaveDirectionalSpreadingPart2Of6,meanWaveDirectionalSpreadingPart3Of6,meanWaveDirectionalSpreadingPart4Of6,meanWaveDirectionalSpreadingPart5Of6,meanWaveDirectionalSpreadingPart6Of6,peakPeriodPart1Of6,peakPeriodPart2Of6,peakPeriodPart3Of6,peakPeriodPart4Of6,peakPeriodPart5Of6,peakPeriodPart6Of6,significantWaveHeightPart1Of6,significantWaveHeightPart2Of6,significantWaveHeightPart3Of6,significantWaveHeightPart4Of6,significantWaveHeightPart5Of6,significantWaveHeightPart6Of6&startTime=2024-05-15T16:13:53Z&endTime=2024-05-15T18:13:53Z\",\n \"type\": \"FeatureCollection\",\n \"features\": [\n {\n \"type\": \"Feature\",\n \"geometry\": {\n \"type\": \"Point\",\n \"coordinates\": [\n 3.88,\n 55.81\n ]\n },\n \"properties\": {\n \"2024-05-15T16:00:00Z\": {\n \"meanWaveDirectionPart1Of6\": \"108.3,\",\n \"meanWaveDirectionPart2Of6\": \"42.5,\",\n \"meanWaveDirectionPart3Of6\": \"45.7,\",\n \"meanWaveDirectionPart4Of6\": \"198.6,\",\n \"meanWaveDirectionPart5Of6\": \"44.2,\",\n \"meanWaveDirectionPart6Of6\": \"134.1,\",\n \"meanWaveDirectionalSpreadingPart1Of6\": \"35,\",\n \"meanWaveDirectionalSpreadingPart2Of6\": \"13.45,\",\n \"meanWaveDirectionalSpreadingPart3Of6\": \"14.82,\",\n \"meanWaveDirectionalSpreadingPart4Of6\": \"9.3,\",\n \"meanWaveDirectionalSpreadingPart5Of6\": \"10.32,\",\n \"meanWaveDirectionalSpreadingPart6Of6\": \"12.34,\",\n \"peakPeriodPart1Of6\": \"6.3,\",\n \"peakPeriodPart2Of6\": \"5.2,\",\n \"peakPeriodPart3Of6\": \"5.2,\",\n \"peakPeriodPart4Of6\": \"4.75,\",\n \"peakPeriodPart5Of6\": \"4.89,\",\n \"peakPeriodPart6Of6\": \"5.2,\",\n \"significantWaveHeightPart1Of6\": \"1.72,\",\n \"significantWaveHeightPart2Of6\": \"0.57,\",\n \"significantWaveHeightPart3Of6\": \"0.63,\",\n \"significantWaveHeightPart4Of6\": \"0.16,\",\n \"significantWaveHeightPart5Of6\": \"0.12,\",\n \"significantWaveHeightPart6Of6\": 0.11\n },\n \"2024-05-15T17:00:00Z\": {\n \"meanWaveDirectionPart1Of6\": \"115,\",\n \"meanWaveDirectionPart2Of6\": \"41.8,\",\n \"meanWaveDirectionPart3Of6\": \"41.4,\",\n \"meanWaveDirectionPart4Of6\": \"36.6,\",\n \"meanWaveDirectionPart5Of6\": \"190,\",\n \"meanWaveDirectionPart6Of6\": \"130.1,\",\n \"meanWaveDirectionalSpreadingPart1Of6\": \"29.2,\",\n \"meanWaveDirectionalSpreadingPart2Of6\": \"13.4,\",\n \"meanWaveDirectionalSpreadingPart3Of6\": \"13.3,\",\n \"meanWaveDirectionalSpreadingPart4Of6\": \"12.13,\",\n \"meanWaveDirectionalSpreadingPart5Of6\": \"0,\",\n \"meanWaveDirectionalSpreadingPart6Of6\": \"12.11,\",\n \"peakPeriodPart1Of6\": \"6.3,\",\n \"peakPeriodPart2Of6\": \"5.2,\",\n \"peakPeriodPart3Of6\": \"5.2,\",\n \"peakPeriodPart4Of6\": \"6.3,\",\n \"peakPeriodPart5Of6\": \"4.75,\",\n \"peakPeriodPart6Of6\": \"4.1,\",\n \"significantWaveHeightPart1Of6\": \"1.65,\",\n \"significantWaveHeightPart2Of6\": \"0.58,\",\n \"significantWaveHeightPart3Of6\": \"0.59,\",\n \"significantWaveHeightPart4Of6\": \"0.34,\",\n \"significantWaveHeightPart5Of6\": \"0.08,\",\n \"significantWaveHeightPart6Of6\": 0.15\n },\n \"2024-05-15T18:00:00Z\": {\n \"meanWaveDirectionPart1Of6\": \"107.2,\",\n \"meanWaveDirectionPart2Of6\": \"63.55,\",\n \"meanWaveDirectionPart3Of6\": \"40.65,\",\n \"meanWaveDirectionPart4Of6\": \"35.9,\",\n \"meanWaveDirectionPart5Of6\": \"108.1,\",\n \"meanWaveDirectionPart6Of6\": \"77.1,\",\n \"meanWaveDirectionalSpreadingPart1Of6\": \"35.1,\",\n \"meanWaveDirectionalSpreadingPart2Of6\": \"15.16,\",\n \"meanWaveDirectionalSpreadingPart3Of6\": \"13.56,\",\n \"meanWaveDirectionalSpreadingPart4Of6\": \"12.4,\",\n \"meanWaveDirectionalSpreadingPart5Of6\": \"12.1,\",\n \"meanWaveDirectionalSpreadingPart6Of6\": \"13.9,\",\n \"peakPeriodPart1Of6\": \"6.3,\",\n \"peakPeriodPart2Of6\": \"5.5,\",\n \"peakPeriodPart3Of6\": \"5.2,\",\n \"peakPeriodPart4Of6\": \"6.3,\",\n \"peakPeriodPart5Of6\": \"5.2,\",\n \"peakPeriodPart6Of6\": \"5.9,\",\n \"significantWaveHeightPart1Of6\": \"1.79,\",\n \"significantWaveHeightPart2Of6\": \"0.83,\",\n \"significantWaveHeightPart3Of6\": \"0.6,\",\n \"significantWaveHeightPart4Of6\": \"0.33,\",\n \"significantWaveHeightPart5Of6\": \"0.78,\",\n \"significantWaveHeightPart6Of6\": 1.55\n }\n }\n }\n ]\n});\n\nconst xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === this.DONE) {\n console.log(this.responseText);\n }\n});\n\nxhr.open(\"GET\", \"https://weather.api.dtn.com/v1/conditions/marine/wave-partitions\");\nxhr.setRequestHeader(\"content-type\", \"application/json\");\nxhr.setRequestHeader(\"Accept-Encoding\", \"SOME_STRING_VALUE\");\nxhr.setRequestHeader(\"Accept\", \"SOME_STRING_VALUE\");\nxhr.setRequestHeader(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\");\n\nxhr.send(data);"
- lang: Javascript + Jquery
source: "const settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://weather.api.dtn.com/v1/conditions/marine/wave-partitions\",\n \"method\": \"GET\",\n \"headers\": {\n \"content-type\": \"application/json\",\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n },\n \"processData\": false,\n \"data\": \"{\\\"url\\\":\\\"https://weather.api.dtn.com/v1/conditions/marine/wave-partitions?lat=55.81&lon=3.88¶meters=meanWaveDirectionPart1Of6,meanWaveDirectionPart2Of6,meanWaveDirectionPart3Of6,meanWaveDirectionPart4Of6,meanWaveDirectionPart5Of6,meanWaveDirectionPart6Of6,meanWaveDirectionalSpreadingPart1Of6,meanWaveDirectionalSpreadingPart2Of6,meanWaveDirectionalSpreadingPart3Of6,meanWaveDirectionalSpreadingPart4Of6,meanWaveDirectionalSpreadingPart5Of6,meanWaveDirectionalSpreadingPart6Of6,peakPeriodPart1Of6,peakPeriodPart2Of6,peakPeriodPart3Of6,peakPeriodPart4Of6,peakPeriodPart5Of6,peakPeriodPart6Of6,significantWaveHeightPart1Of6,significantWaveHeightPart2Of6,significantWaveHeightPart3Of6,significantWaveHeightPart4Of6,significantWaveHeightPart5Of6,significantWaveHeightPart6Of6&startTime=2024-05-15T16:13:53Z&endTime=2024-05-15T18:13:53Z\\\",\\\"type\\\":\\\"FeatureCollection\\\",\\\"features\\\":[{\\\"type\\\":\\\"Feature\\\",\\\"geometry\\\":{\\\"type\\\":\\\"Point\\\",\\\"coordinates\\\":[3.88,55.81]},\\\"properties\\\":{\\\"2024-05-15T16:00:00Z\\\":{\\\"meanWaveDirectionPart1Of6\\\":\\\"108.3,\\\",\\\"meanWaveDirectionPart2Of6\\\":\\\"42.5,\\\",\\\"meanWaveDirectionPart3Of6\\\":\\\"45.7,\\\",\\\"meanWaveDirectionPart4Of6\\\":\\\"198.6,\\\",\\\"meanWaveDirectionPart5Of6\\\":\\\"44.2,\\\",\\\"meanWaveDirectionPart6Of6\\\":\\\"134.1,\\\",\\\"meanWaveDirectionalSpreadingPart1Of6\\\":\\\"35,\\\",\\\"meanWaveDirectionalSpreadingPart2Of6\\\":\\\"13.45,\\\",\\\"meanWaveDirectionalSpreadingPart3Of6\\\":\\\"14.82,\\\",\\\"meanWaveDirectionalSpreadingPart4Of6\\\":\\\"9.3,\\\",\\\"meanWaveDirectionalSpreadingPart5Of6\\\":\\\"10.32,\\\",\\\"meanWaveDirectionalSpreadingPart6Of6\\\":\\\"12.34,\\\",\\\"peakPeriodPart1Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart2Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart3Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart4Of6\\\":\\\"4.75,\\\",\\\"peakPeriodPart5Of6\\\":\\\"4.89,\\\",\\\"peakPeriodPart6Of6\\\":\\\"5.2,\\\",\\\"significantWaveHeightPart1Of6\\\":\\\"1.72,\\\",\\\"significantWaveHeightPart2Of6\\\":\\\"0.57,\\\",\\\"significantWaveHeightPart3Of6\\\":\\\"0.63,\\\",\\\"significantWaveHeightPart4Of6\\\":\\\"0.16,\\\",\\\"significantWaveHeightPart5Of6\\\":\\\"0.12,\\\",\\\"significantWaveHeightPart6Of6\\\":0.11},\\\"2024-05-15T17:00:00Z\\\":{\\\"meanWaveDirectionPart1Of6\\\":\\\"115,\\\",\\\"meanWaveDirectionPart2Of6\\\":\\\"41.8,\\\",\\\"meanWaveDirectionPart3Of6\\\":\\\"41.4,\\\",\\\"meanWaveDirectionPart4Of6\\\":\\\"36.6,\\\",\\\"meanWaveDirectionPart5Of6\\\":\\\"190,\\\",\\\"meanWaveDirectionPart6Of6\\\":\\\"130.1,\\\",\\\"meanWaveDirectionalSpreadingPart1Of6\\\":\\\"29.2,\\\",\\\"meanWaveDirectionalSpreadingPart2Of6\\\":\\\"13.4,\\\",\\\"meanWaveDirectionalSpreadingPart3Of6\\\":\\\"13.3,\\\",\\\"meanWaveDirectionalSpreadingPart4Of6\\\":\\\"12.13,\\\",\\\"meanWaveDirectionalSpreadingPart5Of6\\\":\\\"0,\\\",\\\"meanWaveDirectionalSpreadingPart6Of6\\\":\\\"12.11,\\\",\\\"peakPeriodPart1Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart2Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart3Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart4Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart5Of6\\\":\\\"4.75,\\\",\\\"peakPeriodPart6Of6\\\":\\\"4.1,\\\",\\\"significantWaveHeightPart1Of6\\\":\\\"1.65,\\\",\\\"significantWaveHeightPart2Of6\\\":\\\"0.58,\\\",\\\"significantWaveHeightPart3Of6\\\":\\\"0.59,\\\",\\\"significantWaveHeightPart4Of6\\\":\\\"0.34,\\\",\\\"significantWaveHeightPart5Of6\\\":\\\"0.08,\\\",\\\"significantWaveHeightPart6Of6\\\":0.15},\\\"2024-05-15T18:00:00Z\\\":{\\\"meanWaveDirectionPart1Of6\\\":\\\"107.2,\\\",\\\"meanWaveDirectionPart2Of6\\\":\\\"63.55,\\\",\\\"meanWaveDirectionPart3Of6\\\":\\\"40.65,\\\",\\\"meanWaveDirectionPart4Of6\\\":\\\"35.9,\\\",\\\"meanWaveDirectionPart5Of6\\\":\\\"108.1,\\\",\\\"meanWaveDirectionPart6Of6\\\":\\\"77.1,\\\",\\\"meanWaveDirectionalSpreadingPart1Of6\\\":\\\"35.1,\\\",\\\"meanWaveDirectionalSpreadingPart2Of6\\\":\\\"15.16,\\\",\\\"meanWaveDirectionalSpreadingPart3Of6\\\":\\\"13.56,\\\",\\\"meanWaveDirectionalSpreadingPart4Of6\\\":\\\"12.4,\\\",\\\"meanWaveDirectionalSpreadingPart5Of6\\\":\\\"12.1,\\\",\\\"meanWaveDirectionalSpreadingPart6Of6\\\":\\\"13.9,\\\",\\\"peakPeriodPart1Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart2Of6\\\":\\\"5.5,\\\",\\\"peakPeriodPart3Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart4Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart5Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart6Of6\\\":\\\"5.9,\\\",\\\"significantWaveHeightPart1Of6\\\":\\\"1.79,\\\",\\\"significantWaveHeightPart2Of6\\\":\\\"0.83,\\\",\\\"significantWaveHeightPart3Of6\\\":\\\"0.6,\\\",\\\"significantWaveHeightPart4Of6\\\":\\\"0.33,\\\",\\\"significantWaveHeightPart5Of6\\\":\\\"0.78,\\\",\\\"significantWaveHeightPart6Of6\\\":1.55}}}]}\"\n};\n\n$.ajax(settings).done(function (response) {\n console.log(response);\n});"
- lang: Node + Native
source: "const http = require(\"https\");\n\nconst options = {\n \"method\": \"GET\",\n \"hostname\": \"weather.api.dtn.com\",\n \"port\": null,\n \"path\": \"/v1/conditions/marine/wave-partitions\",\n \"headers\": {\n \"content-type\": \"application/json\",\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\nconst req = http.request(options, function (res) {\n const chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n const body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n});\n\nreq.write(JSON.stringify({\n url: 'https://weather.api.dtn.com/v1/conditions/marine/wave-partitions?lat=55.81&lon=3.88¶meters=meanWaveDirectionPart1Of6,meanWaveDirectionPart2Of6,meanWaveDirectionPart3Of6,meanWaveDirectionPart4Of6,meanWaveDirectionPart5Of6,meanWaveDirectionPart6Of6,meanWaveDirectionalSpreadingPart1Of6,meanWaveDirectionalSpreadingPart2Of6,meanWaveDirectionalSpreadingPart3Of6,meanWaveDirectionalSpreadingPart4Of6,meanWaveDirectionalSpreadingPart5Of6,meanWaveDirectionalSpreadingPart6Of6,peakPeriodPart1Of6,peakPeriodPart2Of6,peakPeriodPart3Of6,peakPeriodPart4Of6,peakPeriodPart5Of6,peakPeriodPart6Of6,significantWaveHeightPart1Of6,significantWaveHeightPart2Of6,significantWaveHeightPart3Of6,significantWaveHeightPart4Of6,significantWaveHeightPart5Of6,significantWaveHeightPart6Of6&startTime=2024-05-15T16:13:53Z&endTime=2024-05-15T18:13:53Z',\n type: 'FeatureCollection',\n features: [\n {\n type: 'Feature',\n geometry: {type: 'Point', coordinates: [3.88, 55.81]},\n properties: {\n '2024-05-15T16:00:00Z': {\n meanWaveDirectionPart1Of6: '108.3,',\n meanWaveDirectionPart2Of6: '42.5,',\n meanWaveDirectionPart3Of6: '45.7,',\n meanWaveDirectionPart4Of6: '198.6,',\n meanWaveDirectionPart5Of6: '44.2,',\n meanWaveDirectionPart6Of6: '134.1,',\n meanWaveDirectionalSpreadingPart1Of6: '35,',\n meanWaveDirectionalSpreadingPart2Of6: '13.45,',\n meanWaveDirectionalSpreadingPart3Of6: '14.82,',\n meanWaveDirectionalSpreadingPart4Of6: '9.3,',\n meanWaveDirectionalSpreadingPart5Of6: '10.32,',\n meanWaveDirectionalSpreadingPart6Of6: '12.34,',\n peakPeriodPart1Of6: '6.3,',\n peakPeriodPart2Of6: '5.2,',\n peakPeriodPart3Of6: '5.2,',\n peakPeriodPart4Of6: '4.75,',\n peakPeriodPart5Of6: '4.89,',\n peakPeriodPart6Of6: '5.2,',\n significantWaveHeightPart1Of6: '1.72,',\n significantWaveHeightPart2Of6: '0.57,',\n significantWaveHeightPart3Of6: '0.63,',\n significantWaveHeightPart4Of6: '0.16,',\n significantWaveHeightPart5Of6: '0.12,',\n significantWaveHeightPart6Of6: 0.11\n },\n '2024-05-15T17:00:00Z': {\n meanWaveDirectionPart1Of6: '115,',\n meanWaveDirectionPart2Of6: '41.8,',\n meanWaveDirectionPart3Of6: '41.4,',\n meanWaveDirectionPart4Of6: '36.6,',\n meanWaveDirectionPart5Of6: '190,',\n meanWaveDirectionPart6Of6: '130.1,',\n meanWaveDirectionalSpreadingPart1Of6: '29.2,',\n meanWaveDirectionalSpreadingPart2Of6: '13.4,',\n meanWaveDirectionalSpreadingPart3Of6: '13.3,',\n meanWaveDirectionalSpreadingPart4Of6: '12.13,',\n meanWaveDirectionalSpreadingPart5Of6: '0,',\n meanWaveDirectionalSpreadingPart6Of6: '12.11,',\n peakPeriodPart1Of6: '6.3,',\n peakPeriodPart2Of6: '5.2,',\n peakPeriodPart3Of6: '5.2,',\n peakPeriodPart4Of6: '6.3,',\n peakPeriodPart5Of6: '4.75,',\n peakPeriodPart6Of6: '4.1,',\n significantWaveHeightPart1Of6: '1.65,',\n significantWaveHeightPart2Of6: '0.58,',\n significantWaveHeightPart3Of6: '0.59,',\n significantWaveHeightPart4Of6: '0.34,',\n significantWaveHeightPart5Of6: '0.08,',\n significantWaveHeightPart6Of6: 0.15\n },\n '2024-05-15T18:00:00Z': {\n meanWaveDirectionPart1Of6: '107.2,',\n meanWaveDirectionPart2Of6: '63.55,',\n meanWaveDirectionPart3Of6: '40.65,',\n meanWaveDirectionPart4Of6: '35.9,',\n meanWaveDirectionPart5Of6: '108.1,',\n meanWaveDirectionPart6Of6: '77.1,',\n meanWaveDirectionalSpreadingPart1Of6: '35.1,',\n meanWaveDirectionalSpreadingPart2Of6: '15.16,',\n meanWaveDirectionalSpreadingPart3Of6: '13.56,',\n meanWaveDirectionalSpreadingPart4Of6: '12.4,',\n meanWaveDirectionalSpreadingPart5Of6: '12.1,',\n meanWaveDirectionalSpreadingPart6Of6: '13.9,',\n peakPeriodPart1Of6: '6.3,',\n peakPeriodPart2Of6: '5.5,',\n peakPeriodPart3Of6: '5.2,',\n peakPeriodPart4Of6: '6.3,',\n peakPeriodPart5Of6: '5.2,',\n peakPeriodPart6Of6: '5.9,',\n significantWaveHeightPart1Of6: '1.79,',\n significantWaveHeightPart2Of6: '0.83,',\n significantWaveHeightPart3Of6: '0.6,',\n significantWaveHeightPart4Of6: '0.33,',\n significantWaveHeightPart5Of6: '0.78,',\n significantWaveHeightPart6Of6: 1.55\n }\n }\n }\n ]\n}));\nreq.end();"
- lang: Node + Request
source: "const request = require('request');\n\nconst options = {\n method: 'GET',\n url: 'https://weather.api.dtn.com/v1/conditions/marine/wave-partitions',\n headers: {\n 'content-type': 'application/json',\n 'Accept-Encoding': 'SOME_STRING_VALUE',\n Accept: 'SOME_STRING_VALUE',\n Authorization: 'Bearer REPLACE_BEARER_TOKEN'\n },\n body: {\n url: 'https://weather.api.dtn.com/v1/conditions/marine/wave-partitions?lat=55.81&lon=3.88¶meters=meanWaveDirectionPart1Of6,meanWaveDirectionPart2Of6,meanWaveDirectionPart3Of6,meanWaveDirectionPart4Of6,meanWaveDirectionPart5Of6,meanWaveDirectionPart6Of6,meanWaveDirectionalSpreadingPart1Of6,meanWaveDirectionalSpreadingPart2Of6,meanWaveDirectionalSpreadingPart3Of6,meanWaveDirectionalSpreadingPart4Of6,meanWaveDirectionalSpreadingPart5Of6,meanWaveDirectionalSpreadingPart6Of6,peakPeriodPart1Of6,peakPeriodPart2Of6,peakPeriodPart3Of6,peakPeriodPart4Of6,peakPeriodPart5Of6,peakPeriodPart6Of6,significantWaveHeightPart1Of6,significantWaveHeightPart2Of6,significantWaveHeightPart3Of6,significantWaveHeightPart4Of6,significantWaveHeightPart5Of6,significantWaveHeightPart6Of6&startTime=2024-05-15T16:13:53Z&endTime=2024-05-15T18:13:53Z',\n type: 'FeatureCollection',\n features: [\n {\n type: 'Feature',\n geometry: {type: 'Point', coordinates: [3.88, 55.81]},\n properties: {\n '2024-05-15T16:00:00Z': {\n meanWaveDirectionPart1Of6: '108.3,',\n meanWaveDirectionPart2Of6: '42.5,',\n meanWaveDirectionPart3Of6: '45.7,',\n meanWaveDirectionPart4Of6: '198.6,',\n meanWaveDirectionPart5Of6: '44.2,',\n meanWaveDirectionPart6Of6: '134.1,',\n meanWaveDirectionalSpreadingPart1Of6: '35,',\n meanWaveDirectionalSpreadingPart2Of6: '13.45,',\n meanWaveDirectionalSpreadingPart3Of6: '14.82,',\n meanWaveDirectionalSpreadingPart4Of6: '9.3,',\n meanWaveDirectionalSpreadingPart5Of6: '10.32,',\n meanWaveDirectionalSpreadingPart6Of6: '12.34,',\n peakPeriodPart1Of6: '6.3,',\n peakPeriodPart2Of6: '5.2,',\n peakPeriodPart3Of6: '5.2,',\n peakPeriodPart4Of6: '4.75,',\n peakPeriodPart5Of6: '4.89,',\n peakPeriodPart6Of6: '5.2,',\n significantWaveHeightPart1Of6: '1.72,',\n significantWaveHeightPart2Of6: '0.57,',\n significantWaveHeightPart3Of6: '0.63,',\n significantWaveHeightPart4Of6: '0.16,',\n significantWaveHeightPart5Of6: '0.12,',\n significantWaveHeightPart6Of6: 0.11\n },\n '2024-05-15T17:00:00Z': {\n meanWaveDirectionPart1Of6: '115,',\n meanWaveDirectionPart2Of6: '41.8,',\n meanWaveDirectionPart3Of6: '41.4,',\n meanWaveDirectionPart4Of6: '36.6,',\n meanWaveDirectionPart5Of6: '190,',\n meanWaveDirectionPart6Of6: '130.1,',\n meanWaveDirectionalSpreadingPart1Of6: '29.2,',\n meanWaveDirectionalSpreadingPart2Of6: '13.4,',\n meanWaveDirectionalSpreadingPart3Of6: '13.3,',\n meanWaveDirectionalSpreadingPart4Of6: '12.13,',\n meanWaveDirectionalSpreadingPart5Of6: '0,',\n meanWaveDirectionalSpreadingPart6Of6: '12.11,',\n peakPeriodPart1Of6: '6.3,',\n peakPeriodPart2Of6: '5.2,',\n peakPeriodPart3Of6: '5.2,',\n peakPeriodPart4Of6: '6.3,',\n peakPeriodPart5Of6: '4.75,',\n peakPeriodPart6Of6: '4.1,',\n significantWaveHeightPart1Of6: '1.65,',\n significantWaveHeightPart2Of6: '0.58,',\n significantWaveHeightPart3Of6: '0.59,',\n significantWaveHeightPart4Of6: '0.34,',\n significantWaveHeightPart5Of6: '0.08,',\n significantWaveHeightPart6Of6: 0.15\n },\n '2024-05-15T18:00:00Z': {\n meanWaveDirectionPart1Of6: '107.2,',\n meanWaveDirectionPart2Of6: '63.55,',\n meanWaveDirectionPart3Of6: '40.65,',\n meanWaveDirectionPart4Of6: '35.9,',\n meanWaveDirectionPart5Of6: '108.1,',\n meanWaveDirectionPart6Of6: '77.1,',\n meanWaveDirectionalSpreadingPart1Of6: '35.1,',\n meanWaveDirectionalSpreadingPart2Of6: '15.16,',\n meanWaveDirectionalSpreadingPart3Of6: '13.56,',\n meanWaveDirectionalSpreadingPart4Of6: '12.4,',\n meanWaveDirectionalSpreadingPart5Of6: '12.1,',\n meanWaveDirectionalSpreadingPart6Of6: '13.9,',\n peakPeriodPart1Of6: '6.3,',\n peakPeriodPart2Of6: '5.5,',\n peakPeriodPart3Of6: '5.2,',\n peakPeriodPart4Of6: '6.3,',\n peakPeriodPart5Of6: '5.2,',\n peakPeriodPart6Of6: '5.9,',\n significantWaveHeightPart1Of6: '1.79,',\n significantWaveHeightPart2Of6: '0.83,',\n significantWaveHeightPart3Of6: '0.6,',\n significantWaveHeightPart4Of6: '0.33,',\n significantWaveHeightPart5Of6: '0.78,',\n significantWaveHeightPart6Of6: 1.55\n }\n }\n }\n ]\n },\n json: true\n};\n\nrequest(options, function (error, response, body) {\n if (error) throw new Error(error);\n\n console.log(body);\n});\n"
- lang: Node + Unirest
source: "const unirest = require(\"unirest\");\n\nconst req = unirest(\"GET\", \"https://weather.api.dtn.com/v1/conditions/marine/wave-partitions\");\n\nreq.headers({\n \"content-type\": \"application/json\",\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n});\n\nreq.type(\"json\");\nreq.send({\n \"url\": \"https://weather.api.dtn.com/v1/conditions/marine/wave-partitions?lat=55.81&lon=3.88¶meters=meanWaveDirectionPart1Of6,meanWaveDirectionPart2Of6,meanWaveDirectionPart3Of6,meanWaveDirectionPart4Of6,meanWaveDirectionPart5Of6,meanWaveDirectionPart6Of6,meanWaveDirectionalSpreadingPart1Of6,meanWaveDirectionalSpreadingPart2Of6,meanWaveDirectionalSpreadingPart3Of6,meanWaveDirectionalSpreadingPart4Of6,meanWaveDirectionalSpreadingPart5Of6,meanWaveDirectionalSpreadingPart6Of6,peakPeriodPart1Of6,peakPeriodPart2Of6,peakPeriodPart3Of6,peakPeriodPart4Of6,peakPeriodPart5Of6,peakPeriodPart6Of6,significantWaveHeightPart1Of6,significantWaveHeightPart2Of6,significantWaveHeightPart3Of6,significantWaveHeightPart4Of6,significantWaveHeightPart5Of6,significantWaveHeightPart6Of6&startTime=2024-05-15T16:13:53Z&endTime=2024-05-15T18:13:53Z\",\n \"type\": \"FeatureCollection\",\n \"features\": [\n {\n \"type\": \"Feature\",\n \"geometry\": {\n \"type\": \"Point\",\n \"coordinates\": [\n 3.88,\n 55.81\n ]\n },\n \"properties\": {\n \"2024-05-15T16:00:00Z\": {\n \"meanWaveDirectionPart1Of6\": \"108.3,\",\n \"meanWaveDirectionPart2Of6\": \"42.5,\",\n \"meanWaveDirectionPart3Of6\": \"45.7,\",\n \"meanWaveDirectionPart4Of6\": \"198.6,\",\n \"meanWaveDirectionPart5Of6\": \"44.2,\",\n \"meanWaveDirectionPart6Of6\": \"134.1,\",\n \"meanWaveDirectionalSpreadingPart1Of6\": \"35,\",\n \"meanWaveDirectionalSpreadingPart2Of6\": \"13.45,\",\n \"meanWaveDirectionalSpreadingPart3Of6\": \"14.82,\",\n \"meanWaveDirectionalSpreadingPart4Of6\": \"9.3,\",\n \"meanWaveDirectionalSpreadingPart5Of6\": \"10.32,\",\n \"meanWaveDirectionalSpreadingPart6Of6\": \"12.34,\",\n \"peakPeriodPart1Of6\": \"6.3,\",\n \"peakPeriodPart2Of6\": \"5.2,\",\n \"peakPeriodPart3Of6\": \"5.2,\",\n \"peakPeriodPart4Of6\": \"4.75,\",\n \"peakPeriodPart5Of6\": \"4.89,\",\n \"peakPeriodPart6Of6\": \"5.2,\",\n \"significantWaveHeightPart1Of6\": \"1.72,\",\n \"significantWaveHeightPart2Of6\": \"0.57,\",\n \"significantWaveHeightPart3Of6\": \"0.63,\",\n \"significantWaveHeightPart4Of6\": \"0.16,\",\n \"significantWaveHeightPart5Of6\": \"0.12,\",\n \"significantWaveHeightPart6Of6\": 0.11\n },\n \"2024-05-15T17:00:00Z\": {\n \"meanWaveDirectionPart1Of6\": \"115,\",\n \"meanWaveDirectionPart2Of6\": \"41.8,\",\n \"meanWaveDirectionPart3Of6\": \"41.4,\",\n \"meanWaveDirectionPart4Of6\": \"36.6,\",\n \"meanWaveDirectionPart5Of6\": \"190,\",\n \"meanWaveDirectionPart6Of6\": \"130.1,\",\n \"meanWaveDirectionalSpreadingPart1Of6\": \"29.2,\",\n \"meanWaveDirectionalSpreadingPart2Of6\": \"13.4,\",\n \"meanWaveDirectionalSpreadingPart3Of6\": \"13.3,\",\n \"meanWaveDirectionalSpreadingPart4Of6\": \"12.13,\",\n \"meanWaveDirectionalSpreadingPart5Of6\": \"0,\",\n \"meanWaveDirectionalSpreadingPart6Of6\": \"12.11,\",\n \"peakPeriodPart1Of6\": \"6.3,\",\n \"peakPeriodPart2Of6\": \"5.2,\",\n \"peakPeriodPart3Of6\": \"5.2,\",\n \"peakPeriodPart4Of6\": \"6.3,\",\n \"peakPeriodPart5Of6\": \"4.75,\",\n \"peakPeriodPart6Of6\": \"4.1,\",\n \"significantWaveHeightPart1Of6\": \"1.65,\",\n \"significantWaveHeightPart2Of6\": \"0.58,\",\n \"significantWaveHeightPart3Of6\": \"0.59,\",\n \"significantWaveHeightPart4Of6\": \"0.34,\",\n \"significantWaveHeightPart5Of6\": \"0.08,\",\n \"significantWaveHeightPart6Of6\": 0.15\n },\n \"2024-05-15T18:00:00Z\": {\n \"meanWaveDirectionPart1Of6\": \"107.2,\",\n \"meanWaveDirectionPart2Of6\": \"63.55,\",\n \"meanWaveDirectionPart3Of6\": \"40.65,\",\n \"meanWaveDirectionPart4Of6\": \"35.9,\",\n \"meanWaveDirectionPart5Of6\": \"108.1,\",\n \"meanWaveDirectionPart6Of6\": \"77.1,\",\n \"meanWaveDirectionalSpreadingPart1Of6\": \"35.1,\",\n \"meanWaveDirectionalSpreadingPart2Of6\": \"15.16,\",\n \"meanWaveDirectionalSpreadingPart3Of6\": \"13.56,\",\n \"meanWaveDirectionalSpreadingPart4Of6\": \"12.4,\",\n \"meanWaveDirectionalSpreadingPart5Of6\": \"12.1,\",\n \"meanWaveDirectionalSpreadingPart6Of6\": \"13.9,\",\n \"peakPeriodPart1Of6\": \"6.3,\",\n \"peakPeriodPart2Of6\": \"5.5,\",\n \"peakPeriodPart3Of6\": \"5.2,\",\n \"peakPeriodPart4Of6\": \"6.3,\",\n \"peakPeriodPart5Of6\": \"5.2,\",\n \"peakPeriodPart6Of6\": \"5.9,\",\n \"significantWaveHeightPart1Of6\": \"1.79,\",\n \"significantWaveHeightPart2Of6\": \"0.83,\",\n \"significantWaveHeightPart3Of6\": \"0.6,\",\n \"significantWaveHeightPart4Of6\": \"0.33,\",\n \"significantWaveHeightPart5Of6\": \"0.78,\",\n \"significantWaveHeightPart6Of6\": 1.55\n }\n }\n }\n ]\n});\n\nreq.end(function (res) {\n if (res.error) throw new Error(res.error);\n\n console.log(res.body);\n});\n"
- lang: Objc + Nsurlsession
source: "#import \n\nNSDictionary *headers = @{ @\"content-type\": @\"application/json\",\n @\"Accept-Encoding\": @\"SOME_STRING_VALUE\",\n @\"Accept\": @\"SOME_STRING_VALUE\",\n @\"Authorization\": @\"Bearer REPLACE_BEARER_TOKEN\" };\nNSDictionary *parameters = @{ @\"url\": @\"https://weather.api.dtn.com/v1/conditions/marine/wave-partitions?lat=55.81&lon=3.88¶meters=meanWaveDirectionPart1Of6,meanWaveDirectionPart2Of6,meanWaveDirectionPart3Of6,meanWaveDirectionPart4Of6,meanWaveDirectionPart5Of6,meanWaveDirectionPart6Of6,meanWaveDirectionalSpreadingPart1Of6,meanWaveDirectionalSpreadingPart2Of6,meanWaveDirectionalSpreadingPart3Of6,meanWaveDirectionalSpreadingPart4Of6,meanWaveDirectionalSpreadingPart5Of6,meanWaveDirectionalSpreadingPart6Of6,peakPeriodPart1Of6,peakPeriodPart2Of6,peakPeriodPart3Of6,peakPeriodPart4Of6,peakPeriodPart5Of6,peakPeriodPart6Of6,significantWaveHeightPart1Of6,significantWaveHeightPart2Of6,significantWaveHeightPart3Of6,significantWaveHeightPart4Of6,significantWaveHeightPart5Of6,significantWaveHeightPart6Of6&startTime=2024-05-15T16:13:53Z&endTime=2024-05-15T18:13:53Z\",\n @\"type\": @\"FeatureCollection\",\n @\"features\": @[ @{ @\"type\": @\"Feature\", @\"geometry\": @{ @\"type\": @\"Point\", @\"coordinates\": @[ @3.88, @55.81 ] }, @\"properties\": @{ @\"2024-05-15T16:00:00Z\": @{ @\"meanWaveDirectionPart1Of6\": @\"108.3,\", @\"meanWaveDirectionPart2Of6\": @\"42.5,\", @\"meanWaveDirectionPart3Of6\": @\"45.7,\", @\"meanWaveDirectionPart4Of6\": @\"198.6,\", @\"meanWaveDirectionPart5Of6\": @\"44.2,\", @\"meanWaveDirectionPart6Of6\": @\"134.1,\", @\"meanWaveDirectionalSpreadingPart1Of6\": @\"35,\", @\"meanWaveDirectionalSpreadingPart2Of6\": @\"13.45,\", @\"meanWaveDirectionalSpreadingPart3Of6\": @\"14.82,\", @\"meanWaveDirectionalSpreadingPart4Of6\": @\"9.3,\", @\"meanWaveDirectionalSpreadingPart5Of6\": @\"10.32,\", @\"meanWaveDirectionalSpreadingPart6Of6\": @\"12.34,\", @\"peakPeriodPart1Of6\": @\"6.3,\", @\"peakPeriodPart2Of6\": @\"5.2,\", @\"peakPeriodPart3Of6\": @\"5.2,\", @\"peakPeriodPart4Of6\": @\"4.75,\", @\"peakPeriodPart5Of6\": @\"4.89,\", @\"peakPeriodPart6Of6\": @\"5.2,\", @\"significantWaveHeightPart1Of6\": @\"1.72,\", @\"significantWaveHeightPart2Of6\": @\"0.57,\", @\"significantWaveHeightPart3Of6\": @\"0.63,\", @\"significantWaveHeightPart4Of6\": @\"0.16,\", @\"significantWaveHeightPart5Of6\": @\"0.12,\", @\"significantWaveHeightPart6Of6\": @0.11 }, @\"2024-05-15T17:00:00Z\": @{ @\"meanWaveDirectionPart1Of6\": @\"115,\", @\"meanWaveDirectionPart2Of6\": @\"41.8,\", @\"meanWaveDirectionPart3Of6\": @\"41.4,\", @\"meanWaveDirectionPart4Of6\": @\"36.6,\", @\"meanWaveDirectionPart5Of6\": @\"190,\", @\"meanWaveDirectionPart6Of6\": @\"130.1,\", @\"meanWaveDirectionalSpreadingPart1Of6\": @\"29.2,\", @\"meanWaveDirectionalSpreadingPart2Of6\": @\"13.4,\", @\"meanWaveDirectionalSpreadingPart3Of6\": @\"13.3,\", @\"meanWaveDirectionalSpreadingPart4Of6\": @\"12.13,\", @\"meanWaveDirectionalSpreadingPart5Of6\": @\"0,\", @\"meanWaveDirectionalSpreadingPart6Of6\": @\"12.11,\", @\"peakPeriodPart1Of6\": @\"6.3,\", @\"peakPeriodPart2Of6\": @\"5.2,\", @\"peakPeriodPart3Of6\": @\"5.2,\", @\"peakPeriodPart4Of6\": @\"6.3,\", @\"peakPeriodPart5Of6\": @\"4.75,\", @\"peakPeriodPart6Of6\": @\"4.1,\", @\"significantWaveHeightPart1Of6\": @\"1.65,\", @\"significantWaveHeightPart2Of6\": @\"0.58,\", @\"significantWaveHeightPart3Of6\": @\"0.59,\", @\"significantWaveHeightPart4Of6\": @\"0.34,\", @\"significantWaveHeightPart5Of6\": @\"0.08,\", @\"significantWaveHeightPart6Of6\": @0.15 }, @\"2024-05-15T18:00:00Z\": @{ @\"meanWaveDirectionPart1Of6\": @\"107.2,\", @\"meanWaveDirectionPart2Of6\": @\"63.55,\", @\"meanWaveDirectionPart3Of6\": @\"40.65,\", @\"meanWaveDirectionPart4Of6\": @\"35.9,\", @\"meanWaveDirectionPart5Of6\": @\"108.1,\", @\"meanWaveDirectionPart6Of6\": @\"77.1,\", @\"meanWaveDirectionalSpreadingPart1Of6\": @\"35.1,\", @\"meanWaveDirectionalSpreadingPart2Of6\": @\"15.16,\", @\"meanWaveDirectionalSpreadingPart3Of6\": @\"13.56,\", @\"meanWaveDirectionalSpreadingPart4Of6\": @\"12.4,\", @\"meanWaveDirectionalSpreadingPart5Of6\": @\"12.1,\", @\"meanWaveDirectionalSpreadingPart6Of6\": @\"13.9,\", @\"peakPeriodPart1Of6\": @\"6.3,\", @\"peakPeriodPart2Of6\": @\"5.5,\", @\"peakPeriodPart3Of6\": @\"5.2,\", @\"peakPeriodPart4Of6\": @\"6.3,\", @\"peakPeriodPart5Of6\": @\"5.2,\", @\"peakPeriodPart6Of6\": @\"5.9,\", @\"significantWaveHeightPart1Of6\": @\"1.79,\", @\"significantWaveHeightPart2Of6\": @\"0.83,\", @\"significantWaveHeightPart3Of6\": @\"0.6,\", @\"significantWaveHeightPart4Of6\": @\"0.33,\", @\"significantWaveHeightPart5Of6\": @\"0.78,\", @\"significantWaveHeightPart6Of6\": @1.55 } } } ] };\n\nNSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://weather.api.dtn.com/v1/conditions/marine/wave-partitions\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\n[request setHTTPMethod:@\"GET\"];\n[request setAllHTTPHeaderFields:headers];\n[request setHTTPBody:postData];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSLog(@\"%@\", httpResponse);\n }\n }];\n[dataTask resume];"
- lang: Ocaml + Cohttp
source: "open Cohttp_lwt_unix\nopen Cohttp\nopen Lwt\n\nlet uri = Uri.of_string \"https://weather.api.dtn.com/v1/conditions/marine/wave-partitions\" in\nlet headers = Header.add_list (Header.init ()) [\n (\"content-type\", \"application/json\");\n (\"Accept-Encoding\", \"SOME_STRING_VALUE\");\n (\"Accept\", \"SOME_STRING_VALUE\");\n (\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\");\n] in\nlet body = Cohttp_lwt_body.of_string \"{\\\"url\\\":\\\"https://weather.api.dtn.com/v1/conditions/marine/wave-partitions?lat=55.81&lon=3.88¶meters=meanWaveDirectionPart1Of6,meanWaveDirectionPart2Of6,meanWaveDirectionPart3Of6,meanWaveDirectionPart4Of6,meanWaveDirectionPart5Of6,meanWaveDirectionPart6Of6,meanWaveDirectionalSpreadingPart1Of6,meanWaveDirectionalSpreadingPart2Of6,meanWaveDirectionalSpreadingPart3Of6,meanWaveDirectionalSpreadingPart4Of6,meanWaveDirectionalSpreadingPart5Of6,meanWaveDirectionalSpreadingPart6Of6,peakPeriodPart1Of6,peakPeriodPart2Of6,peakPeriodPart3Of6,peakPeriodPart4Of6,peakPeriodPart5Of6,peakPeriodPart6Of6,significantWaveHeightPart1Of6,significantWaveHeightPart2Of6,significantWaveHeightPart3Of6,significantWaveHeightPart4Of6,significantWaveHeightPart5Of6,significantWaveHeightPart6Of6&startTime=2024-05-15T16:13:53Z&endTime=2024-05-15T18:13:53Z\\\",\\\"type\\\":\\\"FeatureCollection\\\",\\\"features\\\":[{\\\"type\\\":\\\"Feature\\\",\\\"geometry\\\":{\\\"type\\\":\\\"Point\\\",\\\"coordinates\\\":[3.88,55.81]},\\\"properties\\\":{\\\"2024-05-15T16:00:00Z\\\":{\\\"meanWaveDirectionPart1Of6\\\":\\\"108.3,\\\",\\\"meanWaveDirectionPart2Of6\\\":\\\"42.5,\\\",\\\"meanWaveDirectionPart3Of6\\\":\\\"45.7,\\\",\\\"meanWaveDirectionPart4Of6\\\":\\\"198.6,\\\",\\\"meanWaveDirectionPart5Of6\\\":\\\"44.2,\\\",\\\"meanWaveDirectionPart6Of6\\\":\\\"134.1,\\\",\\\"meanWaveDirectionalSpreadingPart1Of6\\\":\\\"35,\\\",\\\"meanWaveDirectionalSpreadingPart2Of6\\\":\\\"13.45,\\\",\\\"meanWaveDirectionalSpreadingPart3Of6\\\":\\\"14.82,\\\",\\\"meanWaveDirectionalSpreadingPart4Of6\\\":\\\"9.3,\\\",\\\"meanWaveDirectionalSpreadingPart5Of6\\\":\\\"10.32,\\\",\\\"meanWaveDirectionalSpreadingPart6Of6\\\":\\\"12.34,\\\",\\\"peakPeriodPart1Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart2Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart3Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart4Of6\\\":\\\"4.75,\\\",\\\"peakPeriodPart5Of6\\\":\\\"4.89,\\\",\\\"peakPeriodPart6Of6\\\":\\\"5.2,\\\",\\\"significantWaveHeightPart1Of6\\\":\\\"1.72,\\\",\\\"significantWaveHeightPart2Of6\\\":\\\"0.57,\\\",\\\"significantWaveHeightPart3Of6\\\":\\\"0.63,\\\",\\\"significantWaveHeightPart4Of6\\\":\\\"0.16,\\\",\\\"significantWaveHeightPart5Of6\\\":\\\"0.12,\\\",\\\"significantWaveHeightPart6Of6\\\":0.11},\\\"2024-05-15T17:00:00Z\\\":{\\\"meanWaveDirectionPart1Of6\\\":\\\"115,\\\",\\\"meanWaveDirectionPart2Of6\\\":\\\"41.8,\\\",\\\"meanWaveDirectionPart3Of6\\\":\\\"41.4,\\\",\\\"meanWaveDirectionPart4Of6\\\":\\\"36.6,\\\",\\\"meanWaveDirectionPart5Of6\\\":\\\"190,\\\",\\\"meanWaveDirectionPart6Of6\\\":\\\"130.1,\\\",\\\"meanWaveDirectionalSpreadingPart1Of6\\\":\\\"29.2,\\\",\\\"meanWaveDirectionalSpreadingPart2Of6\\\":\\\"13.4,\\\",\\\"meanWaveDirectionalSpreadingPart3Of6\\\":\\\"13.3,\\\",\\\"meanWaveDirectionalSpreadingPart4Of6\\\":\\\"12.13,\\\",\\\"meanWaveDirectionalSpreadingPart5Of6\\\":\\\"0,\\\",\\\"meanWaveDirectionalSpreadingPart6Of6\\\":\\\"12.11,\\\",\\\"peakPeriodPart1Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart2Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart3Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart4Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart5Of6\\\":\\\"4.75,\\\",\\\"peakPeriodPart6Of6\\\":\\\"4.1,\\\",\\\"significantWaveHeightPart1Of6\\\":\\\"1.65,\\\",\\\"significantWaveHeightPart2Of6\\\":\\\"0.58,\\\",\\\"significantWaveHeightPart3Of6\\\":\\\"0.59,\\\",\\\"significantWaveHeightPart4Of6\\\":\\\"0.34,\\\",\\\"significantWaveHeightPart5Of6\\\":\\\"0.08,\\\",\\\"significantWaveHeightPart6Of6\\\":0.15},\\\"2024-05-15T18:00:00Z\\\":{\\\"meanWaveDirectionPart1Of6\\\":\\\"107.2,\\\",\\\"meanWaveDirectionPart2Of6\\\":\\\"63.55,\\\",\\\"meanWaveDirectionPart3Of6\\\":\\\"40.65,\\\",\\\"meanWaveDirectionPart4Of6\\\":\\\"35.9,\\\",\\\"meanWaveDirectionPart5Of6\\\":\\\"108.1,\\\",\\\"meanWaveDirectionPart6Of6\\\":\\\"77.1,\\\",\\\"meanWaveDirectionalSpreadingPart1Of6\\\":\\\"35.1,\\\",\\\"meanWaveDirectionalSpreadingPart2Of6\\\":\\\"15.16,\\\",\\\"meanWaveDirectionalSpreadingPart3Of6\\\":\\\"13.56,\\\",\\\"meanWaveDirectionalSpreadingPart4Of6\\\":\\\"12.4,\\\",\\\"meanWaveDirectionalSpreadingPart5Of6\\\":\\\"12.1,\\\",\\\"meanWaveDirectionalSpreadingPart6Of6\\\":\\\"13.9,\\\",\\\"peakPeriodPart1Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart2Of6\\\":\\\"5.5,\\\",\\\"peakPeriodPart3Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart4Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart5Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart6Of6\\\":\\\"5.9,\\\",\\\"significantWaveHeightPart1Of6\\\":\\\"1.79,\\\",\\\"significantWaveHeightPart2Of6\\\":\\\"0.83,\\\",\\\"significantWaveHeightPart3Of6\\\":\\\"0.6,\\\",\\\"significantWaveHeightPart4Of6\\\":\\\"0.33,\\\",\\\"significantWaveHeightPart5Of6\\\":\\\"0.78,\\\",\\\"significantWaveHeightPart6Of6\\\":1.55}}}]}\" in\n\nClient.call ~headers ~body `GET uri\n>>= fun (res, body_stream) ->\n (* Do stuff with the result *)"
- lang: Php + Curl
source: " \"https://weather.api.dtn.com/v1/conditions/marine/wave-partitions\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"GET\",\n CURLOPT_POSTFIELDS => \"{\\\"url\\\":\\\"https://weather.api.dtn.com/v1/conditions/marine/wave-partitions?lat=55.81&lon=3.88¶meters=meanWaveDirectionPart1Of6,meanWaveDirectionPart2Of6,meanWaveDirectionPart3Of6,meanWaveDirectionPart4Of6,meanWaveDirectionPart5Of6,meanWaveDirectionPart6Of6,meanWaveDirectionalSpreadingPart1Of6,meanWaveDirectionalSpreadingPart2Of6,meanWaveDirectionalSpreadingPart3Of6,meanWaveDirectionalSpreadingPart4Of6,meanWaveDirectionalSpreadingPart5Of6,meanWaveDirectionalSpreadingPart6Of6,peakPeriodPart1Of6,peakPeriodPart2Of6,peakPeriodPart3Of6,peakPeriodPart4Of6,peakPeriodPart5Of6,peakPeriodPart6Of6,significantWaveHeightPart1Of6,significantWaveHeightPart2Of6,significantWaveHeightPart3Of6,significantWaveHeightPart4Of6,significantWaveHeightPart5Of6,significantWaveHeightPart6Of6&startTime=2024-05-15T16:13:53Z&endTime=2024-05-15T18:13:53Z\\\",\\\"type\\\":\\\"FeatureCollection\\\",\\\"features\\\":[{\\\"type\\\":\\\"Feature\\\",\\\"geometry\\\":{\\\"type\\\":\\\"Point\\\",\\\"coordinates\\\":[3.88,55.81]},\\\"properties\\\":{\\\"2024-05-15T16:00:00Z\\\":{\\\"meanWaveDirectionPart1Of6\\\":\\\"108.3,\\\",\\\"meanWaveDirectionPart2Of6\\\":\\\"42.5,\\\",\\\"meanWaveDirectionPart3Of6\\\":\\\"45.7,\\\",\\\"meanWaveDirectionPart4Of6\\\":\\\"198.6,\\\",\\\"meanWaveDirectionPart5Of6\\\":\\\"44.2,\\\",\\\"meanWaveDirectionPart6Of6\\\":\\\"134.1,\\\",\\\"meanWaveDirectionalSpreadingPart1Of6\\\":\\\"35,\\\",\\\"meanWaveDirectionalSpreadingPart2Of6\\\":\\\"13.45,\\\",\\\"meanWaveDirectionalSpreadingPart3Of6\\\":\\\"14.82,\\\",\\\"meanWaveDirectionalSpreadingPart4Of6\\\":\\\"9.3,\\\",\\\"meanWaveDirectionalSpreadingPart5Of6\\\":\\\"10.32,\\\",\\\"meanWaveDirectionalSpreadingPart6Of6\\\":\\\"12.34,\\\",\\\"peakPeriodPart1Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart2Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart3Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart4Of6\\\":\\\"4.75,\\\",\\\"peakPeriodPart5Of6\\\":\\\"4.89,\\\",\\\"peakPeriodPart6Of6\\\":\\\"5.2,\\\",\\\"significantWaveHeightPart1Of6\\\":\\\"1.72,\\\",\\\"significantWaveHeightPart2Of6\\\":\\\"0.57,\\\",\\\"significantWaveHeightPart3Of6\\\":\\\"0.63,\\\",\\\"significantWaveHeightPart4Of6\\\":\\\"0.16,\\\",\\\"significantWaveHeightPart5Of6\\\":\\\"0.12,\\\",\\\"significantWaveHeightPart6Of6\\\":0.11},\\\"2024-05-15T17:00:00Z\\\":{\\\"meanWaveDirectionPart1Of6\\\":\\\"115,\\\",\\\"meanWaveDirectionPart2Of6\\\":\\\"41.8,\\\",\\\"meanWaveDirectionPart3Of6\\\":\\\"41.4,\\\",\\\"meanWaveDirectionPart4Of6\\\":\\\"36.6,\\\",\\\"meanWaveDirectionPart5Of6\\\":\\\"190,\\\",\\\"meanWaveDirectionPart6Of6\\\":\\\"130.1,\\\",\\\"meanWaveDirectionalSpreadingPart1Of6\\\":\\\"29.2,\\\",\\\"meanWaveDirectionalSpreadingPart2Of6\\\":\\\"13.4,\\\",\\\"meanWaveDirectionalSpreadingPart3Of6\\\":\\\"13.3,\\\",\\\"meanWaveDirectionalSpreadingPart4Of6\\\":\\\"12.13,\\\",\\\"meanWaveDirectionalSpreadingPart5Of6\\\":\\\"0,\\\",\\\"meanWaveDirectionalSpreadingPart6Of6\\\":\\\"12.11,\\\",\\\"peakPeriodPart1Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart2Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart3Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart4Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart5Of6\\\":\\\"4.75,\\\",\\\"peakPeriodPart6Of6\\\":\\\"4.1,\\\",\\\"significantWaveHeightPart1Of6\\\":\\\"1.65,\\\",\\\"significantWaveHeightPart2Of6\\\":\\\"0.58,\\\",\\\"significantWaveHeightPart3Of6\\\":\\\"0.59,\\\",\\\"significantWaveHeightPart4Of6\\\":\\\"0.34,\\\",\\\"significantWaveHeightPart5Of6\\\":\\\"0.08,\\\",\\\"significantWaveHeightPart6Of6\\\":0.15},\\\"2024-05-15T18:00:00Z\\\":{\\\"meanWaveDirectionPart1Of6\\\":\\\"107.2,\\\",\\\"meanWaveDirectionPart2Of6\\\":\\\"63.55,\\\",\\\"meanWaveDirectionPart3Of6\\\":\\\"40.65,\\\",\\\"meanWaveDirectionPart4Of6\\\":\\\"35.9,\\\",\\\"meanWaveDirectionPart5Of6\\\":\\\"108.1,\\\",\\\"meanWaveDirectionPart6Of6\\\":\\\"77.1,\\\",\\\"meanWaveDirectionalSpreadingPart1Of6\\\":\\\"35.1,\\\",\\\"meanWaveDirectionalSpreadingPart2Of6\\\":\\\"15.16,\\\",\\\"meanWaveDirectionalSpreadingPart3Of6\\\":\\\"13.56,\\\",\\\"meanWaveDirectionalSpreadingPart4Of6\\\":\\\"12.4,\\\",\\\"meanWaveDirectionalSpreadingPart5Of6\\\":\\\"12.1,\\\",\\\"meanWaveDirectionalSpreadingPart6Of6\\\":\\\"13.9,\\\",\\\"peakPeriodPart1Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart2Of6\\\":\\\"5.5,\\\",\\\"peakPeriodPart3Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart4Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart5Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart6Of6\\\":\\\"5.9,\\\",\\\"significantWaveHeightPart1Of6\\\":\\\"1.79,\\\",\\\"significantWaveHeightPart2Of6\\\":\\\"0.83,\\\",\\\"significantWaveHeightPart3Of6\\\":\\\"0.6,\\\",\\\"significantWaveHeightPart4Of6\\\":\\\"0.33,\\\",\\\"significantWaveHeightPart5Of6\\\":\\\"0.78,\\\",\\\"significantWaveHeightPart6Of6\\\":1.55}}}]}\",\n CURLOPT_HTTPHEADER => [\n \"Accept: SOME_STRING_VALUE\",\n \"Accept-Encoding: SOME_STRING_VALUE\",\n \"Authorization: Bearer REPLACE_BEARER_TOKEN\",\n \"content-type: application/json\"\n ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n echo \"cURL Error #:\" . $err;\n} else {\n echo $response;\n}"
- lang: Php + Http1
source: "setUrl('https://weather.api.dtn.com/v1/conditions/marine/wave-partitions');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setHeaders([\n 'content-type' => 'application/json',\n 'Accept-Encoding' => 'SOME_STRING_VALUE',\n 'Accept' => 'SOME_STRING_VALUE',\n 'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'\n]);\n\n$request->setBody('{\"url\":\"https://weather.api.dtn.com/v1/conditions/marine/wave-partitions?lat=55.81&lon=3.88¶meters=meanWaveDirectionPart1Of6,meanWaveDirectionPart2Of6,meanWaveDirectionPart3Of6,meanWaveDirectionPart4Of6,meanWaveDirectionPart5Of6,meanWaveDirectionPart6Of6,meanWaveDirectionalSpreadingPart1Of6,meanWaveDirectionalSpreadingPart2Of6,meanWaveDirectionalSpreadingPart3Of6,meanWaveDirectionalSpreadingPart4Of6,meanWaveDirectionalSpreadingPart5Of6,meanWaveDirectionalSpreadingPart6Of6,peakPeriodPart1Of6,peakPeriodPart2Of6,peakPeriodPart3Of6,peakPeriodPart4Of6,peakPeriodPart5Of6,peakPeriodPart6Of6,significantWaveHeightPart1Of6,significantWaveHeightPart2Of6,significantWaveHeightPart3Of6,significantWaveHeightPart4Of6,significantWaveHeightPart5Of6,significantWaveHeightPart6Of6&startTime=2024-05-15T16:13:53Z&endTime=2024-05-15T18:13:53Z\",\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[3.88,55.81]},\"properties\":{\"2024-05-15T16:00:00Z\":{\"meanWaveDirectionPart1Of6\":\"108.3,\",\"meanWaveDirectionPart2Of6\":\"42.5,\",\"meanWaveDirectionPart3Of6\":\"45.7,\",\"meanWaveDirectionPart4Of6\":\"198.6,\",\"meanWaveDirectionPart5Of6\":\"44.2,\",\"meanWaveDirectionPart6Of6\":\"134.1,\",\"meanWaveDirectionalSpreadingPart1Of6\":\"35,\",\"meanWaveDirectionalSpreadingPart2Of6\":\"13.45,\",\"meanWaveDirectionalSpreadingPart3Of6\":\"14.82,\",\"meanWaveDirectionalSpreadingPart4Of6\":\"9.3,\",\"meanWaveDirectionalSpreadingPart5Of6\":\"10.32,\",\"meanWaveDirectionalSpreadingPart6Of6\":\"12.34,\",\"peakPeriodPart1Of6\":\"6.3,\",\"peakPeriodPart2Of6\":\"5.2,\",\"peakPeriodPart3Of6\":\"5.2,\",\"peakPeriodPart4Of6\":\"4.75,\",\"peakPeriodPart5Of6\":\"4.89,\",\"peakPeriodPart6Of6\":\"5.2,\",\"significantWaveHeightPart1Of6\":\"1.72,\",\"significantWaveHeightPart2Of6\":\"0.57,\",\"significantWaveHeightPart3Of6\":\"0.63,\",\"significantWaveHeightPart4Of6\":\"0.16,\",\"significantWaveHeightPart5Of6\":\"0.12,\",\"significantWaveHeightPart6Of6\":0.11},\"2024-05-15T17:00:00Z\":{\"meanWaveDirectionPart1Of6\":\"115,\",\"meanWaveDirectionPart2Of6\":\"41.8,\",\"meanWaveDirectionPart3Of6\":\"41.4,\",\"meanWaveDirectionPart4Of6\":\"36.6,\",\"meanWaveDirectionPart5Of6\":\"190,\",\"meanWaveDirectionPart6Of6\":\"130.1,\",\"meanWaveDirectionalSpreadingPart1Of6\":\"29.2,\",\"meanWaveDirectionalSpreadingPart2Of6\":\"13.4,\",\"meanWaveDirectionalSpreadingPart3Of6\":\"13.3,\",\"meanWaveDirectionalSpreadingPart4Of6\":\"12.13,\",\"meanWaveDirectionalSpreadingPart5Of6\":\"0,\",\"meanWaveDirectionalSpreadingPart6Of6\":\"12.11,\",\"peakPeriodPart1Of6\":\"6.3,\",\"peakPeriodPart2Of6\":\"5.2,\",\"peakPeriodPart3Of6\":\"5.2,\",\"peakPeriodPart4Of6\":\"6.3,\",\"peakPeriodPart5Of6\":\"4.75,\",\"peakPeriodPart6Of6\":\"4.1,\",\"significantWaveHeightPart1Of6\":\"1.65,\",\"significantWaveHeightPart2Of6\":\"0.58,\",\"significantWaveHeightPart3Of6\":\"0.59,\",\"significantWaveHeightPart4Of6\":\"0.34,\",\"significantWaveHeightPart5Of6\":\"0.08,\",\"significantWaveHeightPart6Of6\":0.15},\"2024-05-15T18:00:00Z\":{\"meanWaveDirectionPart1Of6\":\"107.2,\",\"meanWaveDirectionPart2Of6\":\"63.55,\",\"meanWaveDirectionPart3Of6\":\"40.65,\",\"meanWaveDirectionPart4Of6\":\"35.9,\",\"meanWaveDirectionPart5Of6\":\"108.1,\",\"meanWaveDirectionPart6Of6\":\"77.1,\",\"meanWaveDirectionalSpreadingPart1Of6\":\"35.1,\",\"meanWaveDirectionalSpreadingPart2Of6\":\"15.16,\",\"meanWaveDirectionalSpreadingPart3Of6\":\"13.56,\",\"meanWaveDirectionalSpreadingPart4Of6\":\"12.4,\",\"meanWaveDirectionalSpreadingPart5Of6\":\"12.1,\",\"meanWaveDirectionalSpreadingPart6Of6\":\"13.9,\",\"peakPeriodPart1Of6\":\"6.3,\",\"peakPeriodPart2Of6\":\"5.5,\",\"peakPeriodPart3Of6\":\"5.2,\",\"peakPeriodPart4Of6\":\"6.3,\",\"peakPeriodPart5Of6\":\"5.2,\",\"peakPeriodPart6Of6\":\"5.9,\",\"significantWaveHeightPart1Of6\":\"1.79,\",\"significantWaveHeightPart2Of6\":\"0.83,\",\"significantWaveHeightPart3Of6\":\"0.6,\",\"significantWaveHeightPart4Of6\":\"0.33,\",\"significantWaveHeightPart5Of6\":\"0.78,\",\"significantWaveHeightPart6Of6\":1.55}}}]}');\n\ntry {\n $response = $request->send();\n\n echo $response->getBody();\n} catch (HttpException $ex) {\n echo $ex;\n}"
- lang: Php + Http2
source: "append('{\"url\":\"https://weather.api.dtn.com/v1/conditions/marine/wave-partitions?lat=55.81&lon=3.88¶meters=meanWaveDirectionPart1Of6,meanWaveDirectionPart2Of6,meanWaveDirectionPart3Of6,meanWaveDirectionPart4Of6,meanWaveDirectionPart5Of6,meanWaveDirectionPart6Of6,meanWaveDirectionalSpreadingPart1Of6,meanWaveDirectionalSpreadingPart2Of6,meanWaveDirectionalSpreadingPart3Of6,meanWaveDirectionalSpreadingPart4Of6,meanWaveDirectionalSpreadingPart5Of6,meanWaveDirectionalSpreadingPart6Of6,peakPeriodPart1Of6,peakPeriodPart2Of6,peakPeriodPart3Of6,peakPeriodPart4Of6,peakPeriodPart5Of6,peakPeriodPart6Of6,significantWaveHeightPart1Of6,significantWaveHeightPart2Of6,significantWaveHeightPart3Of6,significantWaveHeightPart4Of6,significantWaveHeightPart5Of6,significantWaveHeightPart6Of6&startTime=2024-05-15T16:13:53Z&endTime=2024-05-15T18:13:53Z\",\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[3.88,55.81]},\"properties\":{\"2024-05-15T16:00:00Z\":{\"meanWaveDirectionPart1Of6\":\"108.3,\",\"meanWaveDirectionPart2Of6\":\"42.5,\",\"meanWaveDirectionPart3Of6\":\"45.7,\",\"meanWaveDirectionPart4Of6\":\"198.6,\",\"meanWaveDirectionPart5Of6\":\"44.2,\",\"meanWaveDirectionPart6Of6\":\"134.1,\",\"meanWaveDirectionalSpreadingPart1Of6\":\"35,\",\"meanWaveDirectionalSpreadingPart2Of6\":\"13.45,\",\"meanWaveDirectionalSpreadingPart3Of6\":\"14.82,\",\"meanWaveDirectionalSpreadingPart4Of6\":\"9.3,\",\"meanWaveDirectionalSpreadingPart5Of6\":\"10.32,\",\"meanWaveDirectionalSpreadingPart6Of6\":\"12.34,\",\"peakPeriodPart1Of6\":\"6.3,\",\"peakPeriodPart2Of6\":\"5.2,\",\"peakPeriodPart3Of6\":\"5.2,\",\"peakPeriodPart4Of6\":\"4.75,\",\"peakPeriodPart5Of6\":\"4.89,\",\"peakPeriodPart6Of6\":\"5.2,\",\"significantWaveHeightPart1Of6\":\"1.72,\",\"significantWaveHeightPart2Of6\":\"0.57,\",\"significantWaveHeightPart3Of6\":\"0.63,\",\"significantWaveHeightPart4Of6\":\"0.16,\",\"significantWaveHeightPart5Of6\":\"0.12,\",\"significantWaveHeightPart6Of6\":0.11},\"2024-05-15T17:00:00Z\":{\"meanWaveDirectionPart1Of6\":\"115,\",\"meanWaveDirectionPart2Of6\":\"41.8,\",\"meanWaveDirectionPart3Of6\":\"41.4,\",\"meanWaveDirectionPart4Of6\":\"36.6,\",\"meanWaveDirectionPart5Of6\":\"190,\",\"meanWaveDirectionPart6Of6\":\"130.1,\",\"meanWaveDirectionalSpreadingPart1Of6\":\"29.2,\",\"meanWaveDirectionalSpreadingPart2Of6\":\"13.4,\",\"meanWaveDirectionalSpreadingPart3Of6\":\"13.3,\",\"meanWaveDirectionalSpreadingPart4Of6\":\"12.13,\",\"meanWaveDirectionalSpreadingPart5Of6\":\"0,\",\"meanWaveDirectionalSpreadingPart6Of6\":\"12.11,\",\"peakPeriodPart1Of6\":\"6.3,\",\"peakPeriodPart2Of6\":\"5.2,\",\"peakPeriodPart3Of6\":\"5.2,\",\"peakPeriodPart4Of6\":\"6.3,\",\"peakPeriodPart5Of6\":\"4.75,\",\"peakPeriodPart6Of6\":\"4.1,\",\"significantWaveHeightPart1Of6\":\"1.65,\",\"significantWaveHeightPart2Of6\":\"0.58,\",\"significantWaveHeightPart3Of6\":\"0.59,\",\"significantWaveHeightPart4Of6\":\"0.34,\",\"significantWaveHeightPart5Of6\":\"0.08,\",\"significantWaveHeightPart6Of6\":0.15},\"2024-05-15T18:00:00Z\":{\"meanWaveDirectionPart1Of6\":\"107.2,\",\"meanWaveDirectionPart2Of6\":\"63.55,\",\"meanWaveDirectionPart3Of6\":\"40.65,\",\"meanWaveDirectionPart4Of6\":\"35.9,\",\"meanWaveDirectionPart5Of6\":\"108.1,\",\"meanWaveDirectionPart6Of6\":\"77.1,\",\"meanWaveDirectionalSpreadingPart1Of6\":\"35.1,\",\"meanWaveDirectionalSpreadingPart2Of6\":\"15.16,\",\"meanWaveDirectionalSpreadingPart3Of6\":\"13.56,\",\"meanWaveDirectionalSpreadingPart4Of6\":\"12.4,\",\"meanWaveDirectionalSpreadingPart5Of6\":\"12.1,\",\"meanWaveDirectionalSpreadingPart6Of6\":\"13.9,\",\"peakPeriodPart1Of6\":\"6.3,\",\"peakPeriodPart2Of6\":\"5.5,\",\"peakPeriodPart3Of6\":\"5.2,\",\"peakPeriodPart4Of6\":\"6.3,\",\"peakPeriodPart5Of6\":\"5.2,\",\"peakPeriodPart6Of6\":\"5.9,\",\"significantWaveHeightPart1Of6\":\"1.79,\",\"significantWaveHeightPart2Of6\":\"0.83,\",\"significantWaveHeightPart3Of6\":\"0.6,\",\"significantWaveHeightPart4Of6\":\"0.33,\",\"significantWaveHeightPart5Of6\":\"0.78,\",\"significantWaveHeightPart6Of6\":1.55}}}]}');\n\n$request->setRequestUrl('https://weather.api.dtn.com/v1/conditions/marine/wave-partitions');\n$request->setRequestMethod('GET');\n$request->setBody($body);\n\n$request->setHeaders([\n 'content-type' => 'application/json',\n 'Accept-Encoding' => 'SOME_STRING_VALUE',\n 'Accept' => 'SOME_STRING_VALUE',\n 'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"
- lang: Python + Python3
source: "import http.client\n\nconn = http.client.HTTPSConnection(\"weather.api.dtn.com\")\n\npayload = \"{\\\"url\\\":\\\"https://weather.api.dtn.com/v1/conditions/marine/wave-partitions?lat=55.81&lon=3.88¶meters=meanWaveDirectionPart1Of6,meanWaveDirectionPart2Of6,meanWaveDirectionPart3Of6,meanWaveDirectionPart4Of6,meanWaveDirectionPart5Of6,meanWaveDirectionPart6Of6,meanWaveDirectionalSpreadingPart1Of6,meanWaveDirectionalSpreadingPart2Of6,meanWaveDirectionalSpreadingPart3Of6,meanWaveDirectionalSpreadingPart4Of6,meanWaveDirectionalSpreadingPart5Of6,meanWaveDirectionalSpreadingPart6Of6,peakPeriodPart1Of6,peakPeriodPart2Of6,peakPeriodPart3Of6,peakPeriodPart4Of6,peakPeriodPart5Of6,peakPeriodPart6Of6,significantWaveHeightPart1Of6,significantWaveHeightPart2Of6,significantWaveHeightPart3Of6,significantWaveHeightPart4Of6,significantWaveHeightPart5Of6,significantWaveHeightPart6Of6&startTime=2024-05-15T16:13:53Z&endTime=2024-05-15T18:13:53Z\\\",\\\"type\\\":\\\"FeatureCollection\\\",\\\"features\\\":[{\\\"type\\\":\\\"Feature\\\",\\\"geometry\\\":{\\\"type\\\":\\\"Point\\\",\\\"coordinates\\\":[3.88,55.81]},\\\"properties\\\":{\\\"2024-05-15T16:00:00Z\\\":{\\\"meanWaveDirectionPart1Of6\\\":\\\"108.3,\\\",\\\"meanWaveDirectionPart2Of6\\\":\\\"42.5,\\\",\\\"meanWaveDirectionPart3Of6\\\":\\\"45.7,\\\",\\\"meanWaveDirectionPart4Of6\\\":\\\"198.6,\\\",\\\"meanWaveDirectionPart5Of6\\\":\\\"44.2,\\\",\\\"meanWaveDirectionPart6Of6\\\":\\\"134.1,\\\",\\\"meanWaveDirectionalSpreadingPart1Of6\\\":\\\"35,\\\",\\\"meanWaveDirectionalSpreadingPart2Of6\\\":\\\"13.45,\\\",\\\"meanWaveDirectionalSpreadingPart3Of6\\\":\\\"14.82,\\\",\\\"meanWaveDirectionalSpreadingPart4Of6\\\":\\\"9.3,\\\",\\\"meanWaveDirectionalSpreadingPart5Of6\\\":\\\"10.32,\\\",\\\"meanWaveDirectionalSpreadingPart6Of6\\\":\\\"12.34,\\\",\\\"peakPeriodPart1Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart2Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart3Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart4Of6\\\":\\\"4.75,\\\",\\\"peakPeriodPart5Of6\\\":\\\"4.89,\\\",\\\"peakPeriodPart6Of6\\\":\\\"5.2,\\\",\\\"significantWaveHeightPart1Of6\\\":\\\"1.72,\\\",\\\"significantWaveHeightPart2Of6\\\":\\\"0.57,\\\",\\\"significantWaveHeightPart3Of6\\\":\\\"0.63,\\\",\\\"significantWaveHeightPart4Of6\\\":\\\"0.16,\\\",\\\"significantWaveHeightPart5Of6\\\":\\\"0.12,\\\",\\\"significantWaveHeightPart6Of6\\\":0.11},\\\"2024-05-15T17:00:00Z\\\":{\\\"meanWaveDirectionPart1Of6\\\":\\\"115,\\\",\\\"meanWaveDirectionPart2Of6\\\":\\\"41.8,\\\",\\\"meanWaveDirectionPart3Of6\\\":\\\"41.4,\\\",\\\"meanWaveDirectionPart4Of6\\\":\\\"36.6,\\\",\\\"meanWaveDirectionPart5Of6\\\":\\\"190,\\\",\\\"meanWaveDirectionPart6Of6\\\":\\\"130.1,\\\",\\\"meanWaveDirectionalSpreadingPart1Of6\\\":\\\"29.2,\\\",\\\"meanWaveDirectionalSpreadingPart2Of6\\\":\\\"13.4,\\\",\\\"meanWaveDirectionalSpreadingPart3Of6\\\":\\\"13.3,\\\",\\\"meanWaveDirectionalSpreadingPart4Of6\\\":\\\"12.13,\\\",\\\"meanWaveDirectionalSpreadingPart5Of6\\\":\\\"0,\\\",\\\"meanWaveDirectionalSpreadingPart6Of6\\\":\\\"12.11,\\\",\\\"peakPeriodPart1Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart2Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart3Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart4Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart5Of6\\\":\\\"4.75,\\\",\\\"peakPeriodPart6Of6\\\":\\\"4.1,\\\",\\\"significantWaveHeightPart1Of6\\\":\\\"1.65,\\\",\\\"significantWaveHeightPart2Of6\\\":\\\"0.58,\\\",\\\"significantWaveHeightPart3Of6\\\":\\\"0.59,\\\",\\\"significantWaveHeightPart4Of6\\\":\\\"0.34,\\\",\\\"significantWaveHeightPart5Of6\\\":\\\"0.08,\\\",\\\"significantWaveHeightPart6Of6\\\":0.15},\\\"2024-05-15T18:00:00Z\\\":{\\\"meanWaveDirectionPart1Of6\\\":\\\"107.2,\\\",\\\"meanWaveDirectionPart2Of6\\\":\\\"63.55,\\\",\\\"meanWaveDirectionPart3Of6\\\":\\\"40.65,\\\",\\\"meanWaveDirectionPart4Of6\\\":\\\"35.9,\\\",\\\"meanWaveDirectionPart5Of6\\\":\\\"108.1,\\\",\\\"meanWaveDirectionPart6Of6\\\":\\\"77.1,\\\",\\\"meanWaveDirectionalSpreadingPart1Of6\\\":\\\"35.1,\\\",\\\"meanWaveDirectionalSpreadingPart2Of6\\\":\\\"15.16,\\\",\\\"meanWaveDirectionalSpreadingPart3Of6\\\":\\\"13.56,\\\",\\\"meanWaveDirectionalSpreadingPart4Of6\\\":\\\"12.4,\\\",\\\"meanWaveDirectionalSpreadingPart5Of6\\\":\\\"12.1,\\\",\\\"meanWaveDirectionalSpreadingPart6Of6\\\":\\\"13.9,\\\",\\\"peakPeriodPart1Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart2Of6\\\":\\\"5.5,\\\",\\\"peakPeriodPart3Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart4Of6\\\":\\\"6.3,\\\",\\\"peakPeriodPart5Of6\\\":\\\"5.2,\\\",\\\"peakPeriodPart6Of6\\\":\\\"5.9,\\\",\\\"significantWaveHeightPart1Of6\\\":\\\"1.79,\\\",\\\"significantWaveHeightPart2Of6\\\":\\\"0.83,\\\",\\\"significantWaveHeightPart3Of6\\\":\\\"0.6,\\\",\\\"significantWaveHeightPart4Of6\\\":\\\"0.33,\\\",\\\"significantWaveHeightPart5Of6\\\":\\\"0.78,\\\",\\\"significantWaveHeightPart6Of6\\\":1.55}}}]}\"\n\nheaders = {\n 'content-type': \"application/json\",\n 'Accept-Encoding': \"SOME_STRING_VALUE\",\n 'Accept': \"SOME_STRING_VALUE\",\n 'Authorization': \"Bearer REPLACE_BEARER_TOKEN\"\n }\n\nconn.request(\"GET\", \"/v1/conditions/marine/wave-partitions\", payload, headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"
- lang: Python + Requests
source: "import requests\n\nurl = \"https://weather.api.dtn.com/v1/conditions/marine/wave-partitions\"\n\npayload = {\n \"url\": \"https://weather.api.dtn.com/v1/conditions/marine/wave-partitions?lat=55.81&lon=3.88¶meters=meanWaveDirectionPart1Of6,meanWaveDirectionPart2Of6,meanWaveDirectionPart3Of6,meanWaveDirectionPart4Of6,meanWaveDirectionPart5Of6,meanWaveDirectionPart6Of6,meanWaveDirectionalSpreadingPart1Of6,meanWaveDirectionalSpreadingPart2Of6,meanWaveDirectionalSpreadingPart3Of6,meanWaveDirectionalSpreadingPart4Of6,meanWaveDirectionalSpreadingPart5Of6,meanWaveDirectionalSpreadingPart6Of6,peakPeriodPart1Of6,peakPeriodPart2Of6,peakPeriodPart3Of6,peakPeriodPart4Of6,peakPeriodPart5Of6,peakPeriodPart6Of6,significantWaveHeightPart1Of6,significantWaveHeightPart2Of6,significantWaveHeightPart3Of6,significantWaveHeightPart4Of6,significantWaveHeightPart5Of6,significantWaveHeightPart6Of6&startTime=2024-05-15T16:13:53Z&endTime=2024-05-15T18:13:53Z\",\n \"type\": \"FeatureCollection\",\n \"features\": [\n {\n \"type\": \"Feature\",\n \"geometry\": {\n \"type\": \"Point\",\n \"coordinates\": [3.88, 55.81]\n },\n \"properties\": {\n \"2024-05-15T16:00:00Z\": {\n \"meanWaveDirectionPart1Of6\": \"108.3,\",\n \"meanWaveDirectionPart2Of6\": \"42.5,\",\n \"meanWaveDirectionPart3Of6\": \"45.7,\",\n \"meanWaveDirectionPart4Of6\": \"198.6,\",\n \"meanWaveDirectionPart5Of6\": \"44.2,\",\n \"meanWaveDirectionPart6Of6\": \"134.1,\",\n \"meanWaveDirectionalSpreadingPart1Of6\": \"35,\",\n \"meanWaveDirectionalSpreadingPart2Of6\": \"13.45,\",\n \"meanWaveDirectionalSpreadingPart3Of6\": \"14.82,\",\n \"meanWaveDirectionalSpreadingPart4Of6\": \"9.3,\",\n \"meanWaveDirectionalSpreadingPart5Of6\": \"10.32,\",\n \"meanWaveDirectionalSpreadingPart6Of6\": \"12.34,\",\n \"peakPeriodPart1Of6\": \"6.3,\",\n \"peakPeriodPart2Of6\": \"5.2,\",\n \"peakPeriodPart3Of6\": \"5.2,\",\n \"peakPeriodPart4Of6\": \"4.75,\",\n \"peakPeriodPart5Of6\": \"4.89,\",\n \"peakPeriodPart6Of6\": \"5.2,\",\n \"significantWaveHeightPart1Of6\": \"1.72,\",\n \"significantWaveHeightPart2Of6\": \"0.57,\",\n \"significantWaveHeightPart3Of6\": \"0.63,\",\n \"significantWaveHeightPart4Of6\": \"0.16,\",\n \"significantWaveHeightPart5Of6\": \"0.12,\",\n \"significantWaveHeightPart6Of6\": 0.11\n },\n \"2024-05-15T17:00:00Z\": {\n \"meanWaveDirectionPart1Of6\": \"115,\",\n \"meanWaveDirectionPart2Of6\": \"41.8,\",\n \"meanWaveDirectionPart3Of6\": \"41.4,\",\n \"meanWaveDirectionPart4Of6\": \"36.6,\",\n \"meanWaveDirectionPart5Of6\": \"190,\",\n \"meanWaveDirectionPart6Of6\": \"130.1,\",\n \"meanWaveDirectionalSpreadingPart1Of6\": \"29.2,\",\n \"meanWaveDirectionalSpreadingPart2Of6\": \"13.4,\",\n \"meanWaveDirectionalSpreadingPart3Of6\": \"13.3,\",\n \"meanWaveDirectionalSpreadingPart4Of6\": \"12.13,\",\n \"meanWaveDirectionalSpreadingPart5Of6\": \"0,\",\n \"meanWaveDirectionalSpreadingPart6Of6\": \"12.11,\",\n \"peakPeriodPart1Of6\": \"6.3,\",\n \"peakPeriodPart2Of6\": \"5.2,\",\n \"peakPeriodPart3Of6\": \"5.2,\",\n \"peakPeriodPart4Of6\": \"6.3,\",\n \"peakPeriodPart5Of6\": \"4.75,\",\n \"peakPeriodPart6Of6\": \"4.1,\",\n \"significantWaveHeightPart1Of6\": \"1.65,\",\n \"significantWaveHeightPart2Of6\": \"0.58,\",\n \"significantWaveHeightPart3Of6\": \"0.59,\",\n \"significantWaveHeightPart4Of6\": \"0.34,\",\n \"significantWaveHeightPart5Of6\": \"0.08,\",\n \"significantWaveHeightPart6Of6\": 0.15\n },\n \"2024-05-15T18:00:00Z\": {\n \"meanWaveDirectionPart1Of6\": \"107.2,\",\n \"meanWaveDirectionPart2Of6\": \"63.55,\",\n \"meanWaveDirectionPart3Of6\": \"40.65,\",\n \"meanWaveDirectionPart4Of6\": \"35.9,\",\n \"meanWaveDirectionPart5Of6\": \"108.1,\",\n \"meanWaveDirectionPart6Of6\": \"77.1,\",\n \"meanWaveDirectionalSpreadingPart1Of6\": \"35.1,\",\n \"meanWaveDirectionalSpreadingPart2Of6\": \"15.16,\",\n \"meanWaveDirectionalSpreadingPart3Of6\": \"13.56,\",\n \"meanWaveDirectionalSpreadingPart4Of6\": \"12.4,\",\n \"meanWaveDirectionalSpreadingPart5Of6\": \"12.1,\",\n \"meanWaveDirectionalSpreadingPart6Of6\": \"13.9,\",\n \"peakPeriodPart1Of6\": \"6.3,\",\n \"peakPeriodPart2Of6\": \"5.5,\",\n \"peakPeriodPart3Of6\": \"5.2,\",\n \"peakPeriodPart4Of6\": \"6.3,\",\n \"peakPeriodPart5Of6\": \"5.2,\",\n \"peakPeriodPart6Of6\": \"5.9,\",\n \"significantWaveHeightPart1Of6\": \"1.79,\",\n \"significantWaveHeightPart2Of6\": \"0.83,\",\n \"significantWaveHeightPart3Of6\": \"0.6,\",\n \"significantWaveHeightPart4Of6\": \"0.33,\",\n \"significantWaveHeightPart5Of6\": \"0.78,\",\n \"significantWaveHeightPart6Of6\": 1.55\n }\n }\n }\n ]\n}\nheaders = {\n \"content-type\": \"application/json\",\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n}\n\nresponse = requests.request(\"GET\", url, json=payload, headers=headers)\n\nprint(response.text)"
- lang: Ruby + Native
source: 'require ''uri''
require ''net/http''
require ''openssl''
url = URI("https://weather.api.dtn.com/v1/conditions/marine/wave-partitions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["content-type"] = ''application/json''
request["Accept-Encoding"] = ''SOME_STRING_VALUE''
request["Accept"] = ''SOME_STRING_VALUE''
request["Authorization"] = ''Bearer REPLACE_BEARER_TOKEN''
request.body = "{\"url\":\"https://weather.api.dtn.com/v1/conditions/marine/wave-partitions?lat=55.81&lon=3.88¶meters=meanWaveDirectionPart1Of6,meanWaveDirectionPart2Of6,meanWaveDirectionPart3Of6,meanWaveDirectionPart4Of6,meanWaveDirectionPart5Of6,meanWaveDirectionPart6Of6,meanWaveDirectionalSpreadingPart1Of6,meanWaveDirectionalSpreadingPart2Of6,meanWaveDirectionalSpreadingPart3Of6,meanWaveDirectionalSpreadingPart4Of6,meanWaveDirectionalSpreadingPart5Of6,meanWaveDirectionalSpreadingPart6Of6,peakPeriodPart1Of6,peakPeriodPart2Of6,peakPeriodPart3Of6,peakPeriodPart4Of6,peakPeriodPart5Of6,peakPeriodPart6Of6,significantWaveHeightPart1Of6,significantWaveHeightPart2Of6,significantWaveHeightPart3Of6,significantWaveHeightPart4Of6,significantWaveHeightPart5Of6,significantWaveHeightPart6Of6&startTime=2024-05-15T16:13:53Z&endTime=2024-05-15T18:13:53Z\",\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[3.88,55.81]},\"properties\":{\"2024-05-15T16:00:00Z\":{\"meanWaveDirectionPart1Of6\":\"108.3,\",\"meanWaveDirectionPart2Of6\":\"42.5,\",\"meanWaveDirectionPart3Of6\":\"45.7,\",\"meanWaveDirectionPart4Of6\":\"198.6,\",\"meanWaveDirectionPart5Of6\":\"44.2,\",\"meanWaveDirectionPart6Of6\":\"134.1,\",\"meanWaveDirectionalSpreadingPart1Of6\":\"35,\",\"meanWaveDirectionalSpreadingPart2Of6\":\"13.45,\",\"meanWaveDirectionalSpreadingPart3Of6\":\"14.82,\",\"meanWaveDirectionalSpreadingPart4Of6\":\"9.3,\",\"meanWaveDirectionalSpreadingPart5Of6\":\"10.32,\",\"meanWaveDirectionalSpreadingPart6Of6\":\"12.34,\",\"peakPeriodPart1Of6\":\"6.3,\",\"peakPeriodPart2Of6\":\"5.2,\",\"peakPeriodPart3Of6\":\"5.2,\",\"peakPeriodPart4Of6\":\"4.75,\",\"peakPeriodPart5Of6\":\"4.89,\",\"peakPeriodPart6Of6\":\"5.2,\",\"significantWaveHeightPart1Of6\":\"1.72,\",\"significantWaveHeightPart2Of6\":\"0.57,\",\"significantWaveHeightPart3Of6\":\"0.63,\",\"significantWaveHeightPart4Of6\":\"0.16,\",\"significantWaveHeightPart5Of6\":\"0.12,\",\"significantWaveHeightPart6Of6\":0.11},\"2024-05-15T17:00:00Z\":{\"meanWaveDirectionPart1Of6\":\"115,\",\"meanWaveDirectionPart2Of6\":\"41.8,\",\"meanWaveDirectionPart3Of6\":\"41.4,\",\"meanWaveDirectionPart4Of6\":\"36.6,\",\"meanWaveDirectionPart5Of6\":\"190,\",\"meanWaveDirectionPart6Of6\":\"130.1,\",\"meanWaveDirectionalSpreadingPart1Of6\":\"29.2,\",\"meanWaveDirectionalSpreadingPart2Of6\":\"13.4,\",\"meanWaveDirectionalSpreadingPart3Of6\":\"13.3,\",\"meanWaveDirectionalSpreadingPart4Of6\":\"12.13,\",\"meanWaveDirectionalSpreadingPart5Of6\":\"0,\",\"meanWaveDirectionalSpreadingPart6Of6\":\"12.11,\",\"peakPeriodPart1Of6\":\"6.3,\",\"peakPeriodPart2Of6\":\"5.2,\",\"peakPeriodPart3Of6\":\"5.2,\",\"peakPeriodPart4Of6\":\"6.3,\",\"peakPeriodPart5Of6\":\"4.75,\",\"peakPeriodPart6Of6\":\"4.1,\",\"significantWaveHeightPart1Of6\":\"1.65,\",\"significantWaveHeightPart2Of6\":\"0.58,\",\"significantWaveHeightPart3Of6\":\"0.59,\",\"significantWaveHeightPart4Of6\":\"0.34,\",\"significantWaveHeightPart5Of6\":\"0.08,\",\"significantWaveHeightPart6Of6\":0.15},\"2024-05-15T18:00:00Z\":{\"meanWaveDirectionPart1Of6\":\"107.2,\",\"meanWaveDirectionPart2Of6\":\"63.55,\",\"meanWaveDirectionPart3Of6\":\"40.65,\",\"meanWaveDirectionPart4Of6\":\"35.9,\",\"meanWaveDirectionPart5Of6\":\"108.1,\",\"meanWaveDirectionPart6Of6\":\"77.1,\",\"meanWaveDirectionalSpreadingPart1Of6\":\"35.1,\",\"meanWaveDirectionalSpreadingPart2Of6\":\"15.16,\",\"meanWaveDirectionalSpreadingPart3Of6\":\"13.56,\",\"meanWaveDirectionalSpreadingPart4Of6\":\"12.4,\",\"meanWaveDirectionalSpreadingPart5Of6\":\"12.1,\",\"meanWaveDirectionalSpreadingPart6Of6\":\"13.9,\",\"peakPeriodPart1Of6\":\"6.3,\",\"peakPeriodPart2Of6\":\"5.5,\",\"peakPeriodPart3Of6\":\"5.2,\",\"peakPeriodPart4Of6\":\"6.3,\",\"peakPeriodPart5Of6\":\"5.2,\",\"peakPeriodPart6Of6\":\"5.9,\",\"significantWaveHeightPart1Of6\":\"1.79,\",\"significantWaveHeightPart2Of6\":\"0.83,\",\"significantWaveHeightPart3Of6\":\"0.6,\",\"significantWaveHeightPart4Of6\":\"0.33,\",\"significantWaveHeightPart5Of6\":\"0.78,\",\"significantWaveHeightPart6Of6\":1.55}}}]}"
response = http.request(request)
puts response.read_body'
- lang: Shell + Curl
source: "curl --request GET \\\n --url https://weather.api.dtn.com/v1/conditions/marine/wave-partitions \\\n --header 'Accept: SOME_STRING_VALUE' \\\n --header 'Accept-Encoding: SOME_STRING_VALUE' \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \\\n --header 'content-type: application/json' \\\n --data '{\"url\":\"https://weather.api.dtn.com/v1/conditions/marine/wave-partitions?lat=55.81&lon=3.88¶meters=meanWaveDirectionPart1Of6,meanWaveDirectionPart2Of6,meanWaveDirectionPart3Of6,meanWaveDirectionPart4Of6,meanWaveDirectionPart5Of6,meanWaveDirectionPart6Of6,meanWaveDirectionalSpreadingPart1Of6,meanWaveDirectionalSpreadingPart2Of6,meanWaveDirectionalSpreadingPart3Of6,meanWaveDirectionalSpreadingPart4Of6,meanWaveDirectionalSpreadingPart5Of6,meanWaveDirectionalSpreadingPart6Of6,peakPeriodPart1Of6,peakPeriodPart2Of6,peakPeriodPart3Of6,peakPeriodPart4Of6,peakPeriodPart5Of6,peakPeriodPart6Of6,significantWaveHeightPart1Of6,significantWaveHeightPart2Of6,significantWaveHeightPart3Of6,significantWaveHeightPart4Of6,significantWaveHeightPart5Of6,significantWaveHeightPart6Of6&startTime=2024-05-15T16:13:53Z&endTime=2024-05-15T18:13:53Z\",\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[3.88,55.81]},\"properties\":{\"2024-05-15T16:00:00Z\":{\"meanWaveDirectionPart1Of6\":\"108.3,\",\"meanWaveDirectionPart2Of6\":\"42.5,\",\"meanWaveDirectionPart3Of6\":\"45.7,\",\"meanWaveDirectionPart4Of6\":\"198.6,\",\"meanWaveDirectionPart5Of6\":\"44.2,\",\"meanWaveDirectionPart6Of6\":\"134.1,\",\"meanWaveDirectionalSpreadingPart1Of6\":\"35,\",\"meanWaveDirectionalSpreadingPart2Of6\":\"13.45,\",\"meanWaveDirectionalSpreadingPart3Of6\":\"14.82,\",\"meanWaveDirectionalSpreadingPart4Of6\":\"9.3,\",\"meanWaveDirectionalSpreadingPart5Of6\":\"10.32,\",\"meanWaveDirectionalSpreadingPart6Of6\":\"12.34,\",\"peakPeriodPart1Of6\":\"6.3,\",\"peakPeriodPart2Of6\":\"5.2,\",\"peakPeriodPart3Of6\":\"5.2,\",\"peakPeriodPart4Of6\":\"4.75,\",\"peakPeriodPart5Of6\":\"4.89,\",\"peakPeriodPart6Of6\":\"5.2,\",\"significantWaveHeightPart1Of6\":\"1.72,\",\"significantWaveHeightPart2Of6\":\"0.57,\",\"significantWaveHeightPart3Of6\":\"0.63,\",\"significantWaveHeightPart4Of6\":\"0.16,\",\"significantWaveHeightPart5Of6\":\"0.12,\",\"significantWaveHeightPart6Of6\":0.11},\"2024-05-15T17:00:00Z\":{\"meanWaveDirectionPart1Of6\":\"115,\",\"meanWaveDirectionPart2Of6\":\"41.8,\",\"meanWaveDirectionPart3Of6\":\"41.4,\",\"meanWaveDirectionPart4Of6\":\"36.6,\",\"meanWaveDirectionPart5Of6\":\"190,\",\"meanWaveDirectionPart6Of6\":\"130.1,\",\"meanWaveDirectionalSpreadingPart1Of6\":\"29.2,\",\"meanWaveDirectionalSpreadingPart2Of6\":\"13.4,\",\"meanWaveDirectionalSpreadingPart3Of6\":\"13.3,\",\"meanWaveDirectionalSpreadingPart4Of6\":\"12.13,\",\"meanWaveDirectionalSpreadingPart5Of6\":\"0,\",\"meanWaveDirectionalSpreadingPart6Of6\":\"12.11,\",\"peakPeriodPart1Of6\":\"6.3,\",\"peakPeriodPart2Of6\":\"5.2,\",\"peakPeriodPart3Of6\":\"5.2,\",\"peakPeriodPart4Of6\":\"6.3,\",\"peakPeriodPart5Of6\":\"4.75,\",\"peakPeriodPart6Of6\":\"4.1,\",\"significantWaveHeightPart1Of6\":\"1.65,\",\"significantWaveHeightPart2Of6\":\"0.58,\",\"significantWaveHeightPart3Of6\":\"0.59,\",\"significantWaveHeightPart4Of6\":\"0.34,\",\"significantWaveHeightPart5Of6\":\"0.08,\",\"significantWaveHeightPart6Of6\":0.15},\"2024-05-15T18:00:00Z\":{\"meanWaveDirectionPart1Of6\":\"107.2,\",\"meanWaveDirectionPart2Of6\":\"63.55,\",\"meanWaveDirectionPart3Of6\":\"40.65,\",\"meanWaveDirectionPart4Of6\":\"35.9,\",\"meanWaveDirectionPart5Of6\":\"108.1,\",\"meanWaveDirectionPart6Of6\":\"77.1,\",\"meanWaveDirectionalSpreadingPart1Of6\":\"35.1,\",\"meanWaveDirectionalSpreadingPart2Of6\":\"15.16,\",\"meanWaveDirectionalSpreadingPart3Of6\":\"13.56,\",\"meanWaveDirectionalSpreadingPart4Of6\":\"12.4,\",\"meanWaveDirectionalSpreadingPart5Of6\":\"12.1,\",\"meanWaveDirectionalSpreadingPart6Of6\":\"13.9,\",\"peakPeriodPart1Of6\":\"6.3,\",\"peakPeriodPart2Of6\":\"5.5,\",\"peakPeriodPart3Of6\":\"5.2,\",\"peakPeriodPart4Of6\":\"6.3,\",\"peakPeriodPart5Of6\":\"5.2,\",\"peakPeriodPart6Of6\":\"5.9,\",\"significantWaveHeightPart1Of6\":\"1.79,\",\"significantWaveHeightPart2Of6\":\"0.83,\",\"significantWaveHeightPart3Of6\":\"0.6,\",\"significantWaveHeightPart4Of6\":\"0.33,\",\"significantWaveHeightPart5Of6\":\"0.78,\",\"significantWaveHeightPart6Of6\":1.55}}}]}'"
- lang: Shell + Httpie
source: "echo '{\"url\":\"https://weather.api.dtn.com/v1/conditions/marine/wave-partitions?lat=55.81&lon=3.88¶meters=meanWaveDirectionPart1Of6,meanWaveDirectionPart2Of6,meanWaveDirectionPart3Of6,meanWaveDirectionPart4Of6,meanWaveDirectionPart5Of6,meanWaveDirectionPart6Of6,meanWaveDirectionalSpreadingPart1Of6,meanWaveDirectionalSpreadingPart2Of6,meanWaveDirectionalSpreadingPart3Of6,meanWaveDirectionalSpreadingPart4Of6,meanWaveDirectionalSpreadingPart5Of6,meanWaveDirectionalSpreadingPart6Of6,peakPeriodPart1Of6,peakPeriodPart2Of6,peakPeriodPart3Of6,peakPeriodPart4Of6,peakPeriodPart5Of6,peakPeriodPart6Of6,significantWaveHeightPart1Of6,significantWaveHeightPart2Of6,significantWaveHeightPart3Of6,significantWaveHeightPart4Of6,significantWaveHeightPart5Of6,significantWaveHeightPart6Of6&startTime=2024-05-15T16:13:53Z&endTime=2024-05-15T18:13:53Z\",\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[3.88,55.81]},\"properties\":{\"2024-05-15T16:00:00Z\":{\"meanWaveDirectionPart1Of6\":\"108.3,\",\"meanWaveDirectionPart2Of6\":\"42.5,\",\"meanWaveDirectionPart3Of6\":\"45.7,\",\"meanWaveDirectionPart4Of6\":\"198.6,\",\"meanWaveDirectionPart5Of6\":\"44.2,\",\"meanWaveDirectionPart6Of6\":\"134.1,\",\"meanWaveDirectionalSpreadingPart1Of6\":\"35,\",\"meanWaveDirectionalSpreadingPart2Of6\":\"13.45,\",\"meanWaveDirectionalSpreadingPart3Of6\":\"14.82,\",\"meanWaveDirectionalSpreadingPart4Of6\":\"9.3,\",\"meanWaveDirectionalSpreadingPart5Of6\":\"10.32,\",\"meanWaveDirectionalSpreadingPart6Of6\":\"12.34,\",\"peakPeriodPart1Of6\":\"6.3,\",\"peakPeriodPart2Of6\":\"5.2,\",\"peakPeriodPart3Of6\":\"5.2,\",\"peakPeriodPart4Of6\":\"4.75,\",\"peakPeriodPart5Of6\":\"4.89,\",\"peakPeriodPart6Of6\":\"5.2,\",\"significantWaveHeightPart1Of6\":\"1.72,\",\"significantWaveHeightPart2Of6\":\"0.57,\",\"significantWaveHeightPart3Of6\":\"0.63,\",\"significantWaveHeightPart4Of6\":\"0.16,\",\"significantWaveHeightPart5Of6\":\"0.12,\",\"significantWaveHeightPart6Of6\":0.11},\"2024-05-15T17:00:00Z\":{\"meanWaveDirectionPart1Of6\":\"115,\",\"meanWaveDirectionPart2Of6\":\"41.8,\",\"meanWaveDirectionPart3Of6\":\"41.4,\",\"meanWaveDirectionPart4Of6\":\"36.6,\",\"meanWaveDirectionPart5Of6\":\"190,\",\"meanWaveDirectionPart6Of6\":\"130.1,\",\"meanWaveDirectionalSpreadingPart1Of6\":\"29.2,\",\"meanWaveDirectionalSpreadingPart2Of6\":\"13.4,\",\"meanWaveDirectionalSpreadingPart3Of6\":\"13.3,\",\"meanWaveDirectionalSpreadingPart4Of6\":\"12.13,\",\"meanWaveDirectionalSpreadingPart5Of6\":\"0,\",\"meanWaveDirectionalSpreadingPart6Of6\":\"12.11,\",\"peakPeriodPart1Of6\":\"6.3,\",\"peakPeriodPart2Of6\":\"5.2,\",\"peakPeriodPart3Of6\":\"5.2,\",\"peakPeriodPart4Of6\":\"6.3,\",\"peakPeriodPart5Of6\":\"4.75,\",\"peakPeriodPart6Of6\":\"4.1,\",\"significantWaveHeightPart1Of6\":\"1.65,\",\"significantWaveHeightPart2Of6\":\"0.58,\",\"significantWaveHeightPart3Of6\":\"0.59,\",\"significantWaveHeightPart4Of6\":\"0.34,\",\"significantWaveHeightPart5Of6\":\"0.08,\",\"significantWaveHeightPart6Of6\":0.15},\"2024-05-15T18:00:00Z\":{\"meanWaveDirectionPart1Of6\":\"107.2,\",\"meanWaveDirectionPart2Of6\":\"63.55,\",\"meanWaveDirectionPart3Of6\":\"40.65,\",\"meanWaveDirectionPart4Of6\":\"35.9,\",\"meanWaveDirectionPart5Of6\":\"108.1,\",\"meanWaveDirectionPart6Of6\":\"77.1,\",\"meanWaveDirectionalSpreadingPart1Of6\":\"35.1,\",\"meanWaveDirectionalSpreadingPart2Of6\":\"15.16,\",\"meanWaveDirectionalSpreadingPart3Of6\":\"13.56,\",\"meanWaveDirectionalSpreadingPart4Of6\":\"12.4,\",\"meanWaveDirectionalSpreadingPart5Of6\":\"12.1,\",\"meanWaveDirectionalSpreadingPart6Of6\":\"13.9,\",\"peakPeriodPart1Of6\":\"6.3,\",\"peakPeriodPart2Of6\":\"5.5,\",\"peakPeriodPart3Of6\":\"5.2,\",\"peakPeriodPart4Of6\":\"6.3,\",\"peakPeriodPart5Of6\":\"5.2,\",\"peakPeriodPart6Of6\":\"5.9,\",\"significantWaveHeightPart1Of6\":\"1.79,\",\"significantWaveHeightPart2Of6\":\"0.83,\",\"significantWaveHeightPart3Of6\":\"0.6,\",\"significantWaveHeightPart4Of6\":\"0.33,\",\"significantWaveHeightPart5Of6\":\"0.78,\",\"significantWaveHeightPart6Of6\":1.55}}}]}' | \\\n http GET https://weather.api.dtn.com/v1/conditions/marine/wave-partitions \\\n Accept:SOME_STRING_VALUE \\\n Accept-Encoding:SOME_STRING_VALUE \\\n Authorization:'Bearer REPLACE_BEARER_TOKEN' \\\n content-type:application/json"
- lang: Shell + Wget
source: "wget --quiet \\\n --method GET \\\n --header 'content-type: application/json' \\\n --header 'Accept-Encoding: SOME_STRING_VALUE' \\\n --header 'Accept: SOME_STRING_VALUE' \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \\\n --body-data '{\"url\":\"https://weather.api.dtn.com/v1/conditions/marine/wave-partitions?lat=55.81&lon=3.88¶meters=meanWaveDirectionPart1Of6,meanWaveDirectionPart2Of6,meanWaveDirectionPart3Of6,meanWaveDirectionPart4Of6,meanWaveDirectionPart5Of6,meanWaveDirectionPart6Of6,meanWaveDirectionalSpreadingPart1Of6,meanWaveDirectionalSpreadingPart2Of6,meanWaveDirectionalSpreadingPart3Of6,meanWaveDirectionalSpreadingPart4Of6,meanWaveDirectionalSpreadingPart5Of6,meanWaveDirectionalSpreadingPart6Of6,peakPeriodPart1Of6,peakPeriodPart2Of6,peakPeriodPart3Of6,peakPeriodPart4Of6,peakPeriodPart5Of6,peakPeriodPart6Of6,significantWaveHeightPart1Of6,significantWaveHeightPart2Of6,significantWaveHeightPart3Of6,significantWaveHeightPart4Of6,significantWaveHeightPart5Of6,significantWaveHeightPart6Of6&startTime=2024-05-15T16:13:53Z&endTime=2024-05-15T18:13:53Z\",\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[3.88,55.81]},\"properties\":{\"2024-05-15T16:00:00Z\":{\"meanWaveDirectionPart1Of6\":\"108.3,\",\"meanWaveDirectionPart2Of6\":\"42.5,\",\"meanWaveDirectionPart3Of6\":\"45.7,\",\"meanWaveDirectionPart4Of6\":\"198.6,\",\"meanWaveDirectionPart5Of6\":\"44.2,\",\"meanWaveDirectionPart6Of6\":\"134.1,\",\"meanWaveDirectionalSpreadingPart1Of6\":\"35,\",\"meanWaveDirectionalSpreadingPart2Of6\":\"13.45,\",\"meanWaveDirectionalSpreadingPart3Of6\":\"14.82,\",\"meanWaveDirectionalSpreadingPart4Of6\":\"9.3,\",\"meanWaveDirectionalSpreadingPart5Of6\":\"10.32,\",\"meanWaveDirectionalSpreadingPart6Of6\":\"12.34,\",\"peakPeriodPart1Of6\":\"6.3,\",\"peakPeriodPart2Of6\":\"5.2,\",\"peakPeriodPart3Of6\":\"5.2,\",\"peakPeriodPart4Of6\":\"4.75,\",\"peakPeriodPart5Of6\":\"4.89,\",\"peakPeriodPart6Of6\":\"5.2,\",\"significantWaveHeightPart1Of6\":\"1.72,\",\"significantWaveHeightPart2Of6\":\"0.57,\",\"significantWaveHeightPart3Of6\":\"0.63,\",\"significantWaveHeightPart4Of6\":\"0.16,\",\"significantWaveHeightPart5Of6\":\"0.12,\",\"significantWaveHeightPart6Of6\":0.11},\"2024-05-15T17:00:00Z\":{\"meanWaveDirectionPart1Of6\":\"115,\",\"meanWaveDirectionPart2Of6\":\"41.8,\",\"meanWaveDirectionPart3Of6\":\"41.4,\",\"meanWaveDirectionPart4Of6\":\"36.6,\",\"meanWaveDirectionPart5Of6\":\"190,\",\"meanWaveDirectionPart6Of6\":\"130.1,\",\"meanWaveDirectionalSpreadingPart1Of6\":\"29.2,\",\"meanWaveDirectionalSpreadingPart2Of6\":\"13.4,\",\"meanWaveDirectionalSpreadingPart3Of6\":\"13.3,\",\"meanWaveDirectionalSpreadingPart4Of6\":\"12.13,\",\"meanWaveDirectionalSpreadingPart5Of6\":\"0,\",\"meanWaveDirectionalSpreadingPart6Of6\":\"12.11,\",\"peakPeriodPart1Of6\":\"6.3,\",\"peakPeriodPart2Of6\":\"5.2,\",\"peakPeriodPart3Of6\":\"5.2,\",\"peakPeriodPart4Of6\":\"6.3,\",\"peakPeriodPart5Of6\":\"4.75,\",\"peakPeriodPart6Of6\":\"4.1,\",\"significantWaveHeightPart1Of6\":\"1.65,\",\"significantWaveHeightPart2Of6\":\"0.58,\",\"significantWaveHeightPart3Of6\":\"0.59,\",\"significantWaveHeightPart4Of6\":\"0.34,\",\"significantWaveHeightPart5Of6\":\"0.08,\",\"significantWaveHeightPart6Of6\":0.15},\"2024-05-15T18:00:00Z\":{\"meanWaveDirectionPart1Of6\":\"107.2,\",\"meanWaveDirectionPart2Of6\":\"63.55,\",\"meanWaveDirectionPart3Of6\":\"40.65,\",\"meanWaveDirectionPart4Of6\":\"35.9,\",\"meanWaveDirectionPart5Of6\":\"108.1,\",\"meanWaveDirectionPart6Of6\":\"77.1,\",\"meanWaveDirectionalSpreadingPart1Of6\":\"35.1,\",\"meanWaveDirectionalSpreadingPart2Of6\":\"15.16,\",\"meanWaveDirectionalSpreadingPart3Of6\":\"13.56,\",\"meanWaveDirectionalSpreadingPart4Of6\":\"12.4,\",\"meanWaveDirectionalSpreadingPart5Of6\":\"12.1,\",\"meanWaveDirectionalSpreadingPart6Of6\":\"13.9,\",\"peakPeriodPart1Of6\":\"6.3,\",\"peakPeriodPart2Of6\":\"5.5,\",\"peakPeriodPart3Of6\":\"5.2,\",\"peakPeriodPart4Of6\":\"6.3,\",\"peakPeriodPart5Of6\":\"5.2,\",\"peakPeriodPart6Of6\":\"5.9,\",\"significantWaveHeightPart1Of6\":\"1.79,\",\"significantWaveHeightPart2Of6\":\"0.83,\",\"significantWaveHeightPart3Of6\":\"0.6,\",\"significantWaveHeightPart4Of6\":\"0.33,\",\"significantWaveHeightPart5Of6\":\"0.78,\",\"significantWaveHeightPart6Of6\":1.55}}}]}' \\\n --output-document \\\n - https://weather.api.dtn.com/v1/conditions/marine/wave-partitions"
- lang: Swift + Nsurlsession
source: "import Foundation\n\nlet headers = [\n \"content-type\": \"application/json\",\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n]\nlet parameters = [\n \"url\": \"https://weather.api.dtn.com/v1/conditions/marine/wave-partitions?lat=55.81&lon=3.88¶meters=meanWaveDirectionPart1Of6,meanWaveDirectionPart2Of6,meanWaveDirectionPart3Of6,meanWaveDirectionPart4Of6,meanWaveDirectionPart5Of6,meanWaveDirectionPart6Of6,meanWaveDirectionalSpreadingPart1Of6,meanWaveDirectionalSpreadingPart2Of6,meanWaveDirectionalSpreadingPart3Of6,meanWaveDirectionalSpreadingPart4Of6,meanWaveDirectionalSpreadingPart5Of6,meanWaveDirectionalSpreadingPart6Of6,peakPeriodPart1Of6,peakPeriodPart2Of6,peakPeriodPart3Of6,peakPeriodPart4Of6,peakPeriodPart5Of6,peakPeriodPart6Of6,significantWaveHeightPart1Of6,significantWaveHeightPart2Of6,significantWaveHeightPart3Of6,significantWaveHeightPart4Of6,significantWaveHeightPart5Of6,significantWaveHeightPart6Of6&startTime=2024-05-15T16:13:53Z&endTime=2024-05-15T18:13:53Z\",\n \"type\": \"FeatureCollection\",\n \"features\": [\n [\n \"type\": \"Feature\",\n \"geometry\": [\n \"type\": \"Point\",\n \"coordinates\": [3.88, 55.81]\n ],\n \"properties\": [\n \"2024-05-15T16:00:00Z\": [\n \"meanWaveDirectionPart1Of6\": \"108.3,\",\n \"meanWaveDirectionPart2Of6\": \"42.5,\",\n \"meanWaveDirectionPart3Of6\": \"45.7,\",\n \"meanWaveDirectionPart4Of6\": \"198.6,\",\n \"meanWaveDirectionPart5Of6\": \"44.2,\",\n \"meanWaveDirectionPart6Of6\": \"134.1,\",\n \"meanWaveDirectionalSpreadingPart1Of6\": \"35,\",\n \"meanWaveDirectionalSpreadingPart2Of6\": \"13.45,\",\n \"meanWaveDirectionalSpreadingPart3Of6\": \"14.82,\",\n \"meanWaveDirectionalSpreadingPart4Of6\": \"9.3,\",\n \"meanWaveDirectionalSpreadingPart5Of6\": \"10.32,\",\n \"meanWaveDirectionalSpreadingPart6Of6\": \"12.34,\",\n \"peakPeriodPart1Of6\": \"6.3,\",\n \"peakPeriodPart2Of6\": \"5.2,\",\n \"peakPeriodPart3Of6\": \"5.2,\",\n \"peakPeriodPart4Of6\": \"4.75,\",\n \"peakPeriodPart5Of6\": \"4.89,\",\n \"peakPeriodPart6Of6\": \"5.2,\",\n \"significantWaveHeightPart1Of6\": \"1.72,\",\n \"significantWaveHeightPart2Of6\": \"0.57,\",\n \"significantWaveHeightPart3Of6\": \"0.63,\",\n \"significantWaveHeightPart4Of6\": \"0.16,\",\n \"significantWaveHeightPart5Of6\": \"0.12,\",\n \"significantWaveHeightPart6Of6\": 0.11\n ],\n \"2024-05-15T17:00:00Z\": [\n \"meanWaveDirectionPart1Of6\": \"115,\",\n \"meanWaveDirectionPart2Of6\": \"41.8,\",\n \"meanWaveDirectionPart3Of6\": \"41.4,\",\n \"meanWaveDirectionPart4Of6\": \"36.6,\",\n \"meanWaveDirectionPart5Of6\": \"190,\",\n \"meanWaveDirectionPart6Of6\": \"130.1,\",\n \"meanWaveDirectionalSpreadingPart1Of6\": \"29.2,\",\n \"meanWaveDirectionalSpreadingPart2Of6\": \"13.4,\",\n \"meanWaveDirectionalSpreadingPart3Of6\": \"13.3,\",\n \"meanWaveDirectionalSpreadingPart4Of6\": \"12.13,\",\n \"meanWaveDirectionalSpreadingPart5Of6\": \"0,\",\n \"meanWaveDirectionalSpreadingPart6Of6\": \"12.11,\",\n \"peakPeriodPart1Of6\": \"6.3,\",\n \"peakPeriodPart2Of6\": \"5.2,\",\n \"peakPeriodPart3Of6\": \"5.2,\",\n \"peakPeriodPart4Of6\": \"6.3,\",\n \"peakPeriodPart5Of6\": \"4.75,\",\n \"peakPeriodPart6Of6\": \"4.1,\",\n \"significantWaveHeightPart1Of6\": \"1.65,\",\n \"significantWaveHeightPart2Of6\": \"0.58,\",\n \"significantWaveHeightPart3Of6\": \"0.59,\",\n \"significantWaveHeightPart4Of6\": \"0.34,\",\n \"significantWaveHeightPart5Of6\": \"0.08,\",\n \"significantWaveHeightPart6Of6\": 0.15\n ],\n \"2024-05-15T18:00:00Z\": [\n \"meanWaveDirectionPart1Of6\": \"107.2,\",\n \"meanWaveDirectionPart2Of6\": \"63.55,\",\n \"meanWaveDirectionPart3Of6\": \"40.65,\",\n \"meanWaveDirectionPart4Of6\": \"35.9,\",\n \"meanWaveDirectionPart5Of6\": \"108.1,\",\n \"meanWaveDirectionPart6Of6\": \"77.1,\",\n \"meanWaveDirectionalSpreadingPart1Of6\": \"35.1,\",\n \"meanWaveDirectionalSpreadingPart2Of6\": \"15.16,\",\n \"meanWaveDirectionalSpreadingPart3Of6\": \"13.56,\",\n \"meanWaveDirectionalSpreadingPart4Of6\": \"12.4,\",\n \"meanWaveDirectionalSpreadingPart5Of6\": \"12.1,\",\n \"meanWaveDirectionalSpreadingPart6Of6\": \"13.9,\",\n \"peakPeriodPart1Of6\": \"6.3,\",\n \"peakPeriodPart2Of6\": \"5.5,\",\n \"peakPeriodPart3Of6\": \"5.2,\",\n \"peakPeriodPart4Of6\": \"6.3,\",\n \"peakPeriodPart5Of6\": \"5.2,\",\n \"peakPeriodPart6Of6\": \"5.9,\",\n \"significantWaveHeightPart1Of6\": \"1.79,\",\n \"significantWaveHeightPart2Of6\": \"0.83,\",\n \"significantWaveHeightPart3Of6\": \"0.6,\",\n \"significantWaveHeightPart4Of6\": \"0.33,\",\n \"significantWaveHeightPart5Of6\": \"0.78,\",\n \"significantWaveHeightPart6Of6\": 1.55\n ]\n ]\n ]\n ]\n] as [String : Any]\n\nlet postData = JSONSerialization.data(withJSONObject: parameters, options: [])\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://weather.api.dtn.com/v1/conditions/marine/wave-partitions\")! as URL,\n cachePolicy: .useProtocolCachePolicy,\n timeoutInterval: 10.0)\nrequest.httpMethod = \"GET\"\nrequest.allHTTPHeaderFields = headers\nrequest.httpBody = postData as Data\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n if (error != nil) {\n print(error)\n } else {\n let httpResponse = response as? HTTPURLResponse\n print(httpResponse)\n }\n})\n\ndataTask.resume()"
servers:
- url: https://weather.api.dtn.com
/v1/conditions/marine/parameters:
get:
tags:
- Endpoints
summary: Marine Parameters
description: "This endpoint provides helpful context in JSON format about the marine weather parameters and operations that the other endpoints support.\n\nUse query parameters to control the results in the response body:\n * Set `category` to either `hourlyForecast` or `hourlyHistorical` to filter marine parameters by that category.\n * Specify a `name` to filter marine parameters by that name (e.g., `name=airTemp`).\n * Specify a `category` and `name` to filter by both.\n * Omit all query parameters to obtain all marine parameters in the response.\n"
operationId: marineParameters
security:
- clientCredentials: []
parameters:
- in: header
name: Accept-Encoding
schema:
type: string
description: Use this request header to communicate which compression algorithms the client understands. The API supports gzip.
example: gzip
- in: header
name: Accept
schema:
type: string
description: Use this request header to specify an acceptable response media type.
example: application/json
- in: query
name: category
schema:
type: string
description: The desired category filter (optional).
example:
- hourlyForecast
- hourlyHistorical
- in: query
name: name
schema:
type: string
description: The desired parameter name filter (optional).
example:
- airTemp
responses:
'200':
description: A successful request.
content:
application/json:
schema:
type: object
properties:
hourlyForecast:
oneOf:
- type: object
properties:
parameter name:
type: object
description: The name of the parameter.
properties:
metricUnit:
type: string
description: The metric unit used for this parameter.
imperialUnit:
type: string
description: The imperial unit used for this parameter.
description:
type: string
description: A description of what this parameter means.
notes:
type: string
description: Additional information related to this parameter.
example:
airTemp:
metricUnit: Celsius
imperialUnit: ''
type: number
description: Air temperature at 2m
notes: As of now we only support metricUnit
hourlyHistorical:
oneOf:
- type: object
properties:
parameter name:
type: object
description: The name of the parameter.
properties:
metricUnit:
type: string
description: The metric unit used for this parameter.
imperialUnit:
type: string
description: The imperial unit used for this parameter.
description:
type: string
description: A description of what this parameter means.
notes:
type: string
description: Additional information related to this parameter.
example:
airTemp:
metricUnit: Celsius
imperialUnit: ''
type: number
description: Air temperature at 2m
notes: As of now we only support metricUnit
'400':
description: An invalid request.
content:
application/problem+json:
schema:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: false
example:
type: bad-request
title: Invalid Request
detail: Validation failed.
status: 400
instance: urn:dtn:one-marine-weather-service:/v1/conditions/marine:requestId:123e4567-e89b-12d3-a458-426614176000
'401':
description: Unable to authenticate credentials.
content:
application/problem+json:
schema:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: false
example:
type: unauthorized
title: Error while authenticating the user.
detail: invalid token
status: 401
instance: urn:dtn:one-marine-weather-service:/v1/conditions/marine:requestId:123e4567-e89b-12d3-a458-426614176000
'406':
description: Unable to produce a response matching the Accept request header.
content:
application/problem+json:
schema:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: false
example:
type: not-acceptable
title: Not Acceptable
detail: The Accept header value is invalid or unsupported.
status: 406
instance: urn:dtn:one-marine-weather-service:/v1/conditions/marine:requestId:123e4567-e89b-12d3-a458-426614176000
x-codeSamples:
- lang: C + Libcurl
source: 'CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://weather.api.dtn.com/v1/conditions/marine/parameters?category=hourlyForecast%2ChourlyHistorical&name=airTemp");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Accept-Encoding: SOME_STRING_VALUE");
headers = curl_slist_append(headers, "Accept: SOME_STRING_VALUE");
headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);'
- lang: Csharp + Restsharp
source: 'var client = new RestClient("https://weather.api.dtn.com/v1/conditions/marine/parameters?category=hourlyForecast%2ChourlyHistorical&name=airTemp");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept-Encoding", "SOME_STRING_VALUE");
request.AddHeader("Accept", "SOME_STRING_VALUE");
request.AddHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
IRestResponse response = client.Execute(request);'
- lang: Go + Native
source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://weather.api.dtn.com/v1/conditions/marine/parameters?category=hourlyForecast%2ChourlyHistorical&name=airTemp\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n\treq.Header.Add(\"Accept\", \"SOME_STRING_VALUE\")\n\treq.Header.Add(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
- lang: Java + Okhttp
source: "OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n .url(\"https://weather.api.dtn.com/v1/conditions/marine/parameters?category=hourlyForecast%2ChourlyHistorical&name=airTemp\")\n .get()\n .addHeader(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n .addHeader(\"Accept\", \"SOME_STRING_VALUE\")\n .addHeader(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n .build();\n\nResponse response = client.newCall(request).execute();"
- lang: Java + Unirest
source: "HttpResponse response = Unirest.get(\"https://weather.api.dtn.com/v1/conditions/marine/parameters?category=hourlyForecast%2ChourlyHistorical&name=airTemp\")\n .header(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n .header(\"Accept\", \"SOME_STRING_VALUE\")\n .header(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n .asString();"
- lang: Javascript + Jquery
source: "const settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://weather.api.dtn.com/v1/conditions/marine/parameters?category=hourlyForecast%2ChourlyHistorical&name=airTemp\",\n \"method\": \"GET\",\n \"headers\": {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\n$.ajax(settings).done(function (response) {\n console.log(response);\n});"
- lang: Javascript + Xhr
source: "const data = null;\n\nconst xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === this.DONE) {\n console.log(this.responseText);\n }\n});\n\nxhr.open(\"GET\", \"https://weather.api.dtn.com/v1/conditions/marine/parameters?category=hourlyForecast%2ChourlyHistorical&name=airTemp\");\nxhr.setRequestHeader(\"Accept-Encoding\", \"SOME_STRING_VALUE\");\nxhr.setRequestHeader(\"Accept\", \"SOME_STRING_VALUE\");\nxhr.setRequestHeader(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\");\n\nxhr.send(data);"
- lang: Javascript + Jquery
source: "const settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://weather.api.dtn.com/v1/conditions/marine/parameters?category=hourlyForecast%2ChourlyHistorical&name=airTemp\",\n \"method\": \"GET\",\n \"headers\": {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\n$.ajax(settings).done(function (response) {\n console.log(response);\n});"
- lang: Node + Native
source: "const http = require(\"https\");\n\nconst options = {\n \"method\": \"GET\",\n \"hostname\": \"weather.api.dtn.com\",\n \"port\": null,\n \"path\": \"/v1/conditions/marine/parameters?category=hourlyForecast%2ChourlyHistorical&name=airTemp\",\n \"headers\": {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\nconst req = http.request(options, function (res) {\n const chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n const body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n});\n\nreq.end();"
- lang: Node + Request
source: "const request = require('request');\n\nconst options = {\n method: 'GET',\n url: 'https://weather.api.dtn.com/v1/conditions/marine/parameters',\n qs: {category: 'hourlyForecast,hourlyHistorical', name: 'airTemp'},\n headers: {\n 'Accept-Encoding': 'SOME_STRING_VALUE',\n Accept: 'SOME_STRING_VALUE',\n Authorization: 'Bearer REPLACE_BEARER_TOKEN'\n }\n};\n\nrequest(options, function (error, response, body) {\n if (error) throw new Error(error);\n\n console.log(body);\n});\n"
- lang: Node + Unirest
source: "const unirest = require(\"unirest\");\n\nconst req = unirest(\"GET\", \"https://weather.api.dtn.com/v1/conditions/marine/parameters\");\n\nreq.query({\n \"category\": \"hourlyForecast,hourlyHistorical\",\n \"name\": \"airTemp\"\n});\n\nreq.headers({\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n});\n\nreq.end(function (res) {\n if (res.error) throw new Error(res.error);\n\n console.log(res.body);\n});\n"
- lang: Objc + Nsurlsession
source: "#import \n\nNSDictionary *headers = @{ @\"Accept-Encoding\": @\"SOME_STRING_VALUE\",\n @\"Accept\": @\"SOME_STRING_VALUE\",\n @\"Authorization\": @\"Bearer REPLACE_BEARER_TOKEN\" };\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://weather.api.dtn.com/v1/conditions/marine/parameters?category=hourlyForecast%2ChourlyHistorical&name=airTemp\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\n[request setHTTPMethod:@\"GET\"];\n[request setAllHTTPHeaderFields:headers];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSLog(@\"%@\", httpResponse);\n }\n }];\n[dataTask resume];"
- lang: Ocaml + Cohttp
source: "open Cohttp_lwt_unix\nopen Cohttp\nopen Lwt\n\nlet uri = Uri.of_string \"https://weather.api.dtn.com/v1/conditions/marine/parameters?category=hourlyForecast%2ChourlyHistorical&name=airTemp\" in\nlet headers = Header.add_list (Header.init ()) [\n (\"Accept-Encoding\", \"SOME_STRING_VALUE\");\n (\"Accept\", \"SOME_STRING_VALUE\");\n (\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\");\n] in\n\nClient.call ~headers `GET uri\n>>= fun (res, body_stream) ->\n (* Do stuff with the result *)"
- lang: Php + Curl
source: " \"https://weather.api.dtn.com/v1/conditions/marine/parameters?category=hourlyForecast%2ChourlyHistorical&name=airTemp\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"GET\",\n CURLOPT_HTTPHEADER => [\n \"Accept: SOME_STRING_VALUE\",\n \"Accept-Encoding: SOME_STRING_VALUE\",\n \"Authorization: Bearer REPLACE_BEARER_TOKEN\"\n ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n echo \"cURL Error #:\" . $err;\n} else {\n echo $response;\n}"
- lang: Php + Http1
source: "setUrl('https://weather.api.dtn.com/v1/conditions/marine/parameters');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setQueryData([\n 'category' => 'hourlyForecast,hourlyHistorical',\n 'name' => 'airTemp'\n]);\n\n$request->setHeaders([\n 'Accept-Encoding' => 'SOME_STRING_VALUE',\n 'Accept' => 'SOME_STRING_VALUE',\n 'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'\n]);\n\ntry {\n $response = $request->send();\n\n echo $response->getBody();\n} catch (HttpException $ex) {\n echo $ex;\n}"
- lang: Php + Http2
source: "setRequestUrl('https://weather.api.dtn.com/v1/conditions/marine/parameters');\n$request->setRequestMethod('GET');\n$request->setQuery(new http\\QueryString([\n 'category' => 'hourlyForecast,hourlyHistorical',\n 'name' => 'airTemp'\n]));\n\n$request->setHeaders([\n 'Accept-Encoding' => 'SOME_STRING_VALUE',\n 'Accept' => 'SOME_STRING_VALUE',\n 'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"
- lang: Python + Python3
source: "import http.client\n\nconn = http.client.HTTPSConnection(\"weather.api.dtn.com\")\n\nheaders = {\n 'Accept-Encoding': \"SOME_STRING_VALUE\",\n 'Accept': \"SOME_STRING_VALUE\",\n 'Authorization': \"Bearer REPLACE_BEARER_TOKEN\"\n }\n\nconn.request(\"GET\", \"/v1/conditions/marine/parameters?category=hourlyForecast%2ChourlyHistorical&name=airTemp\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"
- lang: Python + Requests
source: "import requests\n\nurl = \"https://weather.api.dtn.com/v1/conditions/marine/parameters\"\n\nquerystring = {\"category\":\"hourlyForecast,hourlyHistorical\",\"name\":\"airTemp\"}\n\nheaders = {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\nprint(response.text)"
- lang: Ruby + Native
source: 'require ''uri''
require ''net/http''
require ''openssl''
url = URI("https://weather.api.dtn.com/v1/conditions/marine/parameters?category=hourlyForecast%2ChourlyHistorical&name=airTemp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["Accept-Encoding"] = ''SOME_STRING_VALUE''
request["Accept"] = ''SOME_STRING_VALUE''
request["Authorization"] = ''Bearer REPLACE_BEARER_TOKEN''
response = http.request(request)
puts response.read_body'
- lang: Shell + Curl
source: "curl --request GET \\\n --url 'https://weather.api.dtn.com/v1/conditions/marine/parameters?category=hourlyForecast%2ChourlyHistorical&name=airTemp' \\\n --header 'Accept: SOME_STRING_VALUE' \\\n --header 'Accept-Encoding: SOME_STRING_VALUE' \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'"
- lang: Shell + Httpie
source: "http GET 'https://weather.api.dtn.com/v1/conditions/marine/parameters?category=hourlyForecast%2ChourlyHistorical&name=airTemp' \\\n Accept:SOME_STRING_VALUE \\\n Accept-Encoding:SOME_STRING_VALUE \\\n Authorization:'Bearer REPLACE_BEARER_TOKEN'"
- lang: Shell + Wget
source: "wget --quiet \\\n --method GET \\\n --header 'Accept-Encoding: SOME_STRING_VALUE' \\\n --header 'Accept: SOME_STRING_VALUE' \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \\\n --output-document \\\n - 'https://weather.api.dtn.com/v1/conditions/marine/parameters?category=hourlyForecast%2ChourlyHistorical&name=airTemp'"
- lang: Swift + Nsurlsession
source: "import Foundation\n\nlet headers = [\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n]\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://weather.api.dtn.com/v1/conditions/marine/parameters?category=hourlyForecast%2ChourlyHistorical&name=airTemp\")! as URL,\n cachePolicy: .useProtocolCachePolicy,\n timeoutInterval: 10.0)\nrequest.httpMethod = \"GET\"\nrequest.allHTTPHeaderFields = headers\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n if (error != nil) {\n print(error)\n } else {\n let httpResponse = response as? HTTPURLResponse\n print(httpResponse)\n }\n})\n\ndataTask.resume()"
servers:
- url: https://weather.api.dtn.com
/v1/conditions/marine/spectra:
get:
tags:
- Endpoints
summary: Marine Spectra
description: "This endpoint provides the hourly forecast 2D spectra wave data for a specified location and time range. Spectra 2D wave data represents the distribution of wave energy across various frequencies and directions at specific timestamps. This detailed information is crucial for understanding complex sea states and optimizing operations in offshore and shipping projects.\n\nFor example, it can be used to enhance the stability and safety of offshore platforms or to optimize routing for shipping vessels to avoid severe sea conditions. The response is a CSV file, containing spectral wave data with associated energy values for each frequency and direction.\n\nUse query parameters to control the results in the response body:\n\n * Specify a location as latitude (`lat`) and longitude (`lon`).\n\n * Two important parameters are `startTime` and `endTime`:\n + The API returns forecast data when `startTime` and `endTime` are in the future.\n + The API does not support `startTime` and `endTime` are in the past.\n + The API returns only one exact timestamp when only `startTime` is specified.\n\n * Complete example: `https://weather.api.dtn.com/v1/conditions/marine/spectra?lat={lat}&lon={lon}&startTime={start_time}&endTime={end_time}`\n\n## Response Format\nThe response is a custom CSV describing the distribution of wave energy at different frequencies coming from multiple directions.\n\n\n -34.9 | -8.4 | \n 2024-06-28T19:00:00+00:00 | 2024-06-29T23:00:00+00:00 | \n 35 | 36 |
\n\n\n f | 0.0 | \n 10.0 | 20.0 | \n 30.0 | 40.0 |
\n 0.0345 | 0.0 | \n 0.0 | 0.0 | \n 0.0 | 0.0 |
\n 0.038 | 0.0 | 0.0 | \n 0.0 | 0.0 | 0.0 |
\n 0.0417 | 0.0 | \n 0.0 | 0.0 | \n 0.0 | 0.0 |
\n 0.0459 | 0.0 | 0.0 | \n 0.0 | 0.0 | 0.0 |
\n 0.0505 | 0.0 | \n 0.0 | 0.0 | \n 0.0 | 0.0 |
\n 0.0556 | 0.0 | 0.0 | \n 0.0 | 0.0 | 0.0 |
\n 0.0611 | 0.0002 | \n 0.0 | 0.0 | \n 0.0 | 0.0 |
\n 0.0672 | 0.0006 | 0.0 | \n 0.0 | 0.0 | 0.0 |
\n 0.074 | 0.0014 | \n 0.0001 | 0.0 | \n 0.0 | 0.0 |
\n
\n\n\nThe top row (yellow) provides metadata in this order: latitude, longitude, forecast run time, forecast valid time, number of frequencies, number of directions.\n\nThe second row, starting from the second column (highlighted in blue), shows the direction from which ocean waves originate. Directions are grouped into 10° bins, progressing from 0° (inclusive) to 360° (exclusive). Each bin is centered on its label — for example, 0° represents directions from -5° to +5°.\n\nThe first column starting from the third row (red) represents the different frequencies of the wave motions composing the disturbed sea surface.\n\nThe example (green) below can be read as _\"The energy of the decomposed waves with 0.074 Hz coming from [-5°, +5] is 0.0014 m2s rad-1\"_\n\n\n -34.9 | -8.4 | \n 2024-06-28T19:00:00+00:00 | 2024-06-29T23:00:00+00:00 | \n 35 | 36 |
\n\n\n f | 0.0 | \n 10.0 | 20.0 | \n 30.0 | 40.0 |
\n ... | ... | ... | ... | \n ... | ... |
\n 0.074 | 0.0014 | \n 0.0001 | 0.0 | 0.0 | \n 0.0 |
\n
\n\nThe time series is represented as multiple blocks of this format separated by a new line.\n"
operationId: marineSpectra
security:
- clientCredentials: []
parameters:
- in: header
name: Accept-Encoding
schema:
type: string
description: Use this request header to communicate which compression algorithms the client understands. The API supports gzip.
example: gzip
- in: header
name: Accept
schema:
type: string
description: Use this request header to specify an acceptable response media type.
example: text/csv
- name: lat
in: query
schema:
type: number
format: float
example: 55.81
required: true
- name: lon
in: query
schema:
type: number
format: float
example: 3.88
required: true
- name: startTime
in: query
schema:
type: string
format: date-time
example: '2023-06-30T10:00:00Z'
required: true
- name: endTime
in: query
schema:
type: string
format: date-time
example: '2023-07-07T10:00:00Z'
responses:
'200':
description: A successful request.
content:
text/csv: {}
'400':
description: An invalid request.
content:
application/problem+json:
schema:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: false
example:
type: bad-request
title: Invalid Request
detail: Validation failed.
status: 400
instance: urn:dtn:one-marine-weather-service:/v1/conditions/marine:requestId:123e4567-e89b-12d3-a458-426614176000
'401':
description: Unable to authenticate credentials.
content:
application/problem+json:
schema:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: false
example:
type: unauthorized
title: Error while authenticating the user.
detail: invalid token
status: 401
instance: urn:dtn:one-marine-weather-service:/v1/conditions/marine:requestId:123e4567-e89b-12d3-a458-426614176000
'406':
description: Unable to produce a response matching the Accept request header.
content:
application/problem+json:
schema:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: false
example:
type: not-acceptable
title: Not Acceptable
detail: The Accept header value is invalid or unsupported.
status: 406
instance: urn:dtn:one-marine-weather-service:/v1/conditions/marine:requestId:123e4567-e89b-12d3-a458-426614176000
x-codeSamples:
- lang: C + Libcurl
source: 'CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://weather.api.dtn.com/v1/conditions/marine/spectra?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Accept-Encoding: SOME_STRING_VALUE");
headers = curl_slist_append(headers, "Accept: SOME_STRING_VALUE");
headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);'
- lang: Csharp + Restsharp
source: 'var client = new RestClient("https://weather.api.dtn.com/v1/conditions/marine/spectra?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept-Encoding", "SOME_STRING_VALUE");
request.AddHeader("Accept", "SOME_STRING_VALUE");
request.AddHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
IRestResponse response = client.Execute(request);'
- lang: Go + Native
source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://weather.api.dtn.com/v1/conditions/marine/spectra?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n\treq.Header.Add(\"Accept\", \"SOME_STRING_VALUE\")\n\treq.Header.Add(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
- lang: Java + Okhttp
source: "OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n .url(\"https://weather.api.dtn.com/v1/conditions/marine/spectra?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE\")\n .get()\n .addHeader(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n .addHeader(\"Accept\", \"SOME_STRING_VALUE\")\n .addHeader(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n .build();\n\nResponse response = client.newCall(request).execute();"
- lang: Java + Unirest
source: "HttpResponse response = Unirest.get(\"https://weather.api.dtn.com/v1/conditions/marine/spectra?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE\")\n .header(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n .header(\"Accept\", \"SOME_STRING_VALUE\")\n .header(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n .asString();"
- lang: Javascript + Jquery
source: "const settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://weather.api.dtn.com/v1/conditions/marine/spectra?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE\",\n \"method\": \"GET\",\n \"headers\": {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\n$.ajax(settings).done(function (response) {\n console.log(response);\n});"
- lang: Javascript + Xhr
source: "const data = null;\n\nconst xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === this.DONE) {\n console.log(this.responseText);\n }\n});\n\nxhr.open(\"GET\", \"https://weather.api.dtn.com/v1/conditions/marine/spectra?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE\");\nxhr.setRequestHeader(\"Accept-Encoding\", \"SOME_STRING_VALUE\");\nxhr.setRequestHeader(\"Accept\", \"SOME_STRING_VALUE\");\nxhr.setRequestHeader(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\");\n\nxhr.send(data);"
- lang: Javascript + Jquery
source: "const settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://weather.api.dtn.com/v1/conditions/marine/spectra?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE\",\n \"method\": \"GET\",\n \"headers\": {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\n$.ajax(settings).done(function (response) {\n console.log(response);\n});"
- lang: Node + Native
source: "const http = require(\"https\");\n\nconst options = {\n \"method\": \"GET\",\n \"hostname\": \"weather.api.dtn.com\",\n \"port\": null,\n \"path\": \"/v1/conditions/marine/spectra?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE\",\n \"headers\": {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\nconst req = http.request(options, function (res) {\n const chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n const body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n});\n\nreq.end();"
- lang: Node + Request
source: "const request = require('request');\n\nconst options = {\n method: 'GET',\n url: 'https://weather.api.dtn.com/v1/conditions/marine/spectra',\n qs: {\n lat: 'SOME_NUMBER_VALUE',\n lon: 'SOME_NUMBER_VALUE',\n startTime: 'SOME_STRING_VALUE',\n endTime: 'SOME_STRING_VALUE'\n },\n headers: {\n 'Accept-Encoding': 'SOME_STRING_VALUE',\n Accept: 'SOME_STRING_VALUE',\n Authorization: 'Bearer REPLACE_BEARER_TOKEN'\n }\n};\n\nrequest(options, function (error, response, body) {\n if (error) throw new Error(error);\n\n console.log(body);\n});\n"
- lang: Node + Unirest
source: "const unirest = require(\"unirest\");\n\nconst req = unirest(\"GET\", \"https://weather.api.dtn.com/v1/conditions/marine/spectra\");\n\nreq.query({\n \"lat\": \"SOME_NUMBER_VALUE\",\n \"lon\": \"SOME_NUMBER_VALUE\",\n \"startTime\": \"SOME_STRING_VALUE\",\n \"endTime\": \"SOME_STRING_VALUE\"\n});\n\nreq.headers({\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n});\n\nreq.end(function (res) {\n if (res.error) throw new Error(res.error);\n\n console.log(res.body);\n});\n"
- lang: Objc + Nsurlsession
source: "#import \n\nNSDictionary *headers = @{ @\"Accept-Encoding\": @\"SOME_STRING_VALUE\",\n @\"Accept\": @\"SOME_STRING_VALUE\",\n @\"Authorization\": @\"Bearer REPLACE_BEARER_TOKEN\" };\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://weather.api.dtn.com/v1/conditions/marine/spectra?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\n[request setHTTPMethod:@\"GET\"];\n[request setAllHTTPHeaderFields:headers];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSLog(@\"%@\", httpResponse);\n }\n }];\n[dataTask resume];"
- lang: Ocaml + Cohttp
source: "open Cohttp_lwt_unix\nopen Cohttp\nopen Lwt\n\nlet uri = Uri.of_string \"https://weather.api.dtn.com/v1/conditions/marine/spectra?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE\" in\nlet headers = Header.add_list (Header.init ()) [\n (\"Accept-Encoding\", \"SOME_STRING_VALUE\");\n (\"Accept\", \"SOME_STRING_VALUE\");\n (\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\");\n] in\n\nClient.call ~headers `GET uri\n>>= fun (res, body_stream) ->\n (* Do stuff with the result *)"
- lang: Php + Curl
source: " \"https://weather.api.dtn.com/v1/conditions/marine/spectra?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"GET\",\n CURLOPT_HTTPHEADER => [\n \"Accept: SOME_STRING_VALUE\",\n \"Accept-Encoding: SOME_STRING_VALUE\",\n \"Authorization: Bearer REPLACE_BEARER_TOKEN\"\n ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n echo \"cURL Error #:\" . $err;\n} else {\n echo $response;\n}"
- lang: Php + Http1
source: "setUrl('https://weather.api.dtn.com/v1/conditions/marine/spectra');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setQueryData([\n 'lat' => 'SOME_NUMBER_VALUE',\n 'lon' => 'SOME_NUMBER_VALUE',\n 'startTime' => 'SOME_STRING_VALUE',\n 'endTime' => 'SOME_STRING_VALUE'\n]);\n\n$request->setHeaders([\n 'Accept-Encoding' => 'SOME_STRING_VALUE',\n 'Accept' => 'SOME_STRING_VALUE',\n 'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'\n]);\n\ntry {\n $response = $request->send();\n\n echo $response->getBody();\n} catch (HttpException $ex) {\n echo $ex;\n}"
- lang: Php + Http2
source: "setRequestUrl('https://weather.api.dtn.com/v1/conditions/marine/spectra');\n$request->setRequestMethod('GET');\n$request->setQuery(new http\\QueryString([\n 'lat' => 'SOME_NUMBER_VALUE',\n 'lon' => 'SOME_NUMBER_VALUE',\n 'startTime' => 'SOME_STRING_VALUE',\n 'endTime' => 'SOME_STRING_VALUE'\n]));\n\n$request->setHeaders([\n 'Accept-Encoding' => 'SOME_STRING_VALUE',\n 'Accept' => 'SOME_STRING_VALUE',\n 'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"
- lang: Python + Python3
source: "import http.client\n\nconn = http.client.HTTPSConnection(\"weather.api.dtn.com\")\n\nheaders = {\n 'Accept-Encoding': \"SOME_STRING_VALUE\",\n 'Accept': \"SOME_STRING_VALUE\",\n 'Authorization': \"Bearer REPLACE_BEARER_TOKEN\"\n }\n\nconn.request(\"GET\", \"/v1/conditions/marine/spectra?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"
- lang: Python + Requests
source: "import requests\n\nurl = \"https://weather.api.dtn.com/v1/conditions/marine/spectra\"\n\nquerystring = {\"lat\":\"SOME_NUMBER_VALUE\",\"lon\":\"SOME_NUMBER_VALUE\",\"startTime\":\"SOME_STRING_VALUE\",\"endTime\":\"SOME_STRING_VALUE\"}\n\nheaders = {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\nprint(response.text)"
- lang: Ruby + Native
source: 'require ''uri''
require ''net/http''
require ''openssl''
url = URI("https://weather.api.dtn.com/v1/conditions/marine/spectra?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["Accept-Encoding"] = ''SOME_STRING_VALUE''
request["Accept"] = ''SOME_STRING_VALUE''
request["Authorization"] = ''Bearer REPLACE_BEARER_TOKEN''
response = http.request(request)
puts response.read_body'
- lang: Shell + Curl
source: "curl --request GET \\\n --url 'https://weather.api.dtn.com/v1/conditions/marine/spectra?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE' \\\n --header 'Accept: SOME_STRING_VALUE' \\\n --header 'Accept-Encoding: SOME_STRING_VALUE' \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'"
- lang: Shell + Httpie
source: "http GET 'https://weather.api.dtn.com/v1/conditions/marine/spectra?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE' \\\n Accept:SOME_STRING_VALUE \\\n Accept-Encoding:SOME_STRING_VALUE \\\n Authorization:'Bearer REPLACE_BEARER_TOKEN'"
- lang: Shell + Wget
source: "wget --quiet \\\n --method GET \\\n --header 'Accept-Encoding: SOME_STRING_VALUE' \\\n --header 'Accept: SOME_STRING_VALUE' \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \\\n --output-document \\\n - 'https://weather.api.dtn.com/v1/conditions/marine/spectra?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE'"
- lang: Swift + Nsurlsession
source: "import Foundation\n\nlet headers = [\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n]\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://weather.api.dtn.com/v1/conditions/marine/spectra?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE\")! as URL,\n cachePolicy: .useProtocolCachePolicy,\n timeoutInterval: 10.0)\nrequest.httpMethod = \"GET\"\nrequest.allHTTPHeaderFields = headers\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n if (error != nil) {\n print(error)\n } else {\n let httpResponse = response as? HTTPURLResponse\n print(httpResponse)\n }\n})\n\ndataTask.resume()"
servers:
- url: https://weather.api.dtn.com
/v1/conditions/marine/spectra-plot:
get:
tags:
- Endpoints
summary: Marine Spectra Plot
description: "This endpoint provides frequency-direction spectral plots in polar coordinates for forecast times. This detailed information is crucial for understanding complex sea states and optimizing operations in offshore and shipping projects.\nThis endpoint returns a presigned URL to a zipped file containing the requested plots as PNG images.\n\nFor example, it can be used to enhance the stability and safety of offshore platforms or to optimize routing for shipping vessels to avoid severe sea conditions.\n\nUse query parameters to control the results in the response body:\n\n * Specify a location as latitude (`lat`) and longitude (`lon`).\n\n * Two important parameters are `startTime` and `endTime`:\n + The API returns forecast data when `startTime` and `endTime` are in the future.\n + The API does not support `startTime` and `endTime` in the past.\n + The API returns only one exact timestamp when only `startTime` is specified.\n\n * Complete example: `https://weather.api.dtn.com/v1/conditions/marine/spectra-plot?lat={lat}&lon={lon}&startTime={start_time}&endTime={end_time}`\n"
security:
- clientCredentials: []
responses:
'200':
description: A successful request.
content:
application/json:
schema:
type: object
properties:
url:
type: string
description: URL to download zipped images.
example:
url: '...'
'400':
description: An invalid request.
content:
application/problem+json:
schema:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: false
example:
type: bad-request
title: Invalid Request
detail: Validation failed.
status: 400
instance: urn:dtn:one-marine-weather-service:/v1/conditions/marine:requestId:123e4567-e89b-12d3-a458-426614176000
'401':
description: Unable to authenticate credentials.
content:
application/problem+json:
schema:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: false
example:
type: unauthorized
title: Error while authenticating the user.
detail: invalid token
status: 401
instance: urn:dtn:one-marine-weather-service:/v1/conditions/marine:requestId:123e4567-e89b-12d3-a458-426614176000
'406':
description: Unable to produce a response matching the Accept request header.
content:
application/problem+json:
schema:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: false
example:
type: not-acceptable
title: Not Acceptable
detail: The Accept header value is invalid or unsupported.
status: 406
instance: urn:dtn:one-marine-weather-service:/v1/conditions/marine:requestId:123e4567-e89b-12d3-a458-426614176000
x-codeSamples:
- lang: C + Libcurl
source: 'CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://weather.api.dtn.com/v1/conditions/marine/spectra-plot");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);'
- lang: Csharp + Restsharp
source: 'var client = new RestClient("https://weather.api.dtn.com/v1/conditions/marine/spectra-plot");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
IRestResponse response = client.Execute(request);'
- lang: Go + Native
source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://weather.api.dtn.com/v1/conditions/marine/spectra-plot\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
- lang: Java + Okhttp
source: "OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n .url(\"https://weather.api.dtn.com/v1/conditions/marine/spectra-plot\")\n .get()\n .addHeader(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n .build();\n\nResponse response = client.newCall(request).execute();"
- lang: Java + Unirest
source: "HttpResponse response = Unirest.get(\"https://weather.api.dtn.com/v1/conditions/marine/spectra-plot\")\n .header(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n .asString();"
- lang: Javascript + Jquery
source: "const settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://weather.api.dtn.com/v1/conditions/marine/spectra-plot\",\n \"method\": \"GET\",\n \"headers\": {\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\n$.ajax(settings).done(function (response) {\n console.log(response);\n});"
- lang: Javascript + Xhr
source: "const data = null;\n\nconst xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === this.DONE) {\n console.log(this.responseText);\n }\n});\n\nxhr.open(\"GET\", \"https://weather.api.dtn.com/v1/conditions/marine/spectra-plot\");\nxhr.setRequestHeader(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\");\n\nxhr.send(data);"
- lang: Javascript + Jquery
source: "const settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://weather.api.dtn.com/v1/conditions/marine/spectra-plot\",\n \"method\": \"GET\",\n \"headers\": {\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\n$.ajax(settings).done(function (response) {\n console.log(response);\n});"
- lang: Node + Native
source: "const http = require(\"https\");\n\nconst options = {\n \"method\": \"GET\",\n \"hostname\": \"weather.api.dtn.com\",\n \"port\": null,\n \"path\": \"/v1/conditions/marine/spectra-plot\",\n \"headers\": {\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\nconst req = http.request(options, function (res) {\n const chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n const body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n});\n\nreq.end();"
- lang: Node + Request
source: "const request = require('request');\n\nconst options = {\n method: 'GET',\n url: 'https://weather.api.dtn.com/v1/conditions/marine/spectra-plot',\n headers: {Authorization: 'Bearer REPLACE_BEARER_TOKEN'}\n};\n\nrequest(options, function (error, response, body) {\n if (error) throw new Error(error);\n\n console.log(body);\n});\n"
- lang: Node + Unirest
source: "const unirest = require(\"unirest\");\n\nconst req = unirest(\"GET\", \"https://weather.api.dtn.com/v1/conditions/marine/spectra-plot\");\n\nreq.headers({\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n});\n\nreq.end(function (res) {\n if (res.error) throw new Error(res.error);\n\n console.log(res.body);\n});\n"
- lang: Objc + Nsurlsession
source: "#import \n\nNSDictionary *headers = @{ @\"Authorization\": @\"Bearer REPLACE_BEARER_TOKEN\" };\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://weather.api.dtn.com/v1/conditions/marine/spectra-plot\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\n[request setHTTPMethod:@\"GET\"];\n[request setAllHTTPHeaderFields:headers];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSLog(@\"%@\", httpResponse);\n }\n }];\n[dataTask resume];"
- lang: Ocaml + Cohttp
source: "open Cohttp_lwt_unix\nopen Cohttp\nopen Lwt\n\nlet uri = Uri.of_string \"https://weather.api.dtn.com/v1/conditions/marine/spectra-plot\" in\nlet headers = Header.add (Header.init ()) \"Authorization\" \"Bearer REPLACE_BEARER_TOKEN\" in\n\nClient.call ~headers `GET uri\n>>= fun (res, body_stream) ->\n (* Do stuff with the result *)"
- lang: Php + Curl
source: " \"https://weather.api.dtn.com/v1/conditions/marine/spectra-plot\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"GET\",\n CURLOPT_HTTPHEADER => [\n \"Authorization: Bearer REPLACE_BEARER_TOKEN\"\n ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n echo \"cURL Error #:\" . $err;\n} else {\n echo $response;\n}"
- lang: Php + Http1
source: "setUrl('https://weather.api.dtn.com/v1/conditions/marine/spectra-plot');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setHeaders([\n 'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'\n]);\n\ntry {\n $response = $request->send();\n\n echo $response->getBody();\n} catch (HttpException $ex) {\n echo $ex;\n}"
- lang: Php + Http2
source: "setRequestUrl('https://weather.api.dtn.com/v1/conditions/marine/spectra-plot');\n$request->setRequestMethod('GET');\n$request->setHeaders([\n 'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"
- lang: Python + Python3
source: 'import http.client
conn = http.client.HTTPSConnection("weather.api.dtn.com")
headers = { ''Authorization'': "Bearer REPLACE_BEARER_TOKEN" }
conn.request("GET", "/v1/conditions/marine/spectra-plot", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))'
- lang: Python + Requests
source: 'import requests
url = "https://weather.api.dtn.com/v1/conditions/marine/spectra-plot"
headers = {"Authorization": "Bearer REPLACE_BEARER_TOKEN"}
response = requests.request("GET", url, headers=headers)
print(response.text)'
- lang: Ruby + Native
source: 'require ''uri''
require ''net/http''
require ''openssl''
url = URI("https://weather.api.dtn.com/v1/conditions/marine/spectra-plot")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["Authorization"] = ''Bearer REPLACE_BEARER_TOKEN''
response = http.request(request)
puts response.read_body'
- lang: Shell + Curl
source: "curl --request GET \\\n --url https://weather.api.dtn.com/v1/conditions/marine/spectra-plot \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'"
- lang: Shell + Httpie
source: "http GET https://weather.api.dtn.com/v1/conditions/marine/spectra-plot \\\n Authorization:'Bearer REPLACE_BEARER_TOKEN'"
- lang: Shell + Wget
source: "wget --quiet \\\n --method GET \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \\\n --output-document \\\n - https://weather.api.dtn.com/v1/conditions/marine/spectra-plot"
- lang: Swift + Nsurlsession
source: "import Foundation\n\nlet headers = [\"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"]\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://weather.api.dtn.com/v1/conditions/marine/spectra-plot\")! as URL,\n cachePolicy: .useProtocolCachePolicy,\n timeoutInterval: 10.0)\nrequest.httpMethod = \"GET\"\nrequest.allHTTPHeaderFields = headers\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n if (error != nil) {\n print(error)\n } else {\n let httpResponse = response as? HTTPURLResponse\n print(httpResponse)\n }\n})\n\ndataTask.resume()"
servers:
- url: https://weather.api.dtn.com
/v1/:
get:
tags:
- Endpoints
summary: Precipitation
description: "This endpoint provides detailed precipitation data for any specified global location. Users can request various weather parameters for a time range of up to 15 days.\n\nCommon uses include weather monitoring, atmospheric research, and localized operations, such as event planning.\n\n## Query Parameters:\nUse query parameters to control the results in the response body:\n### location\n* Specify a location as latitude (`lat`) and longitude (`lon`).\n\n### parameters\n* Specify `parameters` to filter by specific atmospheric weather parameters. Include multiple as comma-separated values. The API returns only defaults when no specific parameters are requested.\n\n### startTime and endTime\n* Two key parameters are `startTime` and `endTime`. These parameters determine the time range for which the API returns data. Both `startTime` and `endTime` are inclusive, meaning that data at the top of the UTC hour for both timestamps is included in the response.\n* The time between `startTime` and `endTime` must be less than or equal to 15 days.\n* `startTime` must be greater than `2023-05-12T00:00:00Z` and `endTime` must be less than or equal to the current hour.\n\n* API Behavior Based on startTime and endTime:\n\n * **Omitted startTime and endTime:** Returns only data for the current hour.\n\n * **Only startTime Specified:** Returns data only for `startTime`.\n\n * **Only endTime Specified:** Returns data only for `endTime`.\n\n* Inclusivity of Timestamps\n\n * **Inclusive `startTime` and `endTime`:** Both parameters are inclusive, affecting the total duration and the number of data points returned, especially when using the interval parameter.\n\n * **Effect on Data Retrieval and Aggregation:** The inclusivity can result in additional aggregation periods or data points.\n \n * **Example:** If `startTime` is 2024-01-01T01:00:00Z and `endTime` is 2024-01-01T02:00:00Z and the requested parameter is `precipAmount`,\n the API will return data for both timestamps.\n The data timestamped 2024-01-01T01:00:00Z would represent the amount of precipitation within the hour window of\n 2024-01-01T00:00:01Z to 2024-01-01T01:00:00Z. Likewise, the data timestamped 2024-01-01T02:00:00Z would represent the\n amount of precipitation within the hour window of 2024-01-01T01:00:01Z to 2024-01-01T02:00:00Z.\n\n### units\n * Use `units` to request values either as SI (metric) or United States customary (imperial) units.\n + The API returns metric units by default and when `si-std` is specified.\n + The API returns imperial units only when `us-std` is specified.\n\n### interval\n * Specify the `interval` parameter to request aggregated data for parameters such as precipAmountSum.\n + **Format:** The interval for hourly aggregations must be in the format {n}h, where {n} is an integer greater than 1 (e.g., 2h, 6h, or 24h). For local timezone-aware daily aggregations, use '1d'.\n + **Constraints:** The interval must not exceed the total duration between `startTime` and `endTime`. For '1d' intervals, only local timezones (no UTC offsets) are supported to ensure accurate daily aggregation.\n\n * Aggregation Behavior:\n + **Aggregation Periods:** Data aggregation starts from the specified `startTime`. Each timestamp in the response represents the beginning of an aggregation period. For each interval, the API aggregates data from the timestamp up to (but not including) the next interval's start time.\n + **Final Interval Handling:** If the duration between `startTime` and `endTime` doesn't divide evenly by the interval, the final interval may be shorter. The last data point aggregates up to the inclusive endTime.\n * Examples using interval:\n + Example 1: 12-Hour Interval Aggregation\n + Parameters:\n + **startTime:** 2024-11-06T15:00:00Z\n + **endTime:** 2024-11-07T15:00:00Z\n + **interval:** 12h\n + **parameter:** precipAmountSum\n + Response:\n ```json\n {\n \"properties\": {\n \"2024-11-06T15:00:00Z\": {\n \"precipAmountSum\": 0.5\n },\n \"2024-11-07T03:00:00Z\": {\n \"precipAmountSum\": 1.0\n },\n \"2024-11-07T15:00:00Z\": {\n \"precipAmountSum\": 0.4\n }\n }\n ```\n + Explanation:\n + **First Data Point (2024-11-06T15:00:00Z):** Aggregates data from 2024-11-06T15:00:00Z up to including 2024-11-07T02:00:00Z.\n + **Second Data Point (2024-11-07T03:00:00Z):** Aggregates data from 2024-11-07T03:00:00Z up to including 2024-11-07T14:00:00Z.\n + **Third Data Point (2024-11-07T15:00:00Z):** Since `endTime` is inclusive, this final data point includes data from 2024-11-07T15:00:00Z up to the endTime.\n + Example 2: 24-Hour Interval with Inclusive `endTime`\n + Parameters:\n + **startTime:** 2024-10-23T00:00:00Z\n + **endTime:** 2024-10-24T00:00:00Z\n + **interval:** 24h\n + **parameter:** precipAmountSum\n + Response:\n ```json\n {\n \"properties\": {\n \"2024-10-23T00:00:00Z\": {\n \"precipAmount\": 1.0\n },\n \"2024-10-24T00:00:00Z\": {\n \"precipAmount\": 0.6\n }\n }\n ```\n + Explanation:\n + **First Data Point (2024-10-23T00:00:00Z):** Aggregates data from 2024-10-23T00:00:00Z up to including 2024-10-24T24:00:00Z.\n + **Second Data Point (2024-10-24T00:00:00Z):** Since endTime is inclusive and matches the start of the next interval, this data point includes data at 2024-10-24T00:00:00Z.\n + **Total Duration:** Due to inclusivity, the time span covers 25 hours, resulting in two data points.\n + Example 3: Adjusting endTime to Control Data Points\n + Objective: Retrieve data for only one day with a single data point.\n + Adjusted endTime: Set to 2024-10-23T23:59:59Z.\n + Parameters:\n + **startTime:** 2024-10-23T00:00:00Z\n + **endTime:** 2024-10-23T23:59:59Z\n + **interval:** 24h\n + **parameter:** precipAmountSum\n + Response:\n ```json\n \"properties\": {\n \"2024-10-23T00:00:00Z\": {\n \"precipAmountSum\": 19.3\n }\n }\n ```\n * Explanation:\n * **Single Data Point:** Aggregates data over the 24-hour period without including the next day's data.\n * **Duration:** Exactly 24 hours, resulting in one data point.\n + Example 4: Fractional time zones\n + Parameters:\n + **startTime:** 2024-05-27T00:00:00\n + **endTime:** 2024-05-27T23:59:59\n + **interval:** 24h\n + **parameter:** precipAmountSum\n + **lat:** 30.251\n + **lon:** 62.569\n \n + Response:\n ```json\n \"properties\": {\n \"2024-05-26T23:30:00+0430\": {\n \"precipAmountSum\": 11.1,\n },\n \"2024-05-27T23:30:00+0430\": {\n \"precipAmountSum\": 12.3,\n }\n }\n ```\n * Explanation:\n * **Why** This response seems confusing at first becuase we have 2 data points when we seemingly only requested a single 24 hour interval.\n * **Local Timezone Assumption** When requesting a start and end time that has no timezone, the timezone of the location requested will be used.\n * For the example requested lat/lon the local timezone is UTC+04:30 (fractional timezone)\n * **Inclusive Time Range** startTime is hour inclusive, meaning the API will return data for the top of the requested hour (in UTC).\n * **UTC Conversion** All data is stored in UTC hourly.\n * When we convert these requested timestamps to UTC, `startTime=2024-05-26T19:30:00Z`, `endTime=2024-05-27T19:29:59Z`\n * Since startTime and endTime are `inclusive`, so the time range spans exactly 25 hours, not 24.\n * Changing `endTime` to `2024-05-27T23:00:00` will result in a single interval returned.\n\n\n### Complete example:\n\n`https://precipitation.api.dtn.com/v1/?lat={lat}&lon={lon}&startTime={start_time}&endTime={end_time}&interval={n}h¶meters={param1,param2}&units={units}`\n"
operationId: precip
security:
- clientCredentials: []
parameters:
- in: header
name: Accept-Encoding
schema:
type: string
description: Use this request header to communicate which compression algorithms the client understands. The API supports gzip.
example: gzip
- in: header
name: Accept
schema:
type: string
description: Use this request header to specify an acceptable response media type.
example: application/json
- name: lat
in: query
schema:
type: number
format: float
example: 35.47
required: true
- name: lon
in: query
schema:
type: number
format: float
example: -97.51
required: true
- name: startTime
in: query
schema:
type: string
format: date-time
example: '2024-10-01T00:06:10Z'
- name: endTime
in: query
schema:
type: string
format: date-time
example: '2024-10-14T00:06:10Z'
- name: parameters
in: query
style: form
explode: true
schema:
type: array
items:
type: string
example: precipAmount
- name: units
in: query
schema:
type: string
example: us-std
responses:
'200':
description: A successful request.
content:
application/json:
schema:
type: object
properties:
url:
type: string
type:
type: string
features:
type: array
items:
type: object
properties:
type:
type: string
geometry:
type: object
properties:
type:
type: string
coordinates:
type: array
items:
type: number
properties:
type: object
properties:
'2023-10-01T00:00:00Z':
type: object
properties:
example1:
type: number
example2:
type: number
example:
url: https://precipitation.api.dtn.com/v1/?lat=35.47&lon=-97.51¶meters=precipAmount&startTime=2023-10-01T00:06:10Z&endTime=2023-10-01T02:06:10Z&units=us-std
type: FeatureCollection
features:
- type: Feature
geometry:
type: Point
coordinates:
- -97.51
- 35.47
properties:
'2023-10-01T00:00:00Z':
precipAmount: 2.1
'2023-10-01T01:00:00Z':
precipAmount: 0.6
'2023-10-01T02:00:00Z':
precipAmount: 1
'400':
description: An invalid request.
content:
application/problem+json:
schema:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: true
example:
type: bad-request
title: Invalid Request
detail: Validation failed.
status: 400
instance: urn:dtn:precipitations-service:/v1/:requestId:123e4567-e89b-12d3-a458-426614176000
'401':
description: Unable to authenticate credentials.
content:
application/problem+json:
schema:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: true
example:
type: unauthorized
title: Error while authenticating the user.
detail: invalid token
status: 401
instance: urn:dtn:precipitations-service:/v1/:requestId:123e4567-e89b-12d3-a458-426614176000
'406':
description: Unable to produce a response matching the Accept request header.
content:
application/problem+json:
schema:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: true
example:
type: not-acceptable
title: Not Acceptable
detail: The Accept header value is invalid or unsupported.
status: 406
instance: urn:dtn:precipitations-service:/v1/:requestId:123e4567-e89b-12d3-a458-426614176000
x-codeSamples:
- lang: C + Libcurl
source: 'CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://precipitation.api.dtn.com/v1/?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Accept-Encoding: SOME_STRING_VALUE");
headers = curl_slist_append(headers, "Accept: SOME_STRING_VALUE");
headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);'
- lang: Csharp + Restsharp
source: 'var client = new RestClient("https://precipitation.api.dtn.com/v1/?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept-Encoding", "SOME_STRING_VALUE");
request.AddHeader("Accept", "SOME_STRING_VALUE");
request.AddHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
IRestResponse response = client.Execute(request);'
- lang: Go + Native
source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://precipitation.api.dtn.com/v1/?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n\treq.Header.Add(\"Accept\", \"SOME_STRING_VALUE\")\n\treq.Header.Add(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
- lang: Java + Okhttp
source: "OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n .url(\"https://precipitation.api.dtn.com/v1/?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\")\n .get()\n .addHeader(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n .addHeader(\"Accept\", \"SOME_STRING_VALUE\")\n .addHeader(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n .build();\n\nResponse response = client.newCall(request).execute();"
- lang: Java + Unirest
source: "HttpResponse response = Unirest.get(\"https://precipitation.api.dtn.com/v1/?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\")\n .header(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n .header(\"Accept\", \"SOME_STRING_VALUE\")\n .header(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n .asString();"
- lang: Javascript + Jquery
source: "const settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://precipitation.api.dtn.com/v1/?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\",\n \"method\": \"GET\",\n \"headers\": {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\n$.ajax(settings).done(function (response) {\n console.log(response);\n});"
- lang: Javascript + Xhr
source: "const data = null;\n\nconst xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === this.DONE) {\n console.log(this.responseText);\n }\n});\n\nxhr.open(\"GET\", \"https://precipitation.api.dtn.com/v1/?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\");\nxhr.setRequestHeader(\"Accept-Encoding\", \"SOME_STRING_VALUE\");\nxhr.setRequestHeader(\"Accept\", \"SOME_STRING_VALUE\");\nxhr.setRequestHeader(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\");\n\nxhr.send(data);"
- lang: Javascript + Jquery
source: "const settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://precipitation.api.dtn.com/v1/?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\",\n \"method\": \"GET\",\n \"headers\": {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\n$.ajax(settings).done(function (response) {\n console.log(response);\n});"
- lang: Node + Native
source: "const http = require(\"https\");\n\nconst options = {\n \"method\": \"GET\",\n \"hostname\": \"precipitation.api.dtn.com\",\n \"port\": null,\n \"path\": \"/v1/?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\",\n \"headers\": {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\nconst req = http.request(options, function (res) {\n const chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n const body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n});\n\nreq.end();"
- lang: Node + Request
source: "const request = require('request');\n\nconst options = {\n method: 'GET',\n url: 'https://precipitation.api.dtn.com/v1/',\n qs: {\n lat: 'SOME_NUMBER_VALUE',\n lon: 'SOME_NUMBER_VALUE',\n startTime: 'SOME_STRING_VALUE',\n endTime: 'SOME_STRING_VALUE',\n parameters: 'SOME_ARRAY_VALUE',\n units: 'SOME_STRING_VALUE'\n },\n headers: {\n 'Accept-Encoding': 'SOME_STRING_VALUE',\n Accept: 'SOME_STRING_VALUE',\n Authorization: 'Bearer REPLACE_BEARER_TOKEN'\n }\n};\n\nrequest(options, function (error, response, body) {\n if (error) throw new Error(error);\n\n console.log(body);\n});\n"
- lang: Node + Unirest
source: "const unirest = require(\"unirest\");\n\nconst req = unirest(\"GET\", \"https://precipitation.api.dtn.com/v1/\");\n\nreq.query({\n \"lat\": \"SOME_NUMBER_VALUE\",\n \"lon\": \"SOME_NUMBER_VALUE\",\n \"startTime\": \"SOME_STRING_VALUE\",\n \"endTime\": \"SOME_STRING_VALUE\",\n \"parameters\": \"SOME_ARRAY_VALUE\",\n \"units\": \"SOME_STRING_VALUE\"\n});\n\nreq.headers({\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n});\n\nreq.end(function (res) {\n if (res.error) throw new Error(res.error);\n\n console.log(res.body);\n});\n"
- lang: Objc + Nsurlsession
source: "#import \n\nNSDictionary *headers = @{ @\"Accept-Encoding\": @\"SOME_STRING_VALUE\",\n @\"Accept\": @\"SOME_STRING_VALUE\",\n @\"Authorization\": @\"Bearer REPLACE_BEARER_TOKEN\" };\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://precipitation.api.dtn.com/v1/?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\n[request setHTTPMethod:@\"GET\"];\n[request setAllHTTPHeaderFields:headers];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSLog(@\"%@\", httpResponse);\n }\n }];\n[dataTask resume];"
- lang: Ocaml + Cohttp
source: "open Cohttp_lwt_unix\nopen Cohttp\nopen Lwt\n\nlet uri = Uri.of_string \"https://precipitation.api.dtn.com/v1/?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\" in\nlet headers = Header.add_list (Header.init ()) [\n (\"Accept-Encoding\", \"SOME_STRING_VALUE\");\n (\"Accept\", \"SOME_STRING_VALUE\");\n (\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\");\n] in\n\nClient.call ~headers `GET uri\n>>= fun (res, body_stream) ->\n (* Do stuff with the result *)"
- lang: Php + Curl
source: " \"https://precipitation.api.dtn.com/v1/?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"GET\",\n CURLOPT_HTTPHEADER => [\n \"Accept: SOME_STRING_VALUE\",\n \"Accept-Encoding: SOME_STRING_VALUE\",\n \"Authorization: Bearer REPLACE_BEARER_TOKEN\"\n ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n echo \"cURL Error #:\" . $err;\n} else {\n echo $response;\n}"
- lang: Php + Http1
source: "setUrl('https://precipitation.api.dtn.com/v1/');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setQueryData([\n 'lat' => 'SOME_NUMBER_VALUE',\n 'lon' => 'SOME_NUMBER_VALUE',\n 'startTime' => 'SOME_STRING_VALUE',\n 'endTime' => 'SOME_STRING_VALUE',\n 'parameters' => 'SOME_ARRAY_VALUE',\n 'units' => 'SOME_STRING_VALUE'\n]);\n\n$request->setHeaders([\n 'Accept-Encoding' => 'SOME_STRING_VALUE',\n 'Accept' => 'SOME_STRING_VALUE',\n 'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'\n]);\n\ntry {\n $response = $request->send();\n\n echo $response->getBody();\n} catch (HttpException $ex) {\n echo $ex;\n}"
- lang: Php + Http2
source: "setRequestUrl('https://precipitation.api.dtn.com/v1/');\n$request->setRequestMethod('GET');\n$request->setQuery(new http\\QueryString([\n 'lat' => 'SOME_NUMBER_VALUE',\n 'lon' => 'SOME_NUMBER_VALUE',\n 'startTime' => 'SOME_STRING_VALUE',\n 'endTime' => 'SOME_STRING_VALUE',\n 'parameters' => 'SOME_ARRAY_VALUE',\n 'units' => 'SOME_STRING_VALUE'\n]));\n\n$request->setHeaders([\n 'Accept-Encoding' => 'SOME_STRING_VALUE',\n 'Accept' => 'SOME_STRING_VALUE',\n 'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"
- lang: Python + Python3
source: "import http.client\n\nconn = http.client.HTTPSConnection(\"precipitation.api.dtn.com\")\n\nheaders = {\n 'Accept-Encoding': \"SOME_STRING_VALUE\",\n 'Accept': \"SOME_STRING_VALUE\",\n 'Authorization': \"Bearer REPLACE_BEARER_TOKEN\"\n }\n\nconn.request(\"GET\", \"/v1/?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"
- lang: Python + Requests
source: "import requests\n\nurl = \"https://precipitation.api.dtn.com/v1/\"\n\nquerystring = {\"lat\":\"SOME_NUMBER_VALUE\",\"lon\":\"SOME_NUMBER_VALUE\",\"startTime\":\"SOME_STRING_VALUE\",\"endTime\":\"SOME_STRING_VALUE\",\"parameters\":\"SOME_ARRAY_VALUE\",\"units\":\"SOME_STRING_VALUE\"}\n\nheaders = {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\nprint(response.text)"
- lang: Ruby + Native
source: 'require ''uri''
require ''net/http''
require ''openssl''
url = URI("https://precipitation.api.dtn.com/v1/?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["Accept-Encoding"] = ''SOME_STRING_VALUE''
request["Accept"] = ''SOME_STRING_VALUE''
request["Authorization"] = ''Bearer REPLACE_BEARER_TOKEN''
response = http.request(request)
puts response.read_body'
- lang: Shell + Curl
source: "curl --request GET \\\n --url 'https://precipitation.api.dtn.com/v1/?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE' \\\n --header 'Accept: SOME_STRING_VALUE' \\\n --header 'Accept-Encoding: SOME_STRING_VALUE' \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'"
- lang: Shell + Httpie
source: "http GET 'https://precipitation.api.dtn.com/v1/?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE' \\\n Accept:SOME_STRING_VALUE \\\n Accept-Encoding:SOME_STRING_VALUE \\\n Authorization:'Bearer REPLACE_BEARER_TOKEN'"
- lang: Shell + Wget
source: "wget --quiet \\\n --method GET \\\n --header 'Accept-Encoding: SOME_STRING_VALUE' \\\n --header 'Accept: SOME_STRING_VALUE' \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \\\n --output-document \\\n - 'https://precipitation.api.dtn.com/v1/?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE'"
- lang: Swift + Nsurlsession
source: "import Foundation\n\nlet headers = [\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n]\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://precipitation.api.dtn.com/v1/?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\")! as URL,\n cachePolicy: .useProtocolCachePolicy,\n timeoutInterval: 10.0)\nrequest.httpMethod = \"GET\"\nrequest.allHTTPHeaderFields = headers\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n if (error != nil) {\n print(error)\n } else {\n let httpResponse = response as? HTTPURLResponse\n print(httpResponse)\n }\n})\n\ndataTask.resume()"
servers:
- url: https://precipitation.api.dtn.com
/v1/probabilistic:
get:
tags:
- Endpoints
summary: Probabilistic Weather Forecast
description: "This endpoint provides probabilistic weather forecasts for any specific point on the globe. Specify the location, the probabilistic parameters of interest, and a time range up to 10 days in the future.\n\nCommon uses include risk assessment, decision-making under uncertainty, and operations planning with specific confidence levels.\n\n## Using timezone offsets\n\nTo change timezones, specify a UTC offset (such as `+08:00` or `-05:00` instead of `Z`) for query parameters `startTime` and `endTime`. Timestamps in the response will automatically match the `startTime` offset. Remove the offset entirely to obtain the local timezone for the requested location.\n\n\n\n#### Valid examples\n\n* `?startTime=2024-01-01T00:00:00Z&endTime=2024-01-01T23:00:00Z`\n\n* `?startTime=2024-01-01T00:00:00%2B08:00&endTime=2024-01-01T23:00:00+02:00`\n\n* `?startTime=2024-01-01T00:00:00-08:00&endTime=2024-01-01T23:00:00-08:00`\n\n* `?startTime=2024-01-01T00:00:00&endTime=2024-01-01T23:00:00`\n\n\n### Latitude and Longitude\n\n**Important note**: Requested latitudes and longitudes in response are rounded to five (5) decimal places when presented in `$.features.*.geometry.coordinates`. Floating point precision might affect the last digit.\n\n### Rounding examples\n\n* 1.5555 => 1.556\n\n* 1.5545 => 1.554\n\n* -1.5555 => -1.556\n\n\n## Query Parameters:\nUse query parameters to control the results in the response body:\n### location\n* Specify a location as latitude (`lat`) and longitude (`lon`).\n\n### parameters\n* Specify `parameters` to filter by specific probabilistic weather parameters. Include multiple as comma-separated values.\n\n### startTime and endTime\n* Two key parameters are `startTime` and `endTime`. These parameters determine the time range for which the API returns probabilistic forecast data. Both `startTime` and `endTime` are inclusive, meaning that data at the top of the UTC hour for both timestamps is included in the response.\n\n* API Behavior Based on startTime and endTime:\n\n * **Omitted startTime and endTime:** Returns current probabilistic conditions.\n\n * **Both in the Future:** Returns probabilistic forecast data when both `startTime` and `endTime` are in the future.\n\n * **Only startTime Specified:** Returns only one timestamp, representing the probabilistic data at the specified `startTime`.\n\n* Inclusivity of Timestamps\n\n * **Inclusive `startTime` and `endTime`:** Both parameters are inclusive, affecting the total duration and the number of data points returned.\n\n\n### units\n * Use `units` to request values either as SI (metric) or United States customary (imperial) units.\n + The API returns metric units by default and when `si-std` is specified.\n + The API returns imperial units only when `us-std` is specified.\n\nAll together, a complete request looks like:\n\n```\nhttps://probabilistic.api.dtn.com/v1/probabilistic?lat={lat}&lon={lon}&startTime={start_time}&endTime={end_time}¶meters={param1,param2}&units={units}\n```\n"
operationId: probabilisticForecast
security:
- clientCredentials: []
parameters:
- in: header
name: Accept-Encoding
schema:
type: string
description: Use this request header to communicate which compression algorithms the client understands. The API supports gzip.
example: gzip
- in: header
name: Accept
schema:
type: string
description: Use this request header to specify an acceptable response media type.
example: application/json
- name: lat
in: query
schema:
type: number
format: float
minimum: -90
maximum: 90
example: 35.47
required: true
description: Latitude coordinate in decimal degrees
- name: lon
in: query
schema:
type: number
format: float
minimum: -180
maximum: 180
example: -97.51
required: true
description: Longitude coordinate in decimal degrees
- name: startTime
in: query
schema:
type: string
format: date-time
example: '2024-08-15T00:00:00Z'
description: Start time for forecast period in ISO 8601 format. If no timezone is specified, defaults to local timezone of the requested location. Use timezone offset (e.g., "+05:00") or "Z" for UTC.
- name: endTime
in: query
schema:
type: string
format: date-time
example: '2024-08-17T00:00:00Z'
description: End time for forecast period in ISO 8601 format. If no timezone is specified, defaults to local timezone of the requested location. Use timezone offset (e.g., "+05:00") or "Z" for UTC.
- name: parameters
in: query
style: form
explode: true
schema:
type: array
items:
type: string
example: airTempP10,airTempP90,windSpeedPoE10
description: Comma-separated list of probabilistic parameters to include in response
- name: units
in: query
schema:
type: string
enum:
- si-std
- us-std
default: si-std
example: us-std
description: Unit system for response values (si-std for metric, us-std for imperial)
responses:
'200':
description: A successful request.
content:
application/json:
schema:
type: object
properties:
url:
type: string
description: The request URL
type:
type: string
description: GeoJSON type
example: FeatureCollection
features:
type: array
items:
type: object
properties:
type:
type: string
example: Feature
geometry:
type: object
properties:
type:
type: string
example: Point
coordinates:
type: array
items:
type: number
example:
- -97.51
- 35.47
properties:
type: object
description: Time-series data with probabilistic parameters
additionalProperties:
type: object
description: Probabilistic forecast data for a specific time
properties:
airTempP10:
type: number
description: 10th percentile air temperature
airTempP25:
type: number
description: 25th percentile air temperature
airTempP50:
type: number
description: 50th percentile air temperature (median)
airTempP75:
type: number
description: 75th percentile air temperature
airTempP90:
type: number
description: 90th percentile air temperature
airTempPoE0:
type: number
description: Probability of air temperature exceeding 0°C
airTempPoE15:
type: number
description: Probability of air temperature exceeding 15°C
windSpeedP10:
type: number
description: 10th percentile wind speed
windSpeedP50:
type: number
description: 50th percentile wind speed (median)
windSpeedP90:
type: number
description: 90th percentile wind speed
windSpeedPoE10:
type: number
description: Probability of wind speed exceeding 10 m/s
windSpeedGustP50:
type: number
description: 50th percentile wind gust (median)
windSpeedGustP90:
type: number
description: 90th percentile wind gust
windSpeedGustPoE15:
type: number
description: Probability of wind gust exceeding 15 m/s
precipitationP50:
type: number
description: 50th percentile precipitation (median)
precipitationP90:
type: number
description: 90th percentile precipitation
precipitationPoE5:
type: number
description: Probability of precipitation exceeding 5mm
example:
url: https://probabilistic.api.dtn.com/v1/probabilistic?lat=35.47&lon=-97.51&startTime=2024-08-15T00:00:00Z&endTime=2024-08-15T06:00:00Z¶meters=airTempP10,airTempP90,windSpeedPoE10&units=us-std
type: FeatureCollection
features:
- type: Feature
geometry:
type: Point
coordinates:
- -97.51
- 35.47
properties:
'2024-08-15T00:00:00Z':
airTempP10: 72.5
airTempP90: 85.2
windSpeedPoE10: 15.3
'2024-08-15T01:00:00Z':
airTempP10: 71.8
airTempP90: 84.7
windSpeedPoE10: 18.7
'2024-08-15T02:00:00Z':
airTempP10: 71.2
airTempP90: 84.1
windSpeedPoE10: 22.1
'400':
description: An invalid request.
content:
application/problem+json:
schema:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: true
example:
type: bad-request
title: Invalid Request
detail: Validation failed.
status: 400
instance: urn:dtn:probabilistic:/v1/probabilistic:requestId:123e4567-e89b-12d3-a458-426614176000
'401':
description: Unable to authenticate credentials.
content:
application/problem+json:
schema:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: true
example:
type: unauthorized
title: Error while authenticating the user.
detail: invalid token
status: 401
instance: urn:dtn:probabilistic:/v1/probabilistic:requestId:123e4567-e89b-12d3-a458-426614176000
'406':
description: Unable to produce a response matching the Accept request header.
content:
application/problem+json:
schema:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: true
example:
type: not-acceptable
title: Not Acceptable
detail: The Accept header value is invalid or unsupported.
status: 406
instance: urn:dtn:probabilistic:/v1/probabilistic:requestId:123e4567-e89b-12d3-a458-426614176000
x-codeSamples:
- lang: C + Libcurl
source: 'CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://probabilistic.api.dtn.com/v1/probabilistic?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Accept-Encoding: SOME_STRING_VALUE");
headers = curl_slist_append(headers, "Accept: SOME_STRING_VALUE");
headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);'
- lang: Csharp + Restsharp
source: 'var client = new RestClient("https://probabilistic.api.dtn.com/v1/probabilistic?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept-Encoding", "SOME_STRING_VALUE");
request.AddHeader("Accept", "SOME_STRING_VALUE");
request.AddHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
IRestResponse response = client.Execute(request);'
- lang: Go + Native
source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://probabilistic.api.dtn.com/v1/probabilistic?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n\treq.Header.Add(\"Accept\", \"SOME_STRING_VALUE\")\n\treq.Header.Add(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
- lang: Java + Okhttp
source: "OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n .url(\"https://probabilistic.api.dtn.com/v1/probabilistic?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\")\n .get()\n .addHeader(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n .addHeader(\"Accept\", \"SOME_STRING_VALUE\")\n .addHeader(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n .build();\n\nResponse response = client.newCall(request).execute();"
- lang: Java + Unirest
source: "HttpResponse response = Unirest.get(\"https://probabilistic.api.dtn.com/v1/probabilistic?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\")\n .header(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n .header(\"Accept\", \"SOME_STRING_VALUE\")\n .header(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n .asString();"
- lang: Javascript + Jquery
source: "const settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://probabilistic.api.dtn.com/v1/probabilistic?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\",\n \"method\": \"GET\",\n \"headers\": {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\n$.ajax(settings).done(function (response) {\n console.log(response);\n});"
- lang: Javascript + Xhr
source: "const data = null;\n\nconst xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === this.DONE) {\n console.log(this.responseText);\n }\n});\n\nxhr.open(\"GET\", \"https://probabilistic.api.dtn.com/v1/probabilistic?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\");\nxhr.setRequestHeader(\"Accept-Encoding\", \"SOME_STRING_VALUE\");\nxhr.setRequestHeader(\"Accept\", \"SOME_STRING_VALUE\");\nxhr.setRequestHeader(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\");\n\nxhr.send(data);"
- lang: Javascript + Jquery
source: "const settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://probabilistic.api.dtn.com/v1/probabilistic?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\",\n \"method\": \"GET\",\n \"headers\": {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\n$.ajax(settings).done(function (response) {\n console.log(response);\n});"
- lang: Node + Native
source: "const http = require(\"https\");\n\nconst options = {\n \"method\": \"GET\",\n \"hostname\": \"probabilistic.api.dtn.com\",\n \"port\": null,\n \"path\": \"/v1/probabilistic?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\",\n \"headers\": {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\nconst req = http.request(options, function (res) {\n const chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n const body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n});\n\nreq.end();"
- lang: Node + Request
source: "const request = require('request');\n\nconst options = {\n method: 'GET',\n url: 'https://probabilistic.api.dtn.com/v1/probabilistic',\n qs: {\n lat: 'SOME_NUMBER_VALUE',\n lon: 'SOME_NUMBER_VALUE',\n startTime: 'SOME_STRING_VALUE',\n endTime: 'SOME_STRING_VALUE',\n parameters: 'SOME_ARRAY_VALUE',\n units: 'SOME_STRING_VALUE'\n },\n headers: {\n 'Accept-Encoding': 'SOME_STRING_VALUE',\n Accept: 'SOME_STRING_VALUE',\n Authorization: 'Bearer REPLACE_BEARER_TOKEN'\n }\n};\n\nrequest(options, function (error, response, body) {\n if (error) throw new Error(error);\n\n console.log(body);\n});\n"
- lang: Node + Unirest
source: "const unirest = require(\"unirest\");\n\nconst req = unirest(\"GET\", \"https://probabilistic.api.dtn.com/v1/probabilistic\");\n\nreq.query({\n \"lat\": \"SOME_NUMBER_VALUE\",\n \"lon\": \"SOME_NUMBER_VALUE\",\n \"startTime\": \"SOME_STRING_VALUE\",\n \"endTime\": \"SOME_STRING_VALUE\",\n \"parameters\": \"SOME_ARRAY_VALUE\",\n \"units\": \"SOME_STRING_VALUE\"\n});\n\nreq.headers({\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n});\n\nreq.end(function (res) {\n if (res.error) throw new Error(res.error);\n\n console.log(res.body);\n});\n"
- lang: Objc + Nsurlsession
source: "#import \n\nNSDictionary *headers = @{ @\"Accept-Encoding\": @\"SOME_STRING_VALUE\",\n @\"Accept\": @\"SOME_STRING_VALUE\",\n @\"Authorization\": @\"Bearer REPLACE_BEARER_TOKEN\" };\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://probabilistic.api.dtn.com/v1/probabilistic?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\n[request setHTTPMethod:@\"GET\"];\n[request setAllHTTPHeaderFields:headers];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSLog(@\"%@\", httpResponse);\n }\n }];\n[dataTask resume];"
- lang: Ocaml + Cohttp
source: "open Cohttp_lwt_unix\nopen Cohttp\nopen Lwt\n\nlet uri = Uri.of_string \"https://probabilistic.api.dtn.com/v1/probabilistic?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\" in\nlet headers = Header.add_list (Header.init ()) [\n (\"Accept-Encoding\", \"SOME_STRING_VALUE\");\n (\"Accept\", \"SOME_STRING_VALUE\");\n (\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\");\n] in\n\nClient.call ~headers `GET uri\n>>= fun (res, body_stream) ->\n (* Do stuff with the result *)"
- lang: Php + Curl
source: " \"https://probabilistic.api.dtn.com/v1/probabilistic?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"GET\",\n CURLOPT_HTTPHEADER => [\n \"Accept: SOME_STRING_VALUE\",\n \"Accept-Encoding: SOME_STRING_VALUE\",\n \"Authorization: Bearer REPLACE_BEARER_TOKEN\"\n ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n echo \"cURL Error #:\" . $err;\n} else {\n echo $response;\n}"
- lang: Php + Http1
source: "setUrl('https://probabilistic.api.dtn.com/v1/probabilistic');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setQueryData([\n 'lat' => 'SOME_NUMBER_VALUE',\n 'lon' => 'SOME_NUMBER_VALUE',\n 'startTime' => 'SOME_STRING_VALUE',\n 'endTime' => 'SOME_STRING_VALUE',\n 'parameters' => 'SOME_ARRAY_VALUE',\n 'units' => 'SOME_STRING_VALUE'\n]);\n\n$request->setHeaders([\n 'Accept-Encoding' => 'SOME_STRING_VALUE',\n 'Accept' => 'SOME_STRING_VALUE',\n 'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'\n]);\n\ntry {\n $response = $request->send();\n\n echo $response->getBody();\n} catch (HttpException $ex) {\n echo $ex;\n}"
- lang: Php + Http2
source: "setRequestUrl('https://probabilistic.api.dtn.com/v1/probabilistic');\n$request->setRequestMethod('GET');\n$request->setQuery(new http\\QueryString([\n 'lat' => 'SOME_NUMBER_VALUE',\n 'lon' => 'SOME_NUMBER_VALUE',\n 'startTime' => 'SOME_STRING_VALUE',\n 'endTime' => 'SOME_STRING_VALUE',\n 'parameters' => 'SOME_ARRAY_VALUE',\n 'units' => 'SOME_STRING_VALUE'\n]));\n\n$request->setHeaders([\n 'Accept-Encoding' => 'SOME_STRING_VALUE',\n 'Accept' => 'SOME_STRING_VALUE',\n 'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"
- lang: Python + Python3
source: "import http.client\n\nconn = http.client.HTTPSConnection(\"probabilistic.api.dtn.com\")\n\nheaders = {\n 'Accept-Encoding': \"SOME_STRING_VALUE\",\n 'Accept': \"SOME_STRING_VALUE\",\n 'Authorization': \"Bearer REPLACE_BEARER_TOKEN\"\n }\n\nconn.request(\"GET\", \"/v1/probabilistic?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"
- lang: Python + Requests
source: "import requests\n\nurl = \"https://probabilistic.api.dtn.com/v1/probabilistic\"\n\nquerystring = {\"lat\":\"SOME_NUMBER_VALUE\",\"lon\":\"SOME_NUMBER_VALUE\",\"startTime\":\"SOME_STRING_VALUE\",\"endTime\":\"SOME_STRING_VALUE\",\"parameters\":\"SOME_ARRAY_VALUE\",\"units\":\"SOME_STRING_VALUE\"}\n\nheaders = {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\nprint(response.text)"
- lang: Ruby + Native
source: 'require ''uri''
require ''net/http''
require ''openssl''
url = URI("https://probabilistic.api.dtn.com/v1/probabilistic?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["Accept-Encoding"] = ''SOME_STRING_VALUE''
request["Accept"] = ''SOME_STRING_VALUE''
request["Authorization"] = ''Bearer REPLACE_BEARER_TOKEN''
response = http.request(request)
puts response.read_body'
- lang: Shell + Curl
source: "curl --request GET \\\n --url 'https://probabilistic.api.dtn.com/v1/probabilistic?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE' \\\n --header 'Accept: SOME_STRING_VALUE' \\\n --header 'Accept-Encoding: SOME_STRING_VALUE' \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'"
- lang: Shell + Httpie
source: "http GET 'https://probabilistic.api.dtn.com/v1/probabilistic?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE' \\\n Accept:SOME_STRING_VALUE \\\n Accept-Encoding:SOME_STRING_VALUE \\\n Authorization:'Bearer REPLACE_BEARER_TOKEN'"
- lang: Shell + Wget
source: "wget --quiet \\\n --method GET \\\n --header 'Accept-Encoding: SOME_STRING_VALUE' \\\n --header 'Accept: SOME_STRING_VALUE' \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \\\n --output-document \\\n - 'https://probabilistic.api.dtn.com/v1/probabilistic?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE'"
- lang: Swift + Nsurlsession
source: "import Foundation\n\nlet headers = [\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n]\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://probabilistic.api.dtn.com/v1/probabilistic?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\")! as URL,\n cachePolicy: .useProtocolCachePolicy,\n timeoutInterval: 10.0)\nrequest.httpMethod = \"GET\"\nrequest.allHTTPHeaderFields = headers\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n if (error != nil) {\n print(error)\n } else {\n let httpResponse = response as? HTTPURLResponse\n print(httpResponse)\n }\n})\n\ndataTask.resume()"
servers:
- url: https://probabilistic.api.dtn.com
/v1/hub-height-winds/forecast:
get:
tags:
- Endpoints
summary: Hub Height Winds Forecast
description: "This endpoint provides forecast wind parameters from 10-300 meters above ground level for any point on Earth. Specify the location, parameters of interest, and a time range from now until 15 days ahead. The API responds with the requested time series in GeoJSON format.\n\nUse the query string to customize the results in the response body:\n\n * Specify a location as latitude (`lat`) and longitude (`lon`). These are required.\n\n * Specify `parameters` to filter the response to a specific, comma-separated list of environmental parameters. The API returns defaults when this is omitted.\n\n * Specify `startTime` and `endTime` (using [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.8) format) for a forecast time range, or `startTime` alone for just one timestamp.\n\n * Specify `units=us-std` to receive values as United States customary (imperial) units. The API returns metric units by default and when `units=si-std` is expressly requested.\n\n * Specify `interval` to obtain sub-hourly (interpolated) or multi-hour (aggregated) results. The API returns hourly results by default.\n\nAll together, a complete request looks like:\n\n```\nhttps://renewables.api.dtn.com/v1/hub-height-winds/forecast?lat={lat}&lon={lon}&startTime={start_time}&endTime={end_time}&interval={interval}¶meters={param1,param2}&units={units}\n```\n\n### How to change timesteps\n\nTo interpolate to sub-hourly timesteps, specify `interval=15m`, `interval=30m`, or `interval=45m` in the query string. For example:\n\n * `?lat=35.47&lon=-97.51&startTime=2024-10-01T00:00:00Z&endTime=2024-10-10T00:00:00Z&interval=15m¶meters=windDirection10m,windSpeed10m`\n\n * `?lat=35.47&lon=-97.51&startTime=2024-10-01T00:00:00Z&endTime=2024-10-10T00:00:00Z&interval=30m¶meters=windDirection10m,windSpeed10m`\n\n * `?lat=35.47&lon=-97.51&startTime=2024-10-01T00:00:00Z&endTime=2024-10-10T00:00:00Z&interval=45m¶meters=windDirection10m,windSpeed10m`\n\nTo aggregate over multiple hours, specify `interval={n}h` in the query string using a whole number of hours for `{n}`, from 2 to the timespan between `startTime` and `endTime`. Also, substitute the desired aggregation parameter names from the `Parameters` section. For example:\n\n * `?lat=35.47&lon=-97.51&startTime=2024-10-01T00:00:00Z&endTime=2024-10-10T00:00:00Z&interval=2h¶meters=windDirection10mAvg,windSpeed10mMax`\n\n * `?lat=35.47&lon=-97.51&startTime=2024-10-01T00:00:00Z&endTime=2024-10-10T00:00:00Z&interval=6h¶meters=windDirection10mAvg,windSpeed10mMax`\n\n * `?lat=35.47&lon=-97.51&startTime=2024-10-01T00:00:00Z&endTime=2024-10-10T00:00:00Z&interval=24h¶meters=windDirection10mAvg,windSpeed10mMax`\n\nIn special cases, daily aggregations might require local timezone-aware aggregations to account of days with an one extra or less hour. In these cases, specify `interval=1d` along with timezone-aware `startTime` and `endTime` values. For example:\n\n * `?lat=35.47&lon=-97.51&startTime=2024-11-03T00:00:00&endTime=2024-11-04T23:59:59&interval=1d¶meters=windDirection10mAvg,windSpeed10mMax`\n\n * `?lat=35.47&lon=-97.51&startTime=2024-03-09T00:00:00&endTime=2024-03-10T23:59:59&interval=1d¶meters=windDirection10mAvg,windSpeed10mMax`\n\n### How to change timezones\n\nTypically, `startTime` and `endTime` end with `Z` to indicate UTC time. For example:\n\n * `?lat=35.47&lon=-97.51&startTime=2024-10-01T00:00:00Z&endTime=2024-10-10T00:00:00Z`\n\nTo change timezones, specify a UTC offset (such as `+08:00` or `-05:00`) instead of `Z`. Note that the `+` symbol is a special URL character that must be encoded as `%2B`. For example:\n\n * `?lat=35.47&lon=-97.51&startTime=2024-10-01T00:00:00-05:00&endTime=2024-10-10T00:00:00-05:00`\n * `?lat=35.47&lon=-97.51&startTime=2024-10-01T00:00:00%2B08:00&endTime=2024-10-10T00:00:00%2B08:00`\n * `?lat=35.47&lon=-97.51&startTime=2024-10-01T00:00:00-05:00&endTime=2024-10-10T00:00:00%2B08:00`\n\nTo obtain the local timezone at the requested location, omit the suffix entirely. For example:\n\n * `?lat=35.47&lon=-97.51&startTime=2024-10-01T00:00:00&endTime=2024-10-10T00:00:00`\n * Fractional time zones\n + Parameters:\n + **startTime:** 2025-07-04T00:00:00\n + **endTime:** 2025-07-04T23:59:59\n + **interval:** 24h\n + **lat:** 30.251\n + **lon:** 62.569\n \n + Response:\n ```json\n \"properties\": {\n \"2025-07-03T23:30:00+0430\": {\n \"windDirection100mAvg\": 309,\n \"windGust100mMax\": 8.6,\n \"windGust100mMin\": 4.9,\n \"windGust100mAvg\": 6.2,\n \"windSpeed100mMax\": 6.6,\n \"windSpeed100mMin\": 3.2,\n \"windSpeed100mAvg\": 4.3\n },\n \"2025-07-04T23:30:00+0430\": {\n \"windDirection100mAvg\": 325,\n \"windGust100mMax\": 8.1,\n \"windGust100mMin\": 8.1,\n \"windGust100mAvg\": 8.1,\n \"windSpeed100mMax\": 6,\n \"windSpeed100mMin\": 6,\n \"windSpeed100mAvg\": 6\n }\n }\n ```\n * Explanation:\n * **Why** This response seems confusing at first becuase we have 2 data points when we seemingly only requested a single 24 hour interval.\n * **Local Timezone Assumption** When requesting a start and end time that has no timezone, the timezone of the location requested will be used.\n * For the example requested lat/lon the local timezone is UTC+04:30 (fractional timezone)\n * **Inclusive Time Range** startTime is hour inclusive, meaning the API will return data for the top of the requested hour (in UTC).\n * **UTC Conversion** All data is stored in UTC hourly.\n * When we convert these requested timestamps to UTC, `startTime=2025-07-03T19:30:00Z`, `endTime=2025-07-04T19:29:59Z`\n * Since startTime and endTime are `inclusive`, so the time range spans exactly 25 hours, not 24.\n * Changing `endTime` to `2025-07-04T23:00:00` will result in a single interval returned.\n\nIn all cases, timestamps in the API response automatically match the timezone indicated by `startTime`.\n"
operationId: hubHeightWindsForecast
security:
- clientCredentials: []
parameters:
- in: header
name: Accept-Encoding
schema:
type: string
description: Use this request header to communicate which compression algorithms the client understands. The API supports gzip.
example: gzip
- in: header
name: Accept
schema:
type: string
description: Use this request header to specify an acceptable response media type.
example: application/json
- name: lat
in: query
schema:
type: number
format: float
example: 35.47
required: true
- name: lon
in: query
schema:
type: number
format: float
example: -97.51
required: true
- name: startTime
in: query
schema:
type: string
format: date-time
example: '2024-10-01T00:06:10Z'
- name: endTime
in: query
schema:
type: string
format: date-time
example: '2024-10-14T00:06:10Z'
- name: interval
in: query
schema:
type: string
example: 30m
- name: parameters
in: query
style: form
explode: true
schema:
type: array
items:
type: string
example: windSpeed100m,windGust100m,windDirection100m
- name: units
in: query
schema:
type: string
example: us-std
responses:
'200':
description: A successful request.
content:
application/json:
schema:
type: object
properties:
url:
type: string
type:
type: string
features:
type: array
items:
type: object
properties:
type:
type: string
geometry:
type: object
properties:
type:
type: string
coordinates:
type: array
items:
type: number
properties:
type: object
properties:
'2024-10-01T00:00:00Z':
type: object
properties:
windDirection10m:
type: number
windGust10m:
type: number
windSpeed10m:
type: number
windDirection11m:
type: number
windGust11m:
type: number
windSpeed11m:
type: number
windDirection12m:
type: number
windGust12m:
type: number
windSpeed12m:
type: number
windDirection13m:
type: number
windGust13m:
type: number
windSpeed13m:
type: number
windDirection14m:
type: number
windGust14m:
type: number
windSpeed14m:
type: number
windDirection15m:
type: number
windGust15m:
type: number
windSpeed15m:
type: number
windDirection16m:
type: number
windGust16m:
type: number
windSpeed16m:
type: number
windDirection17m:
type: number
windGust17m:
type: number
windSpeed17m:
type: number
windDirection18m:
type: number
windGust18m:
type: number
windSpeed18m:
type: number
windDirection19m:
type: number
windGust19m:
type: number
windSpeed19m:
type: number
windDirection20m:
type: number
windGust20m:
type: number
windSpeed20m:
type: number
windDirection21m:
type: number
windGust21m:
type: number
windSpeed21m:
type: number
windDirection22m:
type: number
windGust22m:
type: number
windSpeed22m:
type: number
windDirection23m:
type: number
windGust23m:
type: number
windSpeed23m:
type: number
windDirection24m:
type: number
windGust24m:
type: number
windSpeed24m:
type: number
windDirection25m:
type: number
windGust25m:
type: number
windSpeed25m:
type: number
windDirection26m:
type: number
windGust26m:
type: number
windSpeed26m:
type: number
windDirection27m:
type: number
windGust27m:
type: number
windSpeed27m:
type: number
windDirection28m:
type: number
windGust28m:
type: number
windSpeed28m:
type: number
windDirection29m:
type: number
windGust29m:
type: number
windSpeed29m:
type: number
windDirection30m:
type: number
windGust30m:
type: number
windSpeed30m:
type: number
windDirection31m:
type: number
windGust31m:
type: number
windSpeed31m:
type: number
windDirection32m:
type: number
windGust32m:
type: number
windSpeed32m:
type: number
windDirection33m:
type: number
windGust33m:
type: number
windSpeed33m:
type: number
windDirection34m:
type: number
windGust34m:
type: number
windSpeed34m:
type: number
windDirection35m:
type: number
windGust35m:
type: number
windSpeed35m:
type: number
windDirection36m:
type: number
windGust36m:
type: number
windSpeed36m:
type: number
windDirection37m:
type: number
windGust37m:
type: number
windSpeed37m:
type: number
windDirection38m:
type: number
windGust38m:
type: number
windSpeed38m:
type: number
windDirection39m:
type: number
windGust39m:
type: number
windSpeed39m:
type: number
windDirection40m:
type: number
windGust40m:
type: number
windSpeed40m:
type: number
windDirection41m:
type: number
windGust41m:
type: number
windSpeed41m:
type: number
windDirection42m:
type: number
windGust42m:
type: number
windSpeed42m:
type: number
windDirection43m:
type: number
windGust43m:
type: number
windSpeed43m:
type: number
windDirection44m:
type: number
windGust44m:
type: number
windSpeed44m:
type: number
windDirection45m:
type: number
windGust45m:
type: number
windSpeed45m:
type: number
windDirection46m:
type: number
windGust46m:
type: number
windSpeed46m:
type: number
windDirection47m:
type: number
windGust47m:
type: number
windSpeed47m:
type: number
windDirection48m:
type: number
windGust48m:
type: number
windSpeed48m:
type: number
windDirection49m:
type: number
windGust49m:
type: number
windSpeed49m:
type: number
windDirection50m:
type: number
windGust50m:
type: number
windSpeed50m:
type: number
windDirection51m:
type: number
windGust51m:
type: number
windSpeed51m:
type: number
windDirection52m:
type: number
windGust52m:
type: number
windSpeed52m:
type: number
windDirection53m:
type: number
windGust53m:
type: number
windSpeed53m:
type: number
windDirection54m:
type: number
windGust54m:
type: number
windSpeed54m:
type: number
windDirection55m:
type: number
windGust55m:
type: number
windSpeed55m:
type: number
windDirection56m:
type: number
windGust56m:
type: number
windSpeed56m:
type: number
windDirection57m:
type: number
windGust57m:
type: number
windSpeed57m:
type: number
windDirection58m:
type: number
windGust58m:
type: number
windSpeed58m:
type: number
windDirection59m:
type: number
windGust59m:
type: number
windSpeed59m:
type: number
windDirection60m:
type: number
windGust60m:
type: number
windSpeed60m:
type: number
windDirection61m:
type: number
windGust61m:
type: number
windSpeed61m:
type: number
windDirection62m:
type: number
windGust62m:
type: number
windSpeed62m:
type: number
windDirection63m:
type: number
windGust63m:
type: number
windSpeed63m:
type: number
windDirection64m:
type: number
windGust64m:
type: number
windSpeed64m:
type: number
windDirection65m:
type: number
windGust65m:
type: number
windSpeed65m:
type: number
windDirection66m:
type: number
windGust66m:
type: number
windSpeed66m:
type: number
windDirection67m:
type: number
windGust67m:
type: number
windSpeed67m:
type: number
windDirection68m:
type: number
windGust68m:
type: number
windSpeed68m:
type: number
windDirection69m:
type: number
windGust69m:
type: number
windSpeed69m:
type: number
windDirection70m:
type: number
windGust70m:
type: number
windSpeed70m:
type: number
windDirection71m:
type: number
windGust71m:
type: number
windSpeed71m:
type: number
windDirection72m:
type: number
windGust72m:
type: number
windSpeed72m:
type: number
windDirection73m:
type: number
windGust73m:
type: number
windSpeed73m:
type: number
windDirection74m:
type: number
windGust74m:
type: number
windSpeed74m:
type: number
windDirection75m:
type: number
windGust75m:
type: number
windSpeed75m:
type: number
windDirection76m:
type: number
windGust76m:
type: number
windSpeed76m:
type: number
windDirection77m:
type: number
windGust77m:
type: number
windSpeed77m:
type: number
windDirection78m:
type: number
windGust78m:
type: number
windSpeed78m:
type: number
windDirection79m:
type: number
windGust79m:
type: number
windSpeed79m:
type: number
windDirection80m:
type: number
windGust80m:
type: number
windSpeed80m:
type: number
windDirection81m:
type: number
windGust81m:
type: number
windSpeed81m:
type: number
windDirection82m:
type: number
windGust82m:
type: number
windSpeed82m:
type: number
windDirection83m:
type: number
windGust83m:
type: number
windSpeed83m:
type: number
windDirection84m:
type: number
windGust84m:
type: number
windSpeed84m:
type: number
windDirection85m:
type: number
windGust85m:
type: number
windSpeed85m:
type: number
windDirection86m:
type: number
windGust86m:
type: number
windSpeed86m:
type: number
windDirection87m:
type: number
windGust87m:
type: number
windSpeed87m:
type: number
windDirection88m:
type: number
windGust88m:
type: number
windSpeed88m:
type: number
windDirection89m:
type: number
windGust89m:
type: number
windSpeed89m:
type: number
windDirection90m:
type: number
windGust90m:
type: number
windSpeed90m:
type: number
windDirection91m:
type: number
windGust91m:
type: number
windSpeed91m:
type: number
windDirection92m:
type: number
windGust92m:
type: number
windSpeed92m:
type: number
windDirection93m:
type: number
windGust93m:
type: number
windSpeed93m:
type: number
windDirection94m:
type: number
windGust94m:
type: number
windSpeed94m:
type: number
windDirection95m:
type: number
windGust95m:
type: number
windSpeed95m:
type: number
windDirection96m:
type: number
windGust96m:
type: number
windSpeed96m:
type: number
windDirection97m:
type: number
windGust97m:
type: number
windSpeed97m:
type: number
windDirection98m:
type: number
windGust98m:
type: number
windSpeed98m:
type: number
windDirection99m:
type: number
windGust99m:
type: number
windSpeed99m:
type: number
windDirection100m:
type: number
windGust100m:
type: number
windSpeed100m:
type: number
windDirection101m:
type: number
windGust101m:
type: number
windSpeed101m:
type: number
windDirection102m:
type: number
windGust102m:
type: number
windSpeed102m:
type: number
windDirection103m:
type: number
windGust103m:
type: number
windSpeed103m:
type: number
windDirection104m:
type: number
windGust104m:
type: number
windSpeed104m:
type: number
windDirection105m:
type: number
windGust105m:
type: number
windSpeed105m:
type: number
windDirection106m:
type: number
windGust106m:
type: number
windSpeed106m:
type: number
windDirection107m:
type: number
windGust107m:
type: number
windSpeed107m:
type: number
windDirection108m:
type: number
windGust108m:
type: number
windSpeed108m:
type: number
windDirection109m:
type: number
windGust109m:
type: number
windSpeed109m:
type: number
windDirection110m:
type: number
windGust110m:
type: number
windSpeed110m:
type: number
windDirection111m:
type: number
windGust111m:
type: number
windSpeed111m:
type: number
windDirection112m:
type: number
windGust112m:
type: number
windSpeed112m:
type: number
windDirection113m:
type: number
windGust113m:
type: number
windSpeed113m:
type: number
windDirection114m:
type: number
windGust114m:
type: number
windSpeed114m:
type: number
windDirection115m:
type: number
windGust115m:
type: number
windSpeed115m:
type: number
windDirection116m:
type: number
windGust116m:
type: number
windSpeed116m:
type: number
windDirection117m:
type: number
windGust117m:
type: number
windSpeed117m:
type: number
windDirection118m:
type: number
windGust118m:
type: number
windSpeed118m:
type: number
windDirection119m:
type: number
windGust119m:
type: number
windSpeed119m:
type: number
windDirection120m:
type: number
windGust120m:
type: number
windSpeed120m:
type: number
windDirection121m:
type: number
windGust121m:
type: number
windSpeed121m:
type: number
windDirection122m:
type: number
windGust122m:
type: number
windSpeed122m:
type: number
windDirection123m:
type: number
windGust123m:
type: number
windSpeed123m:
type: number
windDirection124m:
type: number
windGust124m:
type: number
windSpeed124m:
type: number
windDirection125m:
type: number
windGust125m:
type: number
windSpeed125m:
type: number
windDirection126m:
type: number
windGust126m:
type: number
windSpeed126m:
type: number
windDirection127m:
type: number
windGust127m:
type: number
windSpeed127m:
type: number
windDirection128m:
type: number
windGust128m:
type: number
windSpeed128m:
type: number
windDirection129m:
type: number
windGust129m:
type: number
windSpeed129m:
type: number
windDirection130m:
type: number
windGust130m:
type: number
windSpeed130m:
type: number
windDirection131m:
type: number
windGust131m:
type: number
windSpeed131m:
type: number
windDirection132m:
type: number
windGust132m:
type: number
windSpeed132m:
type: number
windDirection133m:
type: number
windGust133m:
type: number
windSpeed133m:
type: number
windDirection134m:
type: number
windGust134m:
type: number
windSpeed134m:
type: number
windDirection135m:
type: number
windGust135m:
type: number
windSpeed135m:
type: number
windDirection136m:
type: number
windGust136m:
type: number
windSpeed136m:
type: number
windDirection137m:
type: number
windGust137m:
type: number
windSpeed137m:
type: number
windDirection138m:
type: number
windGust138m:
type: number
windSpeed138m:
type: number
windDirection139m:
type: number
windGust139m:
type: number
windSpeed139m:
type: number
windDirection140m:
type: number
windGust140m:
type: number
windSpeed140m:
type: number
windDirection141m:
type: number
windGust141m:
type: number
windSpeed141m:
type: number
windDirection142m:
type: number
windGust142m:
type: number
windSpeed142m:
type: number
windDirection143m:
type: number
windGust143m:
type: number
windSpeed143m:
type: number
windDirection144m:
type: number
windGust144m:
type: number
windSpeed144m:
type: number
windDirection145m:
type: number
windGust145m:
type: number
windSpeed145m:
type: number
windDirection146m:
type: number
windGust146m:
type: number
windSpeed146m:
type: number
windDirection147m:
type: number
windGust147m:
type: number
windSpeed147m:
type: number
windDirection148m:
type: number
windGust148m:
type: number
windSpeed148m:
type: number
windDirection149m:
type: number
windGust149m:
type: number
windSpeed149m:
type: number
windDirection150m:
type: number
windGust150m:
type: number
windSpeed150m:
type: number
windDirection151m:
type: number
windGust151m:
type: number
windSpeed151m:
type: number
windDirection152m:
type: number
windGust152m:
type: number
windSpeed152m:
type: number
windDirection153m:
type: number
windGust153m:
type: number
windSpeed153m:
type: number
windDirection154m:
type: number
windGust154m:
type: number
windSpeed154m:
type: number
windDirection155m:
type: number
windGust155m:
type: number
windSpeed155m:
type: number
windDirection156m:
type: number
windGust156m:
type: number
windSpeed156m:
type: number
windDirection157m:
type: number
windGust157m:
type: number
windSpeed157m:
type: number
windDirection158m:
type: number
windGust158m:
type: number
windSpeed158m:
type: number
windDirection159m:
type: number
windGust159m:
type: number
windSpeed159m:
type: number
windDirection160m:
type: number
windGust160m:
type: number
windSpeed160m:
type: number
windDirection161m:
type: number
windGust161m:
type: number
windSpeed161m:
type: number
windDirection162m:
type: number
windGust162m:
type: number
windSpeed162m:
type: number
windDirection163m:
type: number
windGust163m:
type: number
windSpeed163m:
type: number
windDirection164m:
type: number
windGust164m:
type: number
windSpeed164m:
type: number
windDirection165m:
type: number
windGust165m:
type: number
windSpeed165m:
type: number
windDirection166m:
type: number
windGust166m:
type: number
windSpeed166m:
type: number
windDirection167m:
type: number
windGust167m:
type: number
windSpeed167m:
type: number
windDirection168m:
type: number
windGust168m:
type: number
windSpeed168m:
type: number
windDirection169m:
type: number
windGust169m:
type: number
windSpeed169m:
type: number
windDirection170m:
type: number
windGust170m:
type: number
windSpeed170m:
type: number
windDirection171m:
type: number
windGust171m:
type: number
windSpeed171m:
type: number
windDirection172m:
type: number
windGust172m:
type: number
windSpeed172m:
type: number
windDirection173m:
type: number
windGust173m:
type: number
windSpeed173m:
type: number
windDirection174m:
type: number
windGust174m:
type: number
windSpeed174m:
type: number
windDirection175m:
type: number
windGust175m:
type: number
windSpeed175m:
type: number
windDirection176m:
type: number
windGust176m:
type: number
windSpeed176m:
type: number
windDirection177m:
type: number
windGust177m:
type: number
windSpeed177m:
type: number
windDirection178m:
type: number
windGust178m:
type: number
windSpeed178m:
type: number
windDirection179m:
type: number
windGust179m:
type: number
windSpeed179m:
type: number
windDirection180m:
type: number
windGust180m:
type: number
windSpeed180m:
type: number
windDirection181m:
type: number
windGust181m:
type: number
windSpeed181m:
type: number
windDirection182m:
type: number
windGust182m:
type: number
windSpeed182m:
type: number
windDirection183m:
type: number
windGust183m:
type: number
windSpeed183m:
type: number
windDirection184m:
type: number
windGust184m:
type: number
windSpeed184m:
type: number
windDirection185m:
type: number
windGust185m:
type: number
windSpeed185m:
type: number
windDirection186m:
type: number
windGust186m:
type: number
windSpeed186m:
type: number
windDirection187m:
type: number
windGust187m:
type: number
windSpeed187m:
type: number
windDirection188m:
type: number
windGust188m:
type: number
windSpeed188m:
type: number
windDirection189m:
type: number
windGust189m:
type: number
windSpeed189m:
type: number
windDirection190m:
type: number
windGust190m:
type: number
windSpeed190m:
type: number
windDirection191m:
type: number
windGust191m:
type: number
windSpeed191m:
type: number
windDirection192m:
type: number
windGust192m:
type: number
windSpeed192m:
type: number
windDirection193m:
type: number
windGust193m:
type: number
windSpeed193m:
type: number
windDirection194m:
type: number
windGust194m:
type: number
windSpeed194m:
type: number
windDirection195m:
type: number
windGust195m:
type: number
windSpeed195m:
type: number
windDirection196m:
type: number
windGust196m:
type: number
windSpeed196m:
type: number
windDirection197m:
type: number
windGust197m:
type: number
windSpeed197m:
type: number
windDirection198m:
type: number
windGust198m:
type: number
windSpeed198m:
type: number
windDirection199m:
type: number
windGust199m:
type: number
windSpeed199m:
type: number
windDirection200m:
type: number
windGust200m:
type: number
windSpeed200m:
type: number
windSpeed10mLowerBound:
type: number
windSpeed10mUpperBound:
type: number
windSpeed100mLowerBound:
type: number
windSpeed100mUpperBound:
type: number
example:
url: https://renewables.api.dtn.com/v1/hub-height-winds/forecast?lat=35.47&lon=-97.51¶meters=windDirection10m,windGust10m,windSpeed10m,windSpeed10mLowerBound,windSpeed10mUpperBound,windDirection100m,windGust100m,windSpeed100m,windSpeed100mLowerBound,windSpeed100mUpperBound&startTime=2024-10-01T00:06:10Z&endTime=2024-10-01T02:06:10Z&units=us-std
type: FeatureCollection
features:
- type: Feature
geometry:
type: Point
coordinates:
- -97.51
- 35.47
properties:
'2024-10-01T00:00:00Z':
windDirection10m: 139.1
windGust10m: 18.34
windSpeed10m: 11.59
windSpeed10mLowerBound: 10.15
windSpeed10mUpperBound: 22.57
windDirection100m: 145.7
windGust100m: 90.68
windSpeed100m: 84.29
windSpeed100mLowerBound: 82.13
windSpeed100mUpperBound: 86.81
'2024-10-01T01:00:00Z':
windDirection10m: 133.9
windGust10m: 18.72
windSpeed10m: 10.65
windSpeed10mLowerBound: 9.14
windSpeed10mUpperBound: 15.75
windDirection100m: 140.5
windGust100m: 89.16
windSpeed100m: 80.69
windSpeed100mLowerBound: 77.45
windSpeed100mUpperBound: 83.39
'2024-10-01T02:00:00Z':
windDirection10m: 136.5
windGust10m: 19.1
windSpeed10m: 10.92
windSpeed10mLowerBound: 10.38
windSpeed10mUpperBound: 23.49
windDirection100m: 143.9
windGust100m: 85.22
windSpeed100m: 78.71
windSpeed100mLowerBound: 76.19
windSpeed100mUpperBound: 81.41
'400':
description: An invalid request.
content:
application/problem+json:
schema:
type: object
properties:
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
detail:
type: string
description: A human-readable description of the general error.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
errors:
type: array
description: An array of human-readable descriptions of specific errors.
items:
type: object
properties:
message:
type: string
parameter:
type: string
value:
type: array
items:
type: string
additionalProperties: false
example:
type: badRequest
title: Invalid Request
detail: Validation failed.
status: 400
instance: urn:dtn:renewables:/v1/.../forecast:requestId:123e4567-e89b-12d3-a458-426614176000
errors:
- message: 'the following parameters are invalid: invalidParameter1,invalidParameter2'
parameter: parameters
value:
- invalidParameter1
- invalidParameter2
'401':
description: Unable to authenticate credentials.
content:
application/problem+json:
schema:
type: object
properties:
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
detail:
type: string
description: A human-readable description of the general error.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
example:
type: unauthorized
title: Error while authenticating the user.
detail: invalid token
status: 401
instance: urn:dtn:renewables:/v1/.../forecast:requestId:123e4567-e89b-12d3-a458-426614176000
'406':
description: Unable to produce a response matching the Accept request header.
content:
application/problem+json:
schema:
type: object
properties:
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
detail:
type: string
description: A human-readable description of the general error.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
example:
type: notAcceptable
title: Not Acceptable
detail: The Accept header value is invalid or unsupported.
status: 406
instance: urn:dtn:renewables:/v1/.../forecast:requestId:123e4567-e89b-12d3-a458-426614176000
x-codeSamples:
- lang: C + Libcurl
source: 'CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://renewables.api.dtn.com/v1/hub-height-winds/forecast?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&interval=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Accept-Encoding: SOME_STRING_VALUE");
headers = curl_slist_append(headers, "Accept: SOME_STRING_VALUE");
headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);'
- lang: Csharp + Restsharp
source: 'var client = new RestClient("https://renewables.api.dtn.com/v1/hub-height-winds/forecast?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&interval=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept-Encoding", "SOME_STRING_VALUE");
request.AddHeader("Accept", "SOME_STRING_VALUE");
request.AddHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
IRestResponse response = client.Execute(request);'
- lang: Go + Native
source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://renewables.api.dtn.com/v1/hub-height-winds/forecast?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&interval=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n\treq.Header.Add(\"Accept\", \"SOME_STRING_VALUE\")\n\treq.Header.Add(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
- lang: Java + Okhttp
source: "OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n .url(\"https://renewables.api.dtn.com/v1/hub-height-winds/forecast?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&interval=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\")\n .get()\n .addHeader(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n .addHeader(\"Accept\", \"SOME_STRING_VALUE\")\n .addHeader(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n .build();\n\nResponse response = client.newCall(request).execute();"
- lang: Java + Unirest
source: "HttpResponse response = Unirest.get(\"https://renewables.api.dtn.com/v1/hub-height-winds/forecast?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&interval=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\")\n .header(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n .header(\"Accept\", \"SOME_STRING_VALUE\")\n .header(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n .asString();"
- lang: Javascript + Jquery
source: "const settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://renewables.api.dtn.com/v1/hub-height-winds/forecast?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&interval=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\",\n \"method\": \"GET\",\n \"headers\": {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\n$.ajax(settings).done(function (response) {\n console.log(response);\n});"
- lang: Javascript + Xhr
source: "const data = null;\n\nconst xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === this.DONE) {\n console.log(this.responseText);\n }\n});\n\nxhr.open(\"GET\", \"https://renewables.api.dtn.com/v1/hub-height-winds/forecast?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&interval=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\");\nxhr.setRequestHeader(\"Accept-Encoding\", \"SOME_STRING_VALUE\");\nxhr.setRequestHeader(\"Accept\", \"SOME_STRING_VALUE\");\nxhr.setRequestHeader(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\");\n\nxhr.send(data);"
- lang: Javascript + Jquery
source: "const settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://renewables.api.dtn.com/v1/hub-height-winds/forecast?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&interval=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\",\n \"method\": \"GET\",\n \"headers\": {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\n$.ajax(settings).done(function (response) {\n console.log(response);\n});"
- lang: Node + Native
source: "const http = require(\"https\");\n\nconst options = {\n \"method\": \"GET\",\n \"hostname\": \"renewables.api.dtn.com\",\n \"port\": null,\n \"path\": \"/v1/hub-height-winds/forecast?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&interval=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\",\n \"headers\": {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\nconst req = http.request(options, function (res) {\n const chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n const body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n});\n\nreq.end();"
- lang: Node + Request
source: "const request = require('request');\n\nconst options = {\n method: 'GET',\n url: 'https://renewables.api.dtn.com/v1/hub-height-winds/forecast',\n qs: {\n lat: 'SOME_NUMBER_VALUE',\n lon: 'SOME_NUMBER_VALUE',\n startTime: 'SOME_STRING_VALUE',\n endTime: 'SOME_STRING_VALUE',\n interval: 'SOME_STRING_VALUE',\n parameters: 'SOME_ARRAY_VALUE',\n units: 'SOME_STRING_VALUE'\n },\n headers: {\n 'Accept-Encoding': 'SOME_STRING_VALUE',\n Accept: 'SOME_STRING_VALUE',\n Authorization: 'Bearer REPLACE_BEARER_TOKEN'\n }\n};\n\nrequest(options, function (error, response, body) {\n if (error) throw new Error(error);\n\n console.log(body);\n});\n"
- lang: Node + Unirest
source: "const unirest = require(\"unirest\");\n\nconst req = unirest(\"GET\", \"https://renewables.api.dtn.com/v1/hub-height-winds/forecast\");\n\nreq.query({\n \"lat\": \"SOME_NUMBER_VALUE\",\n \"lon\": \"SOME_NUMBER_VALUE\",\n \"startTime\": \"SOME_STRING_VALUE\",\n \"endTime\": \"SOME_STRING_VALUE\",\n \"interval\": \"SOME_STRING_VALUE\",\n \"parameters\": \"SOME_ARRAY_VALUE\",\n \"units\": \"SOME_STRING_VALUE\"\n});\n\nreq.headers({\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n});\n\nreq.end(function (res) {\n if (res.error) throw new Error(res.error);\n\n console.log(res.body);\n});\n"
- lang: Objc + Nsurlsession
source: "#import \n\nNSDictionary *headers = @{ @\"Accept-Encoding\": @\"SOME_STRING_VALUE\",\n @\"Accept\": @\"SOME_STRING_VALUE\",\n @\"Authorization\": @\"Bearer REPLACE_BEARER_TOKEN\" };\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://renewables.api.dtn.com/v1/hub-height-winds/forecast?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&interval=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\n[request setHTTPMethod:@\"GET\"];\n[request setAllHTTPHeaderFields:headers];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSLog(@\"%@\", httpResponse);\n }\n }];\n[dataTask resume];"
- lang: Ocaml + Cohttp
source: "open Cohttp_lwt_unix\nopen Cohttp\nopen Lwt\n\nlet uri = Uri.of_string \"https://renewables.api.dtn.com/v1/hub-height-winds/forecast?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&interval=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\" in\nlet headers = Header.add_list (Header.init ()) [\n (\"Accept-Encoding\", \"SOME_STRING_VALUE\");\n (\"Accept\", \"SOME_STRING_VALUE\");\n (\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\");\n] in\n\nClient.call ~headers `GET uri\n>>= fun (res, body_stream) ->\n (* Do stuff with the result *)"
- lang: Php + Curl
source: " \"https://renewables.api.dtn.com/v1/hub-height-winds/forecast?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&interval=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"GET\",\n CURLOPT_HTTPHEADER => [\n \"Accept: SOME_STRING_VALUE\",\n \"Accept-Encoding: SOME_STRING_VALUE\",\n \"Authorization: Bearer REPLACE_BEARER_TOKEN\"\n ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n echo \"cURL Error #:\" . $err;\n} else {\n echo $response;\n}"
- lang: Php + Http1
source: "setUrl('https://renewables.api.dtn.com/v1/hub-height-winds/forecast');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setQueryData([\n 'lat' => 'SOME_NUMBER_VALUE',\n 'lon' => 'SOME_NUMBER_VALUE',\n 'startTime' => 'SOME_STRING_VALUE',\n 'endTime' => 'SOME_STRING_VALUE',\n 'interval' => 'SOME_STRING_VALUE',\n 'parameters' => 'SOME_ARRAY_VALUE',\n 'units' => 'SOME_STRING_VALUE'\n]);\n\n$request->setHeaders([\n 'Accept-Encoding' => 'SOME_STRING_VALUE',\n 'Accept' => 'SOME_STRING_VALUE',\n 'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'\n]);\n\ntry {\n $response = $request->send();\n\n echo $response->getBody();\n} catch (HttpException $ex) {\n echo $ex;\n}"
- lang: Php + Http2
source: "setRequestUrl('https://renewables.api.dtn.com/v1/hub-height-winds/forecast');\n$request->setRequestMethod('GET');\n$request->setQuery(new http\\QueryString([\n 'lat' => 'SOME_NUMBER_VALUE',\n 'lon' => 'SOME_NUMBER_VALUE',\n 'startTime' => 'SOME_STRING_VALUE',\n 'endTime' => 'SOME_STRING_VALUE',\n 'interval' => 'SOME_STRING_VALUE',\n 'parameters' => 'SOME_ARRAY_VALUE',\n 'units' => 'SOME_STRING_VALUE'\n]));\n\n$request->setHeaders([\n 'Accept-Encoding' => 'SOME_STRING_VALUE',\n 'Accept' => 'SOME_STRING_VALUE',\n 'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"
- lang: Python + Python3
source: "import http.client\n\nconn = http.client.HTTPSConnection(\"renewables.api.dtn.com\")\n\nheaders = {\n 'Accept-Encoding': \"SOME_STRING_VALUE\",\n 'Accept': \"SOME_STRING_VALUE\",\n 'Authorization': \"Bearer REPLACE_BEARER_TOKEN\"\n }\n\nconn.request(\"GET\", \"/v1/hub-height-winds/forecast?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&interval=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"
- lang: Python + Requests
source: "import requests\n\nurl = \"https://renewables.api.dtn.com/v1/hub-height-winds/forecast\"\n\nquerystring = {\"lat\":\"SOME_NUMBER_VALUE\",\"lon\":\"SOME_NUMBER_VALUE\",\"startTime\":\"SOME_STRING_VALUE\",\"endTime\":\"SOME_STRING_VALUE\",\"interval\":\"SOME_STRING_VALUE\",\"parameters\":\"SOME_ARRAY_VALUE\",\"units\":\"SOME_STRING_VALUE\"}\n\nheaders = {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\nprint(response.text)"
- lang: Ruby + Native
source: 'require ''uri''
require ''net/http''
require ''openssl''
url = URI("https://renewables.api.dtn.com/v1/hub-height-winds/forecast?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&interval=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["Accept-Encoding"] = ''SOME_STRING_VALUE''
request["Accept"] = ''SOME_STRING_VALUE''
request["Authorization"] = ''Bearer REPLACE_BEARER_TOKEN''
response = http.request(request)
puts response.read_body'
- lang: Shell + Curl
source: "curl --request GET \\\n --url 'https://renewables.api.dtn.com/v1/hub-height-winds/forecast?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&interval=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE' \\\n --header 'Accept: SOME_STRING_VALUE' \\\n --header 'Accept-Encoding: SOME_STRING_VALUE' \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'"
- lang: Shell + Httpie
source: "http GET 'https://renewables.api.dtn.com/v1/hub-height-winds/forecast?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&interval=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE' \\\n Accept:SOME_STRING_VALUE \\\n Accept-Encoding:SOME_STRING_VALUE \\\n Authorization:'Bearer REPLACE_BEARER_TOKEN'"
- lang: Shell + Wget
source: "wget --quiet \\\n --method GET \\\n --header 'Accept-Encoding: SOME_STRING_VALUE' \\\n --header 'Accept: SOME_STRING_VALUE' \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \\\n --output-document \\\n - 'https://renewables.api.dtn.com/v1/hub-height-winds/forecast?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&interval=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE'"
- lang: Swift + Nsurlsession
source: "import Foundation\n\nlet headers = [\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n]\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://renewables.api.dtn.com/v1/hub-height-winds/forecast?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&interval=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\")! as URL,\n cachePolicy: .useProtocolCachePolicy,\n timeoutInterval: 10.0)\nrequest.httpMethod = \"GET\"\nrequest.allHTTPHeaderFields = headers\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n if (error != nil) {\n print(error)\n } else {\n let httpResponse = response as? HTTPURLResponse\n print(httpResponse)\n }\n})\n\ndataTask.resume()"
servers:
- url: https://renewables.api.dtn.com
/v1/solar-irradiance/forecast:
get:
tags:
- Endpoints
summary: Solar Irradiance Forecast
description: "This endpoint provides forecast solar radiation and related parameters for any point on Earth. Specify the location, parameters of interest, and a time range from now until 15 days ahead. The API responds with the requested time series in GeoJSON format.\n\nUse the query string to customize the results in the response body:\n\n * Specify a location as latitude (`lat`) and longitude (`lon`). These are required.\n\n * Specify `parameters` to filter the response to a specific, comma-separated list of environmental parameters. The API returns defaults when this is omitted.\n\n * Specify `startTime` and `endTime` (using [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.8) format) for a forecast time range, or `startTime` alone for just one timestamp.\n\n * Specify `units=us-std` to receive values as United States customary (imperial) units. The API returns metric units by default and when `units=si-std` is expressly requested.\n\n * Specify `interval` to obtain sub-hourly (interpolated) or multi-hour (aggregated) results. The API returns hourly results by default.\n\nAll together, a complete request looks like:\n\n```\nhttps://renewables.api.dtn.com/v1/solar-irradiance/forecast?lat={lat}&lon={lon}&startTime={start_time}&endTime={end_time}&interval={interval}¶meters={param1,param2}&units={units}\n```\n\n### How to change timesteps\n\nTo interpolate to sub-hourly timesteps, specify `interval=15m`, `interval=30m`, or `interval=45m` in the query string. For example:\n\n * `?lat=35.47&lon=-97.51&startTime=2024-10-01T00:00:00Z&endTime=2024-10-10T00:00:00Z&interval=15m¶meters=directNormalIrradiance,diffuseHorizontalIrradiance`\n\n * `?lat=35.47&lon=-97.51&startTime=2024-10-01T00:00:00Z&endTime=2024-10-10T00:00:00Z&interval=30m¶meters=directNormalIrradiance,diffuseHorizontalIrradiance`\n\n * `?lat=35.47&lon=-97.51&startTime=2024-10-01T00:00:00Z&endTime=2024-10-10T00:00:00Z&interval=45m¶meters=directNormalIrradiance,diffuseHorizontalIrradiance`\n\nTo aggregate over multiple hours, specify `interval={n}h` in the query string using a whole number of hours for `{n}`, from 2 to the timespan between `startTime` and `endTime`. Also, substitute the desired aggregation parameter names from the `Parameters` section. For example:\n\n * `?lat=35.47&lon=-97.51&startTime=2024-10-01T00:00:00Z&endTime=2024-10-10T00:00:00Z&interval=2h¶meters=directNormalIrradianceAvg,diffuseHorizontalIrradianceMax`\n\n * `?lat=35.47&lon=-97.51&startTime=2024-10-01T00:00:00Z&endTime=2024-10-10T00:00:00Z&interval=6h¶meters=directNormalIrradianceAvg,diffuseHorizontalIrradianceMax`\n\n * `?lat=35.47&lon=-97.51&startTime=2024-10-01T00:00:00Z&endTime=2024-10-10T00:00:00Z&interval=24h¶meters=directNormalIrradianceAvg,diffuseHorizontalIrradianceMax`\n\nIn some cases, daily aggregations might require local timezone-aware aggregations to account of days with an one extra or less hour. In these cases, specify `interval=1d` along with timezone-aware `startTime` and `endTime` values. For example:\n\n * `?lat=35.47&lon=-97.51&startTime=2024-11-03T00:00:00&endTime=2024-11-04T23:59:59&interval=1d¶meters=directNormalIrradianceAvg,diffuseHorizontalIrradianceMax`\n\n * `?lat=35.47&lon=-97.51&startTime=2024-03-09T00:00:00&endTime=2024-03-10T23:59:59&interval=1d¶meters=directNormalIrradianceAvg,diffuseHorizontalIrradianceMax`\n\n### How to change timezones\n\nTypically, `startTime` and `endTime` end with `Z` to indicate UTC time. For example:\n\n * `?lat=35.47&lon=-97.51&startTime=2024-10-01T00:00:00Z&endTime=2024-10-10T00:00:00Z`\n\nTo change timezones, specify a UTC offset (such as `+08:00` or `-05:00`) instead of `Z`. Note that the `+` symbol is a special URL character that must be encoded as `%2B`. For example:\n\n * `?lat=35.47&lon=-97.51&startTime=2024-10-01T00:00:00-05:00&endTime=2024-10-10T00:00:00-05:00`\n * `?lat=35.47&lon=-97.51&startTime=2024-10-01T00:00:00%2B08:00&endTime=2024-10-10T00:00:00%2B08:00`\n * `?lat=35.47&lon=-97.51&startTime=2024-10-01T00:00:00-05:00&endTime=2024-10-10T00:00:00%2B08:00`\n\nTo obtain the local timezone at the requested location, omit the suffix entirely. For example:\n\n * `?lat=35.47&lon=-97.51&startTime=2024-10-01T00:00:00&endTime=2024-10-10T00:00:00`\n * Fractional time zones\n + Parameters:\n + **startTime:** 2025-07-04T00:00:00\n + **endTime:** 2025-07-04T23:59:59\n + **interval:** 24h\n + **lat:** 30.251\n + **lon:** 62.569\n \n + Response:\n ```json\n \"properties\": {\n \"2025-07-03T23:30:00+0430\": {\n \"airTempMax\": 40.1,\n },\n \"2025-07-04T23:30:00+0430\": {\n \"airTempMax\": 30.2,\n }\n }\n ```\n * Explanation:\n * **Why** This response seems confusing at first becuase we have 2 data points when we seemingly only requested a single 24 hour interval.\n * **Local Timezone Assumption** When requesting a start and end time that has no timezone, the timezone of the location requested will be used.\n * For the example requested lat/lon the local timezone is UTC+04:30 (fractional timezone)\n * **Inclusive Time Range** startTime is hour inclusive, meaning the API will return data for the top of the requested hour (in UTC).\n * **UTC Conversion** All data is stored in UTC hourly.\n * When we convert these requested timestamps to UTC, `startTime=2025-07-03T19:30:00Z`, `endTime=2025-07-04T19:29:59Z`\n * Since startTime and endTime are `inclusive`, so the time range spans exactly 25 hours, not 24.\n * Changing `endTime` to `2025-07-04T23:00:00` will result in a single interval returned.\n\nIn all cases, timestamps in the API response automatically match the timezone indicated by `startTime`.\n"
operationId: solarIrradianceForecast
security:
- clientCredentials: []
parameters:
- in: header
name: Accept-Encoding
schema:
type: string
description: Use this request header to communicate which compression algorithms the client understands. The API supports gzip.
example: gzip
- in: header
name: Accept
schema:
type: string
description: Use this request header to specify an acceptable response media type.
example: application/json
- name: lat
in: query
schema:
type: number
format: float
example: 35.47
required: true
- name: lon
in: query
schema:
type: number
format: float
example: -97.51
required: true
- name: startTime
in: query
schema:
type: string
format: date-time
example: '2024-10-01T00:06:10Z'
- name: endTime
in: query
schema:
type: string
format: date-time
example: '2024-10-14T00:06:10Z'
- name: interval
in: query
schema:
type: string
example: 30m
- name: parameters
in: query
style: form
explode: true
schema:
type: array
items:
type: string
example: directNormalIrradiance,diffuseHorizontalIrradiance
- name: units
in: query
schema:
type: string
example: us-std
responses:
'200':
description: A successful request.
content:
application/json:
schema:
type: object
properties:
url:
type: string
type:
type: string
features:
type: array
items:
type: object
properties:
type:
type: string
geometry:
type: object
properties:
type:
type: string
coordinates:
type: array
items:
type: number
properties:
type: object
properties:
'2024-10-01T00:00:00Z':
type: object
properties:
airTemp:
type: number
directNormalIrradiance:
type: number
diffuseHorizontalIrradiance:
type: number
shortWaveRadiation:
type: number
snowfallAmount:
type: number
example:
url: https://renewables.api.dtn.com/v1/solar-irradiance/forecast?lat=35.47&lon=-97.51¶meters=airTemp,directNormalIrradiance,diffuseHorizontalIrradiance,shortWaveRadiation,snowfallAmount&startTime=2024-12-01T18:00:00Z&endTime=2024-12-01T20:00:00Z&units=us-std
type: FeatureCollection
features:
- type: Feature
geometry:
type: Point
coordinates:
- -97.51
- 35.47
properties:
'2024-12-01T18:00:00Z':
airTemp: 30.2
directNormalIrradiance: 300
diffuseHorizontalIrradiance: 120
shortWaveRadiation: 420
snowfallAmount: 0.02
'2024-12-01T19:00:00Z':
airTemp: 28.4
directNormalIrradiance: 200
diffuseHorizontalIrradiance: 100
shortWaveRadiation: 300
snowfallAmount: 0.01
'2024-12-01T20:00:00Z':
airTemp: 26.6
directNormalIrradiance: 100
diffuseHorizontalIrradiance: 80
shortWaveRadiation: 180
snowfallAmount: 0.03
'400':
description: An invalid request.
content:
application/problem+json:
schema:
type: object
properties:
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
detail:
type: string
description: A human-readable description of the general error.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
errors:
type: array
description: An array of human-readable descriptions of specific errors.
items:
type: object
properties:
message:
type: string
parameter:
type: string
value:
type: array
items:
type: string
additionalProperties: false
example:
type: badRequest
title: Invalid Request
detail: Validation failed.
status: 400
instance: urn:dtn:renewables:/v1/.../forecast:requestId:123e4567-e89b-12d3-a458-426614176000
errors:
- message: 'the following parameters are invalid: invalidParameter1,invalidParameter2'
parameter: parameters
value:
- invalidParameter1
- invalidParameter2
'401':
description: Unable to authenticate credentials.
content:
application/problem+json:
schema:
type: object
properties:
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
detail:
type: string
description: A human-readable description of the general error.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
example:
type: unauthorized
title: Error while authenticating the user.
detail: invalid token
status: 401
instance: urn:dtn:renewables:/v1/.../forecast:requestId:123e4567-e89b-12d3-a458-426614176000
'406':
description: Unable to produce a response matching the Accept request header.
content:
application/problem+json:
schema:
type: object
properties:
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
detail:
type: string
description: A human-readable description of the general error.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
example:
type: notAcceptable
title: Not Acceptable
detail: The Accept header value is invalid or unsupported.
status: 406
instance: urn:dtn:renewables:/v1/.../forecast:requestId:123e4567-e89b-12d3-a458-426614176000
x-codeSamples:
- lang: C + Libcurl
source: 'CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://renewables.api.dtn.com/v1/solar-irradiance/forecast?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&interval=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Accept-Encoding: SOME_STRING_VALUE");
headers = curl_slist_append(headers, "Accept: SOME_STRING_VALUE");
headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);'
- lang: Csharp + Restsharp
source: 'var client = new RestClient("https://renewables.api.dtn.com/v1/solar-irradiance/forecast?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&interval=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept-Encoding", "SOME_STRING_VALUE");
request.AddHeader("Accept", "SOME_STRING_VALUE");
request.AddHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
IRestResponse response = client.Execute(request);'
- lang: Go + Native
source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://renewables.api.dtn.com/v1/solar-irradiance/forecast?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&interval=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n\treq.Header.Add(\"Accept\", \"SOME_STRING_VALUE\")\n\treq.Header.Add(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
- lang: Java + Okhttp
source: "OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n .url(\"https://renewables.api.dtn.com/v1/solar-irradiance/forecast?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&interval=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\")\n .get()\n .addHeader(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n .addHeader(\"Accept\", \"SOME_STRING_VALUE\")\n .addHeader(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n .build();\n\nResponse response = client.newCall(request).execute();"
- lang: Java + Unirest
source: "HttpResponse response = Unirest.get(\"https://renewables.api.dtn.com/v1/solar-irradiance/forecast?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&interval=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\")\n .header(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n .header(\"Accept\", \"SOME_STRING_VALUE\")\n .header(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n .asString();"
- lang: Javascript + Jquery
source: "const settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://renewables.api.dtn.com/v1/solar-irradiance/forecast?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&interval=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\",\n \"method\": \"GET\",\n \"headers\": {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\n$.ajax(settings).done(function (response) {\n console.log(response);\n});"
- lang: Javascript + Xhr
source: "const data = null;\n\nconst xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === this.DONE) {\n console.log(this.responseText);\n }\n});\n\nxhr.open(\"GET\", \"https://renewables.api.dtn.com/v1/solar-irradiance/forecast?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&interval=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\");\nxhr.setRequestHeader(\"Accept-Encoding\", \"SOME_STRING_VALUE\");\nxhr.setRequestHeader(\"Accept\", \"SOME_STRING_VALUE\");\nxhr.setRequestHeader(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\");\n\nxhr.send(data);"
- lang: Javascript + Jquery
source: "const settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://renewables.api.dtn.com/v1/solar-irradiance/forecast?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&interval=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\",\n \"method\": \"GET\",\n \"headers\": {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\n$.ajax(settings).done(function (response) {\n console.log(response);\n});"
- lang: Node + Native
source: "const http = require(\"https\");\n\nconst options = {\n \"method\": \"GET\",\n \"hostname\": \"renewables.api.dtn.com\",\n \"port\": null,\n \"path\": \"/v1/solar-irradiance/forecast?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&interval=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\",\n \"headers\": {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\nconst req = http.request(options, function (res) {\n const chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n const body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n});\n\nreq.end();"
- lang: Node + Request
source: "const request = require('request');\n\nconst options = {\n method: 'GET',\n url: 'https://renewables.api.dtn.com/v1/solar-irradiance/forecast',\n qs: {\n lat: 'SOME_NUMBER_VALUE',\n lon: 'SOME_NUMBER_VALUE',\n startTime: 'SOME_STRING_VALUE',\n endTime: 'SOME_STRING_VALUE',\n interval: 'SOME_STRING_VALUE',\n parameters: 'SOME_ARRAY_VALUE',\n units: 'SOME_STRING_VALUE'\n },\n headers: {\n 'Accept-Encoding': 'SOME_STRING_VALUE',\n Accept: 'SOME_STRING_VALUE',\n Authorization: 'Bearer REPLACE_BEARER_TOKEN'\n }\n};\n\nrequest(options, function (error, response, body) {\n if (error) throw new Error(error);\n\n console.log(body);\n});\n"
- lang: Node + Unirest
source: "const unirest = require(\"unirest\");\n\nconst req = unirest(\"GET\", \"https://renewables.api.dtn.com/v1/solar-irradiance/forecast\");\n\nreq.query({\n \"lat\": \"SOME_NUMBER_VALUE\",\n \"lon\": \"SOME_NUMBER_VALUE\",\n \"startTime\": \"SOME_STRING_VALUE\",\n \"endTime\": \"SOME_STRING_VALUE\",\n \"interval\": \"SOME_STRING_VALUE\",\n \"parameters\": \"SOME_ARRAY_VALUE\",\n \"units\": \"SOME_STRING_VALUE\"\n});\n\nreq.headers({\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n});\n\nreq.end(function (res) {\n if (res.error) throw new Error(res.error);\n\n console.log(res.body);\n});\n"
- lang: Objc + Nsurlsession
source: "#import \n\nNSDictionary *headers = @{ @\"Accept-Encoding\": @\"SOME_STRING_VALUE\",\n @\"Accept\": @\"SOME_STRING_VALUE\",\n @\"Authorization\": @\"Bearer REPLACE_BEARER_TOKEN\" };\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://renewables.api.dtn.com/v1/solar-irradiance/forecast?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&interval=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\n[request setHTTPMethod:@\"GET\"];\n[request setAllHTTPHeaderFields:headers];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSLog(@\"%@\", httpResponse);\n }\n }];\n[dataTask resume];"
- lang: Ocaml + Cohttp
source: "open Cohttp_lwt_unix\nopen Cohttp\nopen Lwt\n\nlet uri = Uri.of_string \"https://renewables.api.dtn.com/v1/solar-irradiance/forecast?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&interval=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\" in\nlet headers = Header.add_list (Header.init ()) [\n (\"Accept-Encoding\", \"SOME_STRING_VALUE\");\n (\"Accept\", \"SOME_STRING_VALUE\");\n (\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\");\n] in\n\nClient.call ~headers `GET uri\n>>= fun (res, body_stream) ->\n (* Do stuff with the result *)"
- lang: Php + Curl
source: " \"https://renewables.api.dtn.com/v1/solar-irradiance/forecast?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&interval=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"GET\",\n CURLOPT_HTTPHEADER => [\n \"Accept: SOME_STRING_VALUE\",\n \"Accept-Encoding: SOME_STRING_VALUE\",\n \"Authorization: Bearer REPLACE_BEARER_TOKEN\"\n ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n echo \"cURL Error #:\" . $err;\n} else {\n echo $response;\n}"
- lang: Php + Http1
source: "setUrl('https://renewables.api.dtn.com/v1/solar-irradiance/forecast');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setQueryData([\n 'lat' => 'SOME_NUMBER_VALUE',\n 'lon' => 'SOME_NUMBER_VALUE',\n 'startTime' => 'SOME_STRING_VALUE',\n 'endTime' => 'SOME_STRING_VALUE',\n 'interval' => 'SOME_STRING_VALUE',\n 'parameters' => 'SOME_ARRAY_VALUE',\n 'units' => 'SOME_STRING_VALUE'\n]);\n\n$request->setHeaders([\n 'Accept-Encoding' => 'SOME_STRING_VALUE',\n 'Accept' => 'SOME_STRING_VALUE',\n 'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'\n]);\n\ntry {\n $response = $request->send();\n\n echo $response->getBody();\n} catch (HttpException $ex) {\n echo $ex;\n}"
- lang: Php + Http2
source: "setRequestUrl('https://renewables.api.dtn.com/v1/solar-irradiance/forecast');\n$request->setRequestMethod('GET');\n$request->setQuery(new http\\QueryString([\n 'lat' => 'SOME_NUMBER_VALUE',\n 'lon' => 'SOME_NUMBER_VALUE',\n 'startTime' => 'SOME_STRING_VALUE',\n 'endTime' => 'SOME_STRING_VALUE',\n 'interval' => 'SOME_STRING_VALUE',\n 'parameters' => 'SOME_ARRAY_VALUE',\n 'units' => 'SOME_STRING_VALUE'\n]));\n\n$request->setHeaders([\n 'Accept-Encoding' => 'SOME_STRING_VALUE',\n 'Accept' => 'SOME_STRING_VALUE',\n 'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"
- lang: Python + Python3
source: "import http.client\n\nconn = http.client.HTTPSConnection(\"renewables.api.dtn.com\")\n\nheaders = {\n 'Accept-Encoding': \"SOME_STRING_VALUE\",\n 'Accept': \"SOME_STRING_VALUE\",\n 'Authorization': \"Bearer REPLACE_BEARER_TOKEN\"\n }\n\nconn.request(\"GET\", \"/v1/solar-irradiance/forecast?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&interval=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"
- lang: Python + Requests
source: "import requests\n\nurl = \"https://renewables.api.dtn.com/v1/solar-irradiance/forecast\"\n\nquerystring = {\"lat\":\"SOME_NUMBER_VALUE\",\"lon\":\"SOME_NUMBER_VALUE\",\"startTime\":\"SOME_STRING_VALUE\",\"endTime\":\"SOME_STRING_VALUE\",\"interval\":\"SOME_STRING_VALUE\",\"parameters\":\"SOME_ARRAY_VALUE\",\"units\":\"SOME_STRING_VALUE\"}\n\nheaders = {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\nprint(response.text)"
- lang: Ruby + Native
source: 'require ''uri''
require ''net/http''
require ''openssl''
url = URI("https://renewables.api.dtn.com/v1/solar-irradiance/forecast?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&interval=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["Accept-Encoding"] = ''SOME_STRING_VALUE''
request["Accept"] = ''SOME_STRING_VALUE''
request["Authorization"] = ''Bearer REPLACE_BEARER_TOKEN''
response = http.request(request)
puts response.read_body'
- lang: Shell + Curl
source: "curl --request GET \\\n --url 'https://renewables.api.dtn.com/v1/solar-irradiance/forecast?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&interval=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE' \\\n --header 'Accept: SOME_STRING_VALUE' \\\n --header 'Accept-Encoding: SOME_STRING_VALUE' \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'"
- lang: Shell + Httpie
source: "http GET 'https://renewables.api.dtn.com/v1/solar-irradiance/forecast?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&interval=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE' \\\n Accept:SOME_STRING_VALUE \\\n Accept-Encoding:SOME_STRING_VALUE \\\n Authorization:'Bearer REPLACE_BEARER_TOKEN'"
- lang: Shell + Wget
source: "wget --quiet \\\n --method GET \\\n --header 'Accept-Encoding: SOME_STRING_VALUE' \\\n --header 'Accept: SOME_STRING_VALUE' \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \\\n --output-document \\\n - 'https://renewables.api.dtn.com/v1/solar-irradiance/forecast?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&interval=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE'"
- lang: Swift + Nsurlsession
source: "import Foundation\n\nlet headers = [\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n]\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://renewables.api.dtn.com/v1/solar-irradiance/forecast?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&interval=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE\")! as URL,\n cachePolicy: .useProtocolCachePolicy,\n timeoutInterval: 10.0)\nrequest.httpMethod = \"GET\"\nrequest.allHTTPHeaderFields = headers\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n if (error != nil) {\n print(error)\n } else {\n let httpResponse = response as? HTTPURLResponse\n print(httpResponse)\n }\n})\n\ndataTask.resume()"
servers:
- url: https://renewables.api.dtn.com
/v2/conditions:
get:
tags:
- Endpoints
summary: Weather Conditions
description: "This endpoint provides current, forecast, and historical conditions for any specific point on the globe. Specify the location, the weather parameters of interest, and a time range up to 15 days long, from 1995-01-01T00:00:00Z to 15 days in the future. The API responds with the requested time series in GeoJSON format.\n\nCommon uses include weather monitoring, atmospheric research, and localized operations, such as event planning.\n\n## Using timezone offsets\n\nTo change timezones, specify a UTC offset (such as `+08:00` or `-05:00` instead of `Z`) for query parameters `startTime` and `endTime`. Timestamps in the response will automatically match the `startTime` offset. Remove the offset entirely to obtain the local timezone for the requested location.\n\n\n**Important note**: Because the `+` symbol is a special URL character, it must be encoded as `%2B` for use within the query parameter string.\n\n#### Valid examples\n\n* `?startTime=2024-01-01T00:00:00Z&endTime=2024-01-01T23:00:00Z`\n\n* `?startTime=2024-01-01T00:00:00%2B08:00&endTime=2024-01-01T23:00:00%2B02:00`\n\n* `?startTime=2024-01-01T00:00:00-08:00&endTime=2024-01-01T23:00:00-08:00`\n\n* `?startTime=2024-01-01T00:00:00&endTime=2024-01-01T23:00:00`\n\n#### Invalid example\n\n* `?startTime=2024-01-01T00:00:00+08:00&endTime=2024-01-01T23:00:00+08:00` (need to encode `+` as `%2B`)\n\n\n### Latitude and Longitude\n\n**Important note**: Requested latitudes and longitudes in response are rounded to five (5) decimal places when presented in `$.features.*.geometry.coordinates`. Floating point precision might affect the last digit.\n\n### Rounding examples\n\n* 1.5555 => 1.556\n\n* 1.5545 => 1.554\n\n* -1.5555 => -1.556\n\n\n## Query Parameters:\nUse query parameters to control the results in the response body:\n### location\n* Specify a location as latitude (`lat`) and longitude (`lon`).\n\n### parameters\n* Specify `parameters` to filter by specific atmospheric weather parameters. Include multiple as comma-separated values. The API returns only defaults when no specific parameters are requested.\n\n### startTime and endTime\n* Two key parameters are `startTime` and `endTime`. These parameters determine the time range for which the API returns data. Both `startTime` and `endTime` are inclusive, meaning that data at the top of the UTC hour for both timestamps is included in the response.\n\n* API Behavior Based on startTime and endTime:\n\n * **Omitted startTime and endTime:** Returns only current conditions.\n\n * **Both in the Future:** Returns only forecast conditions when both `startTime` and `endTime` are in the future.\n\n * **Both in the Past:** Returns only historical conditions when both `startTime` and `endTime` are in the past.\n\n * **Spanning Past and Future:** Returns historical, current, and forecast conditions when `startTime` is in the past and `endTime` is in the future.\n\n * **Only startTime Specified:** Returns only one timestamp, representing the data at the specified `startTime`.\n\n* Inclusivity of Timestamps\n\n * **Inclusive `startTime` and `endTime`:** Both parameters are inclusive, affecting the total duration and the number of data points returned, especially when using the interval parameter.\n\n * **Effect on Data Retrieval and Aggregation:** The inclusivity can result in additional aggregation periods or data points.\n\n### units\n * Use `units` to request values either as SI (metric) or United States customary (imperial) units.\n + The API returns metric units by default and when `si-std` is specified.\n + The API returns imperial units only when `us-std` is specified.\n\n### interval\n * Specify the `interval` parameter to request aggregated or interpolated data. Aggregated parameters names must also specify aggregation methods such as airTempMax, precipAmountSum, and others listed in the Parameters section.\n + **Format:** The interval for hourly aggregations must be in the format {n}h, where {n} is an integer greater than 1 (e.g., 2h, 6h, or 24h). For local timezone-aware daily aggregations, use '1d'. For interpolations, the following values are supported: 5m, 10m, 15m, 20m, or 30m.\n + **Constraints:** The interval must not exceed the total duration between `startTime` and `endTime`. For '1d' intervals, only local timezones (no UTC offsets) are supported to ensure accurate daily aggregation.\n\n * Aggregation Behavior:\n + **Aggregation Periods:** Data aggregation starts from the specified `startTime`. Each timestamp in the response represents the beginning of an aggregation period. For each interval, the API aggregates data from the timestamp up to (but not including) the next interval's start time.\n + **Final Interval Handling:** If the duration between `startTime` and `endTime` doesn't divide evenly by the interval, the final interval may be shorter. The last data point aggregates up to the inclusive endTime.\n * Interpolation Behavior:\n + **Interpolation Periods:** When using interpolation intervals (5m, 10m, 15m, 20m, 30m), the API generates data points at the specified intervals between `startTime` and `endTime`, including both endpoints.\n + **Data Generation:** The API will generally use linear interpolation between data points except for specific parameters. For parameters that represent accumulations over 1 hour, the API will distribute the accumulated value evenly across the interpolation intervals within that hour. For parameters that represent categorical or periodic data (like angular degrees), the API will use the nearest neighbor value for interpolation.\n * Examples using interval:\n + Example 1: 12-Hour Interval Aggregation\n + Parameters:\n + **startTime:** 2024-11-06T15:00:00Z\n + **endTime:** 2024-11-07T15:00:00Z\n + **interval:** 12h\n + **parameter:** airTempMax\n + Response:\n ```json\n {\n \"properties\": {\n \"2024-11-06T15:00:00Z\": {\n \"airTempMax\": 6.5\n },\n \"2024-11-07T03:00:00Z\": {\n \"airTempMax\": 8.9\n },\n \"2024-11-07T15:00:00Z\": {\n \"airTempMax\": 8.7\n }\n }\n ```\n + Explanation:\n + **First Data Point (2024-11-06T15:00:00Z):** Aggregates data from 2024-11-06T15:00:00Z up to including 2024-11-07T02:00:00Z.\n + **Second Data Point (2024-11-07T03:00:00Z):** Aggregates data from 2024-11-07T03:00:00Z up to including 2024-11-07T14:00:00Z.\n + **Third Data Point (2024-11-07T15:00:00Z):** Since `endTime` is inclusive, this final data point includes data from 2024-11-07T15:00:00Z up to the endTime.\n + Example 2: 24-Hour Interval with Inclusive `endTime`\n + Parameters:\n + **startTime:** 2024-10-23T00:00:00Z\n + **endTime:** 2024-10-24T00:00:00Z\n + **interval:** 24h\n + **parameter:** airTempMax\n + Response:\n ```json\n {\n \"properties\": {\n \"2024-10-23T00:00:00Z\": {\n \"airTempMax\": 19.3\n },\n \"2024-10-24T00:00:00Z\": {\n \"airTempMax\": 10.6\n }\n }\n ```\n + Explanation:\n + **First Data Point (2024-10-23T00:00:00Z):** Aggregates data from 2024-10-23T00:00:00Z up to including 2024-10-24T24:00:00Z.\n + **Second Data Point (2024-10-24T00:00:00Z):** Since endTime is inclusive and matches the start of the next interval, this data point includes data at 2024-10-24T00:00:00Z.\n + **Total Duration:** Due to inclusivity, the time span covers 25 hours, resulting in two data points.\n + Example 3: Adjusting endTime to Control Data Points\n + Objective: Retrieve data for only one day with a single data point.\n + Adjusted endTime: Set to 2024-10-23T23:59:59Z.\n + Parameters:\n + **startTime:** 2024-10-23T00:00:00Z\n + **endTime:** 2024-10-23T23:59:59Z\n + **interval:** 24h\n + **parameter:** airTempMax\n + Response:\n ```json\n \"properties\": {\n \"2024-10-23T00:00:00Z\": {\n \"airTempMax\": 19.3\n }\n }\n ```\n * Explanation:\n * **Single Data Point:** Aggregates data over the 24-hour period without including the next day's data.\n * **Duration:** Exactly 24 hours, resulting in one data point.\n\n + Example 4: Fractional time zones\n + Parameters:\n + **startTime:** 2024-05-27T00:00:00\n + **endTime:** 2024-05-27T23:59:59\n + **interval:** 24h\n + **parameter:** airTempMax\n + **lat:** 30.251\n + **lon:** 62.569\n \n + Response:\n ```json\n \"properties\": {\n \"2024-05-26T23:30:00+0430\": {\n \"airTempMax\": 42.2,\n },\n \"2024-05-27T23:30:00+0430\": {\n \"airTempMax\": 34,\n }\n }\n ```\n * Explanation:\n * **Why** This response seems confusing at first becuase we have 2 data points when we seemingly only requested a single 24 hour interval.\n * **Local Timezone Assumption** When requesting a start and end time that has no timezone, the timezone of the location requested will be used.\n * For the example requested lat/lon the local timezone is UTC+04:30 (fractional timezone)\n * **Inclusive Time Range** startTime is hour inclusive, meaning the API will return data for the top of the requested hour (in UTC).\n * **UTC Conversion** All data is stored in UTC hourly.\n * When we convert these requested timestamps to UTC, `startTime=2024-05-26T19:30:00Z`, `endTime=2024-05-27T19:29:59Z`\n * Since startTime and endTime are `inclusive`, so the time range spans exactly 25 hours, not 24.\n * Changing `endTime` to `2024-05-27T23:00:00` will result in a single interval returned.\n\n + Example 5: Interpolation at 15-minute intervals\n + Parameters:\n + **startTime:** 2024-11-06T15:00:00Z\n + **endTime:** 2024-11-06T16:00:00Z\n + **interval:** 15m\n + **parameter:** airTemp, windDirection, iceLweAmount\n + Response:\n ```json\n {\n \"properties\": {\n \"2024-11-06T15:00:00Z\": {\n \"airTemp\": 5.2,\n \"windDirection\": 342,\n \"iceLweAmount\": 2\n },\n \"2024-11-06T15:15:00Z\": {\n \"airTemp\": 5.5,\n \"windDirection\": 342,\n \"iceLweAmount\": 2\n },\n \"2024-11-06T15:30:00Z\": {\n \"airTemp\": 5.7,\n \"windDirection\": 352,\n \"iceLweAmount\": 2\n },\n \"2024-11-06T15:45:00Z\": {\n \"airTemp\": 6.0,\n \"windDirection\": 352,\n \"iceLweAmount\": 2\n },\n \"2024-11-06T16:00:00Z\": {\n \"airTemp\": 6.2,\n \"windDirection\": 352,\n \"iceLweAmount\": 3\n }\n }\n ```\n + Explanation:\n + airTemp is linearly interpolated between data points.\n + windDirection uses nearest neighbor interpolation because its units is in degrees.\n + iceLweAmount is distributed evenly across the interpolation intervals within the hour, with its original value being 8 at 2024-11-06T15:00:00Z, and 12 at 2024-11-06T16:00:00Z.\n\n\n### Complete example:\n\n`https://weather.api.dtn.com/v2/conditions?lat={lat}&lon={lon}&startTime={start_time}&endTime={end_time}&interval={n}h¶meters={param1,param2}&units={units}`\n"
operationId: weatherConditions
security:
- clientCredentials: []
parameters:
- in: header
name: Accept-Encoding
schema:
type: string
description: Use this request header to communicate which compression algorithms the client understands. The API supports gzip.
example: gzip
- in: header
name: Accept
schema:
type: string
description: Use this request header to specify an acceptable response media type.
example: application/json
- name: lat
in: query
schema:
type: number
format: float
example: 35.47
required: true
- name: lon
in: query
schema:
type: number
format: float
example: -97.51
required: true
- name: startTime
in: query
schema:
type: string
format: date-time
example: '2023-10-01T00:06:10Z'
- name: endTime
in: query
schema:
type: string
format: date-time
example: '2023-10-14T00:06:10Z'
- name: parameters
in: query
style: form
explode: true
schema:
type: array
items:
type: string
example: airTemp,precipAmount,weatherCode
- name: units
in: query
schema:
type: string
example: us-std
- name: interval
in: query
required: false
schema:
type: string
description: Aggregation or interpolation interval (e.g. 2h, 24h, 1d, 15m).
example: 24h
- name: aggregationTimeLabel
in: query
required: false
schema:
type: string
enum:
- start
- end
default: start
description: Controls whether the timestamp in the response represents the start or end of the aggregation window. Only valid when `interval` is specified.
example: end
responses:
'200':
description: A successful request.
content:
application/json:
schema:
type: object
properties:
url:
type: string
type:
type: string
features:
type: array
items:
type: object
properties:
type:
type: string
geometry:
type: object
properties:
type:
type: string
coordinates:
type: array
items:
type: number
properties:
type: object
properties:
'2023-10-01T00:00:00Z':
type: object
properties:
airTemp:
type: number
airTempLowerBound:
type: number
airTempNearGround:
type: number
airTempUpperBound:
type: number
totalCloudCover:
type: number
conditionalPrecipProbFreezing:
type: number
conditionalPrecipProbFrozen:
type: number
conditionalPrecipProbLiquid:
type: number
conditionalPrecipProbRefrozen:
type: number
convectivePrecipAmount:
type: number
dewPoint:
type: number
effectiveCloudCover:
type: number
feelsLikeTemp:
type: number
heatIndex:
type: number
iceAccretionAmount:
type: number
longWaveRadiation:
type: number
mslPressure:
type: number
precipAmount:
type: number
precipAmountMax:
type: number
precipAmountMin:
type: number
precipProb:
type: number
precipType:
type: number
relativeHumidity:
type: number
relativeHumidityUpperBound:
type: number
relativeHumidityLowerBound:
type: number
shortWaveRadiation:
type: number
globalRadiation:
type: number
snowFactor:
type: number
snowfallAmount:
type: number
sunshineDuration:
type: number
surfacePressure:
type: number
uWind:
type: number
visibility:
type: number
visibilityObstructionType:
type: number
vWind:
type: number
weatherCode:
type: number
windChill:
type: number
windDirection:
type: number
windGust:
type: number
windSpeed:
type: number
windSpeed100m:
type: number
windSpeed2m:
type: number
windSpeedLowerBound:
type: number
windSpeedUpperBound:
type: number
example:
url: https://weather.api.dtn.com/v2/conditions?lat=35.47&lon=-97.51¶meters=airTemp,airTempLowerBound,airTempNearGround,airTempUpperBound,totalCloudCover,conditionalPrecipProbFreezing,conditionalPrecipProbFrozen,conditionalPrecipProbLiquid,conditionalPrecipProbRefrozen,convectivePrecipAmount,dewPoint,effectiveCloudCover,feelsLikeTemp,heatIndex,iceAccretionAmount,longWaveRadiation,mslPressure,precipAmount,precipAmountMax,precipAmountMin,precipProb,precipType,relativeHumidity,relativeHumidityUpperBound,relativeHumidityLowerBound,shortWaveRadiation,globalRadiation,snowFactor,snowfallAmount,sunshineDuration,surfacePressure,uWind,visibility,visibilityObstructionType,vWind,weatherCode,windChill,windDirection,windGust,windSpeed,windSpeed100m,windSpeed2m,windSpeedLowerBound,windSpeedUpperBound,windGustLowerBound,windGustUpperBound&startTime=2023-10-01T00:06:10Z&endTime=2023-10-01T02:06:10Z&units=us-std
type: FeatureCollection
features:
- type: Feature
geometry:
type: Point
coordinates:
- -97.51
- 35.47
properties:
'2023-10-01T00:00:00Z':
airTemp: 84.29
airTempLowerBound: 82.13
airTempNearGround: 84.33
airTempUpperBound: 86.81
totalCloudCover: 12.6
conditionalPrecipProbFreezing: 0
conditionalPrecipProbFrozen: 0
conditionalPrecipProbLiquid: 100
conditionalPrecipProbRefrozen: 0
convectivePrecipAmount: 0
dewPoint: 59.45
effectiveCloudCover: 12.6
feelsLikeTemp: 84.12
heatIndex: 84.12
iceAccretionAmount: 0
longWaveRadiation: 397.42
mslPressure: 1014.81
precipAmount: 0
precipAmountMax: 0.01
precipAmountMin: 0
precipProb: 0
precipType: 2
relativeHumidity: 43.15
relativeHumidityUpperBound: 50.21
relativeHumidityLowerBound: 40.44
shortWaveRadiation: 46
globalRadiation: 16.56
snowFactor: 0
snowfallAmount: 0
sunshineDuration: 0
surfacePressure: 972.47
uWind: -7.61
visibility: 10
visibilityObstructionType: 1
vWind: 8.7
weatherCode: 1
windChill: 84.29
windDirection: 139.1
windGust: 18.34
windSpeed: 11.59
windSpeed100m: 18.34
windSpeed2m: 8.18
windSpeedLowerBound: 11.59
windSpeedUpperBound: 22.57
windGustLowerBound: 10.54
windGustUpperBound: 19.53
'2023-10-01T01:00:00Z':
airTemp: 80.69
airTempLowerBound: 77.45
airTempNearGround: 77.62
airTempUpperBound: 83.39
totalCloudCover: 12.9
conditionalPrecipProbFreezing: 0
conditionalPrecipProbFrozen: 0
conditionalPrecipProbLiquid: 100
conditionalPrecipProbRefrozen: 0
convectivePrecipAmount: 0
dewPoint: 60.17
effectiveCloudCover: 12.9
feelsLikeTemp: 81.4
heatIndex: 81.4
iceAccretionAmount: 0
longWaveRadiation: 388.07
mslPressure: 1015.36
precipAmount: 0
precipAmountMax: 0.01
precipAmountMin: 0
precipProb: 0
precipType: 2
relativeHumidity: 49.67
relativeHumidityUpperBound: 52.21
relativeHumidityLowerBound: 46.44
shortWaveRadiation: 0
globalRadiation: 0
snowFactor: 0
snowfallAmount: 0
sunshineDuration: 0
surfacePressure: 972.87
uWind: -7.72
visibility: 10
visibilityObstructionType: 1
vWind: 7.48
weatherCode: 1
windChill: 80.69
windDirection: 133.9
windGust: 18.72
windSpeed: 10.65
windSpeed100m: 21.39
windSpeed2m: 7.36
windSpeedLowerBound: 10.98
windSpeedUpperBound: 23.04
windGustLowerBound: 9.54
windGustUpperBound: 18.53
'2023-10-01T02:00:00Z':
airTemp: 78.71
airTempLowerBound: 76.19
airTempNearGround: 75.54
airTempUpperBound: 81.41
totalCloudCover: 13.3
conditionalPrecipProbFreezing: 0
conditionalPrecipProbFrozen: 0
conditionalPrecipProbLiquid: 100
conditionalPrecipProbRefrozen: 0
convectivePrecipAmount: 0
dewPoint: 60.71
effectiveCloudCover: 13.3
feelsLikeTemp: 78.71
heatIndex: 78.71
iceAccretionAmount: 0
longWaveRadiation: 383.11
mslPressure: 1015.87
precipAmount: 0
precipAmountMax: 0.01
precipAmountMin: 0
precipProb: 0
precipType: 2
relativeHumidity: 54.1
relativeHumidityUpperBound: 57.21
relativeHumidityLowerBound: 50.44
shortWaveRadiation: 0
globalRadiation: 0
snowFactor: 0
snowfallAmount: 0
sunshineDuration: 0
surfacePressure: 973.28
uWind: -7.58
visibility: 10
visibilityObstructionType: 1
vWind: 7.93
weatherCode: 1
windChill: 78.71
windDirection: 136.5
windGust: 19.1
windSpeed: 10.92
windSpeed100m: 22.3
windSpeed2m: 7.63
windSpeedLowerBound: 10.38
windSpeedUpperBound: 23.49
windGustLowerBound: 11.54
windGustUpperBound: 20.53
'400':
description: An invalid request.
content:
application/problem+json:
schema:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: true
example:
type: bad-request
title: Invalid Request
detail: Validation failed.
status: 400
instance: urn:dtn:one-forecast:/v2/conditions:requestId:123e4567-e89b-12d3-a458-426614176000
'401':
description: Unable to authenticate credentials.
content:
application/problem+json:
schema:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: true
example:
type: unauthorized
title: Error while authenticating the user.
detail: invalid token
status: 401
instance: urn:dtn:one-forecast:/v2/conditions:requestId:123e4567-e89b-12d3-a458-426614176000
'406':
description: Unable to produce a response matching the Accept request header.
content:
application/problem+json:
schema:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: true
example:
type: not-acceptable
title: Not Acceptable
detail: The Accept header value is invalid or unsupported.
status: 406
instance: urn:dtn:one-forecast:/v2/conditions:requestId:123e4567-e89b-12d3-a458-426614176000
x-codeSamples:
- lang: C + Libcurl
source: 'CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://weather.api.dtn.com/v2/conditions?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE&interval=SOME_STRING_VALUE&aggregationTimeLabel=SOME_STRING_VALUE");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Accept-Encoding: SOME_STRING_VALUE");
headers = curl_slist_append(headers, "Accept: SOME_STRING_VALUE");
headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);'
- lang: Csharp + Restsharp
source: 'var client = new RestClient("https://weather.api.dtn.com/v2/conditions?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE&interval=SOME_STRING_VALUE&aggregationTimeLabel=SOME_STRING_VALUE");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept-Encoding", "SOME_STRING_VALUE");
request.AddHeader("Accept", "SOME_STRING_VALUE");
request.AddHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
IRestResponse response = client.Execute(request);'
- lang: Go + Native
source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://weather.api.dtn.com/v2/conditions?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE&interval=SOME_STRING_VALUE&aggregationTimeLabel=SOME_STRING_VALUE\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n\treq.Header.Add(\"Accept\", \"SOME_STRING_VALUE\")\n\treq.Header.Add(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
- lang: Java + Okhttp
source: "OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n .url(\"https://weather.api.dtn.com/v2/conditions?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE&interval=SOME_STRING_VALUE&aggregationTimeLabel=SOME_STRING_VALUE\")\n .get()\n .addHeader(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n .addHeader(\"Accept\", \"SOME_STRING_VALUE\")\n .addHeader(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n .build();\n\nResponse response = client.newCall(request).execute();"
- lang: Java + Unirest
source: "HttpResponse response = Unirest.get(\"https://weather.api.dtn.com/v2/conditions?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE&interval=SOME_STRING_VALUE&aggregationTimeLabel=SOME_STRING_VALUE\")\n .header(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n .header(\"Accept\", \"SOME_STRING_VALUE\")\n .header(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n .asString();"
- lang: Javascript + Jquery
source: "const settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://weather.api.dtn.com/v2/conditions?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE&interval=SOME_STRING_VALUE&aggregationTimeLabel=SOME_STRING_VALUE\",\n \"method\": \"GET\",\n \"headers\": {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\n$.ajax(settings).done(function (response) {\n console.log(response);\n});"
- lang: Javascript + Xhr
source: "const data = null;\n\nconst xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === this.DONE) {\n console.log(this.responseText);\n }\n});\n\nxhr.open(\"GET\", \"https://weather.api.dtn.com/v2/conditions?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE&interval=SOME_STRING_VALUE&aggregationTimeLabel=SOME_STRING_VALUE\");\nxhr.setRequestHeader(\"Accept-Encoding\", \"SOME_STRING_VALUE\");\nxhr.setRequestHeader(\"Accept\", \"SOME_STRING_VALUE\");\nxhr.setRequestHeader(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\");\n\nxhr.send(data);"
- lang: Javascript + Jquery
source: "const settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://weather.api.dtn.com/v2/conditions?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE&interval=SOME_STRING_VALUE&aggregationTimeLabel=SOME_STRING_VALUE\",\n \"method\": \"GET\",\n \"headers\": {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\n$.ajax(settings).done(function (response) {\n console.log(response);\n});"
- lang: Node + Native
source: "const http = require(\"https\");\n\nconst options = {\n \"method\": \"GET\",\n \"hostname\": \"weather.api.dtn.com\",\n \"port\": null,\n \"path\": \"/v2/conditions?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE&interval=SOME_STRING_VALUE&aggregationTimeLabel=SOME_STRING_VALUE\",\n \"headers\": {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\nconst req = http.request(options, function (res) {\n const chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n const body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n});\n\nreq.end();"
- lang: Node + Request
source: "const request = require('request');\n\nconst options = {\n method: 'GET',\n url: 'https://weather.api.dtn.com/v2/conditions',\n qs: {\n lat: 'SOME_NUMBER_VALUE',\n lon: 'SOME_NUMBER_VALUE',\n startTime: 'SOME_STRING_VALUE',\n endTime: 'SOME_STRING_VALUE',\n parameters: 'SOME_ARRAY_VALUE',\n units: 'SOME_STRING_VALUE',\n interval: 'SOME_STRING_VALUE',\n aggregationTimeLabel: 'SOME_STRING_VALUE'\n },\n headers: {\n 'Accept-Encoding': 'SOME_STRING_VALUE',\n Accept: 'SOME_STRING_VALUE',\n Authorization: 'Bearer REPLACE_BEARER_TOKEN'\n }\n};\n\nrequest(options, function (error, response, body) {\n if (error) throw new Error(error);\n\n console.log(body);\n});\n"
- lang: Node + Unirest
source: "const unirest = require(\"unirest\");\n\nconst req = unirest(\"GET\", \"https://weather.api.dtn.com/v2/conditions\");\n\nreq.query({\n \"lat\": \"SOME_NUMBER_VALUE\",\n \"lon\": \"SOME_NUMBER_VALUE\",\n \"startTime\": \"SOME_STRING_VALUE\",\n \"endTime\": \"SOME_STRING_VALUE\",\n \"parameters\": \"SOME_ARRAY_VALUE\",\n \"units\": \"SOME_STRING_VALUE\",\n \"interval\": \"SOME_STRING_VALUE\",\n \"aggregationTimeLabel\": \"SOME_STRING_VALUE\"\n});\n\nreq.headers({\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n});\n\nreq.end(function (res) {\n if (res.error) throw new Error(res.error);\n\n console.log(res.body);\n});\n"
- lang: Objc + Nsurlsession
source: "#import \n\nNSDictionary *headers = @{ @\"Accept-Encoding\": @\"SOME_STRING_VALUE\",\n @\"Accept\": @\"SOME_STRING_VALUE\",\n @\"Authorization\": @\"Bearer REPLACE_BEARER_TOKEN\" };\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://weather.api.dtn.com/v2/conditions?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE&interval=SOME_STRING_VALUE&aggregationTimeLabel=SOME_STRING_VALUE\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\n[request setHTTPMethod:@\"GET\"];\n[request setAllHTTPHeaderFields:headers];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSLog(@\"%@\", httpResponse);\n }\n }];\n[dataTask resume];"
- lang: Ocaml + Cohttp
source: "open Cohttp_lwt_unix\nopen Cohttp\nopen Lwt\n\nlet uri = Uri.of_string \"https://weather.api.dtn.com/v2/conditions?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE&interval=SOME_STRING_VALUE&aggregationTimeLabel=SOME_STRING_VALUE\" in\nlet headers = Header.add_list (Header.init ()) [\n (\"Accept-Encoding\", \"SOME_STRING_VALUE\");\n (\"Accept\", \"SOME_STRING_VALUE\");\n (\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\");\n] in\n\nClient.call ~headers `GET uri\n>>= fun (res, body_stream) ->\n (* Do stuff with the result *)"
- lang: Php + Curl
source: " \"https://weather.api.dtn.com/v2/conditions?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE&interval=SOME_STRING_VALUE&aggregationTimeLabel=SOME_STRING_VALUE\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"GET\",\n CURLOPT_HTTPHEADER => [\n \"Accept: SOME_STRING_VALUE\",\n \"Accept-Encoding: SOME_STRING_VALUE\",\n \"Authorization: Bearer REPLACE_BEARER_TOKEN\"\n ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n echo \"cURL Error #:\" . $err;\n} else {\n echo $response;\n}"
- lang: Php + Http1
source: "setUrl('https://weather.api.dtn.com/v2/conditions');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setQueryData([\n 'lat' => 'SOME_NUMBER_VALUE',\n 'lon' => 'SOME_NUMBER_VALUE',\n 'startTime' => 'SOME_STRING_VALUE',\n 'endTime' => 'SOME_STRING_VALUE',\n 'parameters' => 'SOME_ARRAY_VALUE',\n 'units' => 'SOME_STRING_VALUE',\n 'interval' => 'SOME_STRING_VALUE',\n 'aggregationTimeLabel' => 'SOME_STRING_VALUE'\n]);\n\n$request->setHeaders([\n 'Accept-Encoding' => 'SOME_STRING_VALUE',\n 'Accept' => 'SOME_STRING_VALUE',\n 'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'\n]);\n\ntry {\n $response = $request->send();\n\n echo $response->getBody();\n} catch (HttpException $ex) {\n echo $ex;\n}"
- lang: Php + Http2
source: "setRequestUrl('https://weather.api.dtn.com/v2/conditions');\n$request->setRequestMethod('GET');\n$request->setQuery(new http\\QueryString([\n 'lat' => 'SOME_NUMBER_VALUE',\n 'lon' => 'SOME_NUMBER_VALUE',\n 'startTime' => 'SOME_STRING_VALUE',\n 'endTime' => 'SOME_STRING_VALUE',\n 'parameters' => 'SOME_ARRAY_VALUE',\n 'units' => 'SOME_STRING_VALUE',\n 'interval' => 'SOME_STRING_VALUE',\n 'aggregationTimeLabel' => 'SOME_STRING_VALUE'\n]));\n\n$request->setHeaders([\n 'Accept-Encoding' => 'SOME_STRING_VALUE',\n 'Accept' => 'SOME_STRING_VALUE',\n 'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"
- lang: Python + Python3
source: "import http.client\n\nconn = http.client.HTTPSConnection(\"weather.api.dtn.com\")\n\nheaders = {\n 'Accept-Encoding': \"SOME_STRING_VALUE\",\n 'Accept': \"SOME_STRING_VALUE\",\n 'Authorization': \"Bearer REPLACE_BEARER_TOKEN\"\n }\n\nconn.request(\"GET\", \"/v2/conditions?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE&interval=SOME_STRING_VALUE&aggregationTimeLabel=SOME_STRING_VALUE\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"
- lang: Python + Requests
source: "import requests\n\nurl = \"https://weather.api.dtn.com/v2/conditions\"\n\nquerystring = {\"lat\":\"SOME_NUMBER_VALUE\",\"lon\":\"SOME_NUMBER_VALUE\",\"startTime\":\"SOME_STRING_VALUE\",\"endTime\":\"SOME_STRING_VALUE\",\"parameters\":\"SOME_ARRAY_VALUE\",\"units\":\"SOME_STRING_VALUE\",\"interval\":\"SOME_STRING_VALUE\",\"aggregationTimeLabel\":\"SOME_STRING_VALUE\"}\n\nheaders = {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\nprint(response.text)"
- lang: Ruby + Native
source: 'require ''uri''
require ''net/http''
require ''openssl''
url = URI("https://weather.api.dtn.com/v2/conditions?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE&interval=SOME_STRING_VALUE&aggregationTimeLabel=SOME_STRING_VALUE")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["Accept-Encoding"] = ''SOME_STRING_VALUE''
request["Accept"] = ''SOME_STRING_VALUE''
request["Authorization"] = ''Bearer REPLACE_BEARER_TOKEN''
response = http.request(request)
puts response.read_body'
- lang: Shell + Curl
source: "curl --request GET \\\n --url 'https://weather.api.dtn.com/v2/conditions?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE&interval=SOME_STRING_VALUE&aggregationTimeLabel=SOME_STRING_VALUE' \\\n --header 'Accept: SOME_STRING_VALUE' \\\n --header 'Accept-Encoding: SOME_STRING_VALUE' \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'"
- lang: Shell + Httpie
source: "http GET 'https://weather.api.dtn.com/v2/conditions?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE&interval=SOME_STRING_VALUE&aggregationTimeLabel=SOME_STRING_VALUE' \\\n Accept:SOME_STRING_VALUE \\\n Accept-Encoding:SOME_STRING_VALUE \\\n Authorization:'Bearer REPLACE_BEARER_TOKEN'"
- lang: Shell + Wget
source: "wget --quiet \\\n --method GET \\\n --header 'Accept-Encoding: SOME_STRING_VALUE' \\\n --header 'Accept: SOME_STRING_VALUE' \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \\\n --output-document \\\n - 'https://weather.api.dtn.com/v2/conditions?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE&interval=SOME_STRING_VALUE&aggregationTimeLabel=SOME_STRING_VALUE'"
- lang: Swift + Nsurlsession
source: "import Foundation\n\nlet headers = [\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n]\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://weather.api.dtn.com/v2/conditions?lat=SOME_NUMBER_VALUE&lon=SOME_NUMBER_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE¶meters=SOME_ARRAY_VALUE&units=SOME_STRING_VALUE&interval=SOME_STRING_VALUE&aggregationTimeLabel=SOME_STRING_VALUE\")! as URL,\n cachePolicy: .useProtocolCachePolicy,\n timeoutInterval: 10.0)\nrequest.httpMethod = \"GET\"\nrequest.allHTTPHeaderFields = headers\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n if (error != nil) {\n print(error)\n } else {\n let httpResponse = response as? HTTPURLResponse\n print(httpResponse)\n }\n})\n\ndataTask.resume()"
servers:
- url: https://weather.api.dtn.com
/v2/conditions/parameters:
get:
tags:
- Endpoints
summary: Weather Parameters
description: "This endpoint provides helpful context in JSON format about the atmospheric weather parameters and operations that the other endpoints support.\n\nUse query parameters to control the results in the response body:\n * Set `category` to `current-conditions`, `hourly-forecast`, or `hourly-historical` to filter atmospheric parameters by that category.\n * Specify a `name` to filter atmospheric parameters by that name (e.g., `name=airTemp`).\n * Specify a `category` and `name` to filter by both.\n * Omit all query parameters to obtain all atmospheric parameters in the response.\n"
operationId: weatherParameters
security:
- clientCredentials: []
parameters:
- in: header
name: Accept-Encoding
schema:
type: string
description: Use this request header to communicate which compression algorithms the client understands. The API supports gzip.
example: gzip
- in: header
name: Accept
schema:
type: string
description: Use this request header to specify an acceptable response media type.
example: application/json
- in: query
name: category
schema:
type: string
description: The desired category filter (optional).
example:
- current-conditions
- in: query
name: name
schema:
type: string
description: The desired parameter name filter (optional).
example:
- airTemp
responses:
'200':
description: A successful request.
content:
application/json:
schema:
type: object
properties:
current-conditions:
type: object
properties:
parameter name:
type: object
description: The name of the parameter.
properties:
metricUnit:
type: string
description: The metric unit used for this parameter.
imperialUnit:
type: string
description: The imperial unit used for this parameter.
type:
type: string
description: The parameter type.
description:
type: string
description: A description of what this parameter means.
notes:
type: string
description: Additional information related to this parameter.
example:
airTemp:
metricUnit: Celsius
imperialUnit: Fahrenheit
type: number
description: Air temperature at 2 meters above ground level.
notes: ''
hourly-forecast:
type: object
properties:
parameter name:
type: object
description: The name of the parameter.
properties:
metricUnit:
type: string
description: The metric unit used for this parameter.
imperialUnit:
type: string
description: The imperial unit used for this parameter.
type:
type: string
description: The parameter type.
description:
type: string
description: A description of what this parameter means.
notes:
type: string
description: Additional information related to this parameter.
aggregationMethods:
type: array
items:
type: string
description: Aggregation methods available to the parameter.
example:
airTemp:
metricUnit: Celsius
imperialUnit: Fahrenheit
type: number
description: Air temperature at 2 meters above ground level.
notes: ''
aggregationMethods:
- Max
- Min
- Avg
hourly-historical:
type: object
properties:
parameter name:
type: object
description: The name of the parameter.
properties:
metricUnit:
type: string
description: The metric unit used for this parameter.
imperialUnit:
type: string
description: The imperial unit used for this parameter.
type:
type: string
description: The parameter type.
description:
type: string
description: A description of what this parameter means.
notes:
type: string
description: Additional information related to this parameter.
aggregationMethods:
type: array
items:
type: string
description: Aggregation methods available to the parameter.
example:
airTemp:
metricUnit: Celsius
imperialUnit: Fahrenheit
type: number
description: Air temperature at 2 meters above ground level.
notes: ''
aggregationMethods:
- Max
- Min
- Avg
'400':
description: An invalid request.
content:
application/problem+json:
schema:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: true
example:
type: bad-request
title: Invalid Request
detail: Validation failed.
status: 400
instance: urn:dtn:one-forecast:/v2/conditions:requestId:123e4567-e89b-12d3-a458-426614176000
'401':
description: Unable to authenticate credentials.
content:
application/problem+json:
schema:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: true
example:
type: unauthorized
title: Error while authenticating the user.
detail: invalid token
status: 401
instance: urn:dtn:one-forecast:/v2/conditions:requestId:123e4567-e89b-12d3-a458-426614176000
'406':
description: Unable to produce a response matching the Accept request header.
content:
application/problem+json:
schema:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: true
example:
type: not-acceptable
title: Not Acceptable
detail: The Accept header value is invalid or unsupported.
status: 406
instance: urn:dtn:one-forecast:/v2/conditions:requestId:123e4567-e89b-12d3-a458-426614176000
x-codeSamples:
- lang: C + Libcurl
source: 'CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://weather.api.dtn.com/v2/conditions/parameters?category=current-conditions&name=airTemp");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Accept-Encoding: SOME_STRING_VALUE");
headers = curl_slist_append(headers, "Accept: SOME_STRING_VALUE");
headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);'
- lang: Csharp + Restsharp
source: 'var client = new RestClient("https://weather.api.dtn.com/v2/conditions/parameters?category=current-conditions&name=airTemp");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept-Encoding", "SOME_STRING_VALUE");
request.AddHeader("Accept", "SOME_STRING_VALUE");
request.AddHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
IRestResponse response = client.Execute(request);'
- lang: Go + Native
source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://weather.api.dtn.com/v2/conditions/parameters?category=current-conditions&name=airTemp\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n\treq.Header.Add(\"Accept\", \"SOME_STRING_VALUE\")\n\treq.Header.Add(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
- lang: Java + Okhttp
source: "OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n .url(\"https://weather.api.dtn.com/v2/conditions/parameters?category=current-conditions&name=airTemp\")\n .get()\n .addHeader(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n .addHeader(\"Accept\", \"SOME_STRING_VALUE\")\n .addHeader(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n .build();\n\nResponse response = client.newCall(request).execute();"
- lang: Java + Unirest
source: "HttpResponse response = Unirest.get(\"https://weather.api.dtn.com/v2/conditions/parameters?category=current-conditions&name=airTemp\")\n .header(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n .header(\"Accept\", \"SOME_STRING_VALUE\")\n .header(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n .asString();"
- lang: Javascript + Jquery
source: "const settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://weather.api.dtn.com/v2/conditions/parameters?category=current-conditions&name=airTemp\",\n \"method\": \"GET\",\n \"headers\": {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\n$.ajax(settings).done(function (response) {\n console.log(response);\n});"
- lang: Javascript + Xhr
source: "const data = null;\n\nconst xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === this.DONE) {\n console.log(this.responseText);\n }\n});\n\nxhr.open(\"GET\", \"https://weather.api.dtn.com/v2/conditions/parameters?category=current-conditions&name=airTemp\");\nxhr.setRequestHeader(\"Accept-Encoding\", \"SOME_STRING_VALUE\");\nxhr.setRequestHeader(\"Accept\", \"SOME_STRING_VALUE\");\nxhr.setRequestHeader(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\");\n\nxhr.send(data);"
- lang: Javascript + Jquery
source: "const settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://weather.api.dtn.com/v2/conditions/parameters?category=current-conditions&name=airTemp\",\n \"method\": \"GET\",\n \"headers\": {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\n$.ajax(settings).done(function (response) {\n console.log(response);\n});"
- lang: Node + Native
source: "const http = require(\"https\");\n\nconst options = {\n \"method\": \"GET\",\n \"hostname\": \"weather.api.dtn.com\",\n \"port\": null,\n \"path\": \"/v2/conditions/parameters?category=current-conditions&name=airTemp\",\n \"headers\": {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\nconst req = http.request(options, function (res) {\n const chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n const body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n});\n\nreq.end();"
- lang: Node + Request
source: "const request = require('request');\n\nconst options = {\n method: 'GET',\n url: 'https://weather.api.dtn.com/v2/conditions/parameters',\n qs: {category: 'current-conditions', name: 'airTemp'},\n headers: {\n 'Accept-Encoding': 'SOME_STRING_VALUE',\n Accept: 'SOME_STRING_VALUE',\n Authorization: 'Bearer REPLACE_BEARER_TOKEN'\n }\n};\n\nrequest(options, function (error, response, body) {\n if (error) throw new Error(error);\n\n console.log(body);\n});\n"
- lang: Node + Unirest
source: "const unirest = require(\"unirest\");\n\nconst req = unirest(\"GET\", \"https://weather.api.dtn.com/v2/conditions/parameters\");\n\nreq.query({\n \"category\": \"current-conditions\",\n \"name\": \"airTemp\"\n});\n\nreq.headers({\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n});\n\nreq.end(function (res) {\n if (res.error) throw new Error(res.error);\n\n console.log(res.body);\n});\n"
- lang: Objc + Nsurlsession
source: "#import \n\nNSDictionary *headers = @{ @\"Accept-Encoding\": @\"SOME_STRING_VALUE\",\n @\"Accept\": @\"SOME_STRING_VALUE\",\n @\"Authorization\": @\"Bearer REPLACE_BEARER_TOKEN\" };\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://weather.api.dtn.com/v2/conditions/parameters?category=current-conditions&name=airTemp\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\n[request setHTTPMethod:@\"GET\"];\n[request setAllHTTPHeaderFields:headers];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSLog(@\"%@\", httpResponse);\n }\n }];\n[dataTask resume];"
- lang: Ocaml + Cohttp
source: "open Cohttp_lwt_unix\nopen Cohttp\nopen Lwt\n\nlet uri = Uri.of_string \"https://weather.api.dtn.com/v2/conditions/parameters?category=current-conditions&name=airTemp\" in\nlet headers = Header.add_list (Header.init ()) [\n (\"Accept-Encoding\", \"SOME_STRING_VALUE\");\n (\"Accept\", \"SOME_STRING_VALUE\");\n (\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\");\n] in\n\nClient.call ~headers `GET uri\n>>= fun (res, body_stream) ->\n (* Do stuff with the result *)"
- lang: Php + Curl
source: " \"https://weather.api.dtn.com/v2/conditions/parameters?category=current-conditions&name=airTemp\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"GET\",\n CURLOPT_HTTPHEADER => [\n \"Accept: SOME_STRING_VALUE\",\n \"Accept-Encoding: SOME_STRING_VALUE\",\n \"Authorization: Bearer REPLACE_BEARER_TOKEN\"\n ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n echo \"cURL Error #:\" . $err;\n} else {\n echo $response;\n}"
- lang: Php + Http1
source: "setUrl('https://weather.api.dtn.com/v2/conditions/parameters');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setQueryData([\n 'category' => 'current-conditions',\n 'name' => 'airTemp'\n]);\n\n$request->setHeaders([\n 'Accept-Encoding' => 'SOME_STRING_VALUE',\n 'Accept' => 'SOME_STRING_VALUE',\n 'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'\n]);\n\ntry {\n $response = $request->send();\n\n echo $response->getBody();\n} catch (HttpException $ex) {\n echo $ex;\n}"
- lang: Php + Http2
source: "setRequestUrl('https://weather.api.dtn.com/v2/conditions/parameters');\n$request->setRequestMethod('GET');\n$request->setQuery(new http\\QueryString([\n 'category' => 'current-conditions',\n 'name' => 'airTemp'\n]));\n\n$request->setHeaders([\n 'Accept-Encoding' => 'SOME_STRING_VALUE',\n 'Accept' => 'SOME_STRING_VALUE',\n 'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"
- lang: Python + Python3
source: "import http.client\n\nconn = http.client.HTTPSConnection(\"weather.api.dtn.com\")\n\nheaders = {\n 'Accept-Encoding': \"SOME_STRING_VALUE\",\n 'Accept': \"SOME_STRING_VALUE\",\n 'Authorization': \"Bearer REPLACE_BEARER_TOKEN\"\n }\n\nconn.request(\"GET\", \"/v2/conditions/parameters?category=current-conditions&name=airTemp\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"
- lang: Python + Requests
source: "import requests\n\nurl = \"https://weather.api.dtn.com/v2/conditions/parameters\"\n\nquerystring = {\"category\":\"current-conditions\",\"name\":\"airTemp\"}\n\nheaders = {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\nprint(response.text)"
- lang: Ruby + Native
source: 'require ''uri''
require ''net/http''
require ''openssl''
url = URI("https://weather.api.dtn.com/v2/conditions/parameters?category=current-conditions&name=airTemp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["Accept-Encoding"] = ''SOME_STRING_VALUE''
request["Accept"] = ''SOME_STRING_VALUE''
request["Authorization"] = ''Bearer REPLACE_BEARER_TOKEN''
response = http.request(request)
puts response.read_body'
- lang: Shell + Curl
source: "curl --request GET \\\n --url 'https://weather.api.dtn.com/v2/conditions/parameters?category=current-conditions&name=airTemp' \\\n --header 'Accept: SOME_STRING_VALUE' \\\n --header 'Accept-Encoding: SOME_STRING_VALUE' \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'"
- lang: Shell + Httpie
source: "http GET 'https://weather.api.dtn.com/v2/conditions/parameters?category=current-conditions&name=airTemp' \\\n Accept:SOME_STRING_VALUE \\\n Accept-Encoding:SOME_STRING_VALUE \\\n Authorization:'Bearer REPLACE_BEARER_TOKEN'"
- lang: Shell + Wget
source: "wget --quiet \\\n --method GET \\\n --header 'Accept-Encoding: SOME_STRING_VALUE' \\\n --header 'Accept: SOME_STRING_VALUE' \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \\\n --output-document \\\n - 'https://weather.api.dtn.com/v2/conditions/parameters?category=current-conditions&name=airTemp'"
- lang: Swift + Nsurlsession
source: "import Foundation\n\nlet headers = [\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n]\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://weather.api.dtn.com/v2/conditions/parameters?category=current-conditions&name=airTemp\")! as URL,\n cachePolicy: .useProtocolCachePolicy,\n timeoutInterval: 10.0)\nrequest.httpMethod = \"GET\"\nrequest.allHTTPHeaderFields = headers\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n if (error != nil) {\n print(error)\n } else {\n let httpResponse = response as? HTTPURLResponse\n print(httpResponse)\n }\n})\n\ndataTask.resume()"
servers:
- url: https://weather.api.dtn.com
/v2/conditions/codes:
get:
tags:
- Endpoints
summary: Weather Codes
description: 'This endpoint provides helpful context in JSON format about the weather codes and their descriptions.
'
operationId: weatherCodes
security:
- clientCredentials: []
parameters:
- in: header
name: Accept-Encoding
schema:
type: string
description: Use this request header to communicate which compression algorithms the client understands. The API supports gzip.
example: gzip
- in: header
name: Accept
schema:
type: string
description: Use this request header to specify an acceptable response media type.
example: application/json
responses:
'200':
description: A successful request.
content:
application/json:
schema:
type: object
properties:
weather code:
type: object
description: A Unique value representing the weather condition.
properties:
condition:
type: string
description: Short description of the weather condition.
description:
type: string
description: Description of the weather condition.
example:
'1':
condition: Clear Skies
description: Clouds cover 0-20% of the sky.
'400':
description: An invalid request.
content:
application/problem+json:
schema:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: true
example:
type: bad-request
title: Invalid Request
detail: Validation failed.
status: 400
instance: urn:dtn:one-forecast:/v2/conditions:requestId:123e4567-e89b-12d3-a458-426614176000
'401':
description: Unable to authenticate credentials.
content:
application/problem+json:
schema:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: true
example:
type: unauthorized
title: Error while authenticating the user.
detail: invalid token
status: 401
instance: urn:dtn:one-forecast:/v2/conditions:requestId:123e4567-e89b-12d3-a458-426614176000
'406':
description: Unable to produce a response matching the Accept request header.
content:
application/problem+json:
schema:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: true
example:
type: not-acceptable
title: Not Acceptable
detail: The Accept header value is invalid or unsupported.
status: 406
instance: urn:dtn:one-forecast:/v2/conditions:requestId:123e4567-e89b-12d3-a458-426614176000
x-codeSamples:
- lang: C + Libcurl
source: 'CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://weather.api.dtn.com/v2/conditions/codes");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Accept-Encoding: SOME_STRING_VALUE");
headers = curl_slist_append(headers, "Accept: SOME_STRING_VALUE");
headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);'
- lang: Csharp + Restsharp
source: 'var client = new RestClient("https://weather.api.dtn.com/v2/conditions/codes");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept-Encoding", "SOME_STRING_VALUE");
request.AddHeader("Accept", "SOME_STRING_VALUE");
request.AddHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
IRestResponse response = client.Execute(request);'
- lang: Go + Native
source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://weather.api.dtn.com/v2/conditions/codes\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n\treq.Header.Add(\"Accept\", \"SOME_STRING_VALUE\")\n\treq.Header.Add(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
- lang: Java + Okhttp
source: "OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n .url(\"https://weather.api.dtn.com/v2/conditions/codes\")\n .get()\n .addHeader(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n .addHeader(\"Accept\", \"SOME_STRING_VALUE\")\n .addHeader(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n .build();\n\nResponse response = client.newCall(request).execute();"
- lang: Java + Unirest
source: "HttpResponse response = Unirest.get(\"https://weather.api.dtn.com/v2/conditions/codes\")\n .header(\"Accept-Encoding\", \"SOME_STRING_VALUE\")\n .header(\"Accept\", \"SOME_STRING_VALUE\")\n .header(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n .asString();"
- lang: Javascript + Jquery
source: "const settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://weather.api.dtn.com/v2/conditions/codes\",\n \"method\": \"GET\",\n \"headers\": {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\n$.ajax(settings).done(function (response) {\n console.log(response);\n});"
- lang: Javascript + Xhr
source: "const data = null;\n\nconst xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === this.DONE) {\n console.log(this.responseText);\n }\n});\n\nxhr.open(\"GET\", \"https://weather.api.dtn.com/v2/conditions/codes\");\nxhr.setRequestHeader(\"Accept-Encoding\", \"SOME_STRING_VALUE\");\nxhr.setRequestHeader(\"Accept\", \"SOME_STRING_VALUE\");\nxhr.setRequestHeader(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\");\n\nxhr.send(data);"
- lang: Javascript + Jquery
source: "const settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://weather.api.dtn.com/v2/conditions/codes\",\n \"method\": \"GET\",\n \"headers\": {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\n$.ajax(settings).done(function (response) {\n console.log(response);\n});"
- lang: Node + Native
source: "const http = require(\"https\");\n\nconst options = {\n \"method\": \"GET\",\n \"hostname\": \"weather.api.dtn.com\",\n \"port\": null,\n \"path\": \"/v2/conditions/codes\",\n \"headers\": {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\nconst req = http.request(options, function (res) {\n const chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n const body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n});\n\nreq.end();"
- lang: Node + Request
source: "const request = require('request');\n\nconst options = {\n method: 'GET',\n url: 'https://weather.api.dtn.com/v2/conditions/codes',\n headers: {\n 'Accept-Encoding': 'SOME_STRING_VALUE',\n Accept: 'SOME_STRING_VALUE',\n Authorization: 'Bearer REPLACE_BEARER_TOKEN'\n }\n};\n\nrequest(options, function (error, response, body) {\n if (error) throw new Error(error);\n\n console.log(body);\n});\n"
- lang: Node + Unirest
source: "const unirest = require(\"unirest\");\n\nconst req = unirest(\"GET\", \"https://weather.api.dtn.com/v2/conditions/codes\");\n\nreq.headers({\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n});\n\nreq.end(function (res) {\n if (res.error) throw new Error(res.error);\n\n console.log(res.body);\n});\n"
- lang: Objc + Nsurlsession
source: "#import \n\nNSDictionary *headers = @{ @\"Accept-Encoding\": @\"SOME_STRING_VALUE\",\n @\"Accept\": @\"SOME_STRING_VALUE\",\n @\"Authorization\": @\"Bearer REPLACE_BEARER_TOKEN\" };\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://weather.api.dtn.com/v2/conditions/codes\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\n[request setHTTPMethod:@\"GET\"];\n[request setAllHTTPHeaderFields:headers];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSLog(@\"%@\", httpResponse);\n }\n }];\n[dataTask resume];"
- lang: Ocaml + Cohttp
source: "open Cohttp_lwt_unix\nopen Cohttp\nopen Lwt\n\nlet uri = Uri.of_string \"https://weather.api.dtn.com/v2/conditions/codes\" in\nlet headers = Header.add_list (Header.init ()) [\n (\"Accept-Encoding\", \"SOME_STRING_VALUE\");\n (\"Accept\", \"SOME_STRING_VALUE\");\n (\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\");\n] in\n\nClient.call ~headers `GET uri\n>>= fun (res, body_stream) ->\n (* Do stuff with the result *)"
- lang: Php + Curl
source: " \"https://weather.api.dtn.com/v2/conditions/codes\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"GET\",\n CURLOPT_HTTPHEADER => [\n \"Accept: SOME_STRING_VALUE\",\n \"Accept-Encoding: SOME_STRING_VALUE\",\n \"Authorization: Bearer REPLACE_BEARER_TOKEN\"\n ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n echo \"cURL Error #:\" . $err;\n} else {\n echo $response;\n}"
- lang: Php + Http1
source: "setUrl('https://weather.api.dtn.com/v2/conditions/codes');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setHeaders([\n 'Accept-Encoding' => 'SOME_STRING_VALUE',\n 'Accept' => 'SOME_STRING_VALUE',\n 'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'\n]);\n\ntry {\n $response = $request->send();\n\n echo $response->getBody();\n} catch (HttpException $ex) {\n echo $ex;\n}"
- lang: Php + Http2
source: "setRequestUrl('https://weather.api.dtn.com/v2/conditions/codes');\n$request->setRequestMethod('GET');\n$request->setHeaders([\n 'Accept-Encoding' => 'SOME_STRING_VALUE',\n 'Accept' => 'SOME_STRING_VALUE',\n 'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"
- lang: Python + Python3
source: "import http.client\n\nconn = http.client.HTTPSConnection(\"weather.api.dtn.com\")\n\nheaders = {\n 'Accept-Encoding': \"SOME_STRING_VALUE\",\n 'Accept': \"SOME_STRING_VALUE\",\n 'Authorization': \"Bearer REPLACE_BEARER_TOKEN\"\n }\n\nconn.request(\"GET\", \"/v2/conditions/codes\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"
- lang: Python + Requests
source: "import requests\n\nurl = \"https://weather.api.dtn.com/v2/conditions/codes\"\n\nheaders = {\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n}\n\nresponse = requests.request(\"GET\", url, headers=headers)\n\nprint(response.text)"
- lang: Ruby + Native
source: 'require ''uri''
require ''net/http''
require ''openssl''
url = URI("https://weather.api.dtn.com/v2/conditions/codes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["Accept-Encoding"] = ''SOME_STRING_VALUE''
request["Accept"] = ''SOME_STRING_VALUE''
request["Authorization"] = ''Bearer REPLACE_BEARER_TOKEN''
response = http.request(request)
puts response.read_body'
- lang: Shell + Curl
source: "curl --request GET \\\n --url https://weather.api.dtn.com/v2/conditions/codes \\\n --header 'Accept: SOME_STRING_VALUE' \\\n --header 'Accept-Encoding: SOME_STRING_VALUE' \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'"
- lang: Shell + Httpie
source: "http GET https://weather.api.dtn.com/v2/conditions/codes \\\n Accept:SOME_STRING_VALUE \\\n Accept-Encoding:SOME_STRING_VALUE \\\n Authorization:'Bearer REPLACE_BEARER_TOKEN'"
- lang: Shell + Wget
source: "wget --quiet \\\n --method GET \\\n --header 'Accept-Encoding: SOME_STRING_VALUE' \\\n --header 'Accept: SOME_STRING_VALUE' \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \\\n --output-document \\\n - https://weather.api.dtn.com/v2/conditions/codes"
- lang: Swift + Nsurlsession
source: "import Foundation\n\nlet headers = [\n \"Accept-Encoding\": \"SOME_STRING_VALUE\",\n \"Accept\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n]\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://weather.api.dtn.com/v2/conditions/codes\")! as URL,\n cachePolicy: .useProtocolCachePolicy,\n timeoutInterval: 10.0)\nrequest.httpMethod = \"GET\"\nrequest.allHTTPHeaderFields = headers\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n if (error != nil) {\n print(error)\n } else {\n let httpResponse = response as? HTTPURLResponse\n print(httpResponse)\n }\n})\n\ndataTask.resume()"
servers:
- url: https://weather.api.dtn.com
/v2/conditions/batch:
post:
tags:
- Endpoints
summary: Batch Request
description: "This endpoint provides hourly forecast, current, and historical conditions for any specific point on the globe. You can specify the location(s), the weather parameters of interest, and both the start time from 1995-01-01T00:00:00Z to an end time 15 days in the future. This endpoint supports requests with hourly data for up to two hundred locations. It does not provide aggregated data. The API returns a presigned URL that allows the requested data to be downloaded in a CSV.\n \nCommon uses include weather monitoring, atmospheric research, and localized operations, such as event planning.\n\nQuota calculation: Please note that the quota charged is based on the number of locations in your API request, and not the number of requests. One request with 200 locations uses the same API quota as 200 requests with one location each.\n\n## Query Parameters:\nUser query parameters to control the results in the response body: \n### location\n* Specify a single or multiple locations as latitude (`lat`) and longitude (`lon`). It supports up to 200 unique locations in a single request. \n\n### parameters \n* Specify `parameters` to filter by specific atmospheric weather parameters. Include multiple as comma-separated values. If no parameters are requested, the API will return default parameters. The API supports forecast, current, and historical parameters, but not aggregation parameters.\n\n### startTime and endTime\n* These parameters determine the time range for which the API returns data. Both startTime and endTime are inclusive, meaning that data at both timestamps is included in the response. \n\n* API Behavior based on startTime and endTime: \n\n * **Omitted startTime and endTime:** Returns only current conditions.\n\n * **Both in the Future:** Returns only forecast conditions when both startTime and endTime are in the future.\n\n * **Both in the Past:** Returns only historical conditions when both startTime and endTime are in the past. \n\n * **Spanning Past and Future:** Returns historical, current, and forecast conditions when startTime is in the past and endTime is in the future.\n\n### units\n * Use `units` to request values either as SI (metric) or United States customary (imperial) units.\n + The API returns metric units by default and when `si-std` is specified.\n + The API returns imperial units only when `us-std` is specified.\n\n## Restrictions \n* There is a maximum of two hundred (200) locations. The number of days multiplied by the number of locations cannot exceed 144000. \nIt will return an HTTP 400 response with the following error: \"Maximum of 200 locations OR ((number of days) * (number of locations)) < 144000 is not satisfied.\" \n\n* This endpoint is restricted to a single request per customer at a time. These requests cannot be made concurrently. The API will return an error code until the previous request has finished. If for some reason the first request returns an error, it will still take sixty seconds for the request limit to expire. Afterwards, a new request can be made. \nIt will return an HTTP 429 reponse with the following error: \"You can only use the batch endpoint one (1) request at a time.\"\n\n## Response\n* The API response is a presigned URL that allows the download of a CSV with the requested data. It starts with the latitutde, longtitutde, and valid time followed by the reuqested parameters.\n + Sample CSV Response:\n ```csv\n latitude,longitude,valid_time,airTemp,dewPoint,precipAmount\n 35.4676,-97.5164,1704067200,72.5,68.2,0.0\n 35.4676,-97.5164,1704070800,71.8,67.9,0.1\n 44.9375,-93.201,1704067200,65.3,62.1,0.0\n 44.9375,-93.201,1704070800,64.7,61.8,0.2\n ```\n"
security:
- clientCredentials: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
locations:
type: array
items:
type: object
properties:
lat:
type: number
lon:
type: number
required:
- lat
- lon
example:
- lat: 35.46
lon: -97.51
- lat: 44.93
lon: -93.2
startTime:
type: string
format: date-time
example: '1995-01-01T00:00:00Z'
endTime:
type: string
format: date-time
example: '1995-01-10T00:00:00Z'
parameters:
type: array
items:
type: string
example: airTemp
example:
- airTemp
- dewPoint
- precipAmount
units:
type: string
enum:
- si-std
- us-std
example: si-std
required:
- locations
responses:
'200':
description: Successful response
content:
text/csv:
schema:
type: string
example: "{\n \"url\": \"...\"\n}\n"
'400':
description: An invalid request.
content:
application/problem+json:
schema:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: true
example:
type: bad-request
title: Invalid Request
detail: Validation failed.
status: 400
instance: urn:dtn:one-forecast:/v2/conditions/batch:requestId:78691cec-d741-46a6-baaf-e16282677f1c
errors:
message: Maximum of 200 locations OR ((number of days) * (number of locations)) < 144000 is not satisfied
'401':
description: Unable to authenticate credentials.
content:
application/problem+json:
schema:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: true
example:
type: unauthorized
title: Error while authenticating the user.
detail: invalid token
status: 401
instance: urn:dtn:one-forecast:/v2/conditions:requestId:123e4567-e89b-12d3-a458-426614176000
'429':
description: Too Many Requests
content:
application/problem+json:
schema:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: true
example:
type: forbidden
title: Access to the Requested Resource is Forbidden
status: 429
detail: You can only use the batch endpoint one (1) request at a time.
instance: urn:dtn:one-forecast:/v2/conditions/batch:requestId:71b71774-4754-41aa-9a65-225f9a825c36
x-codeSamples:
- lang: C + Libcurl
source: 'CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "https://weather.api.dtn.com/v2/conditions/batch");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"locations\":[{\"lat\":35.46,\"lon\":-97.51},{\"lat\":44.93,\"lon\":-93.2}],\"startTime\":\"1995-01-01T00:00:00Z\",\"endTime\":\"1995-01-10T00:00:00Z\",\"parameters\":[\"airTemp\",\"dewPoint\",\"precipAmount\"],\"units\":\"si-std\"}");
CURLcode ret = curl_easy_perform(hnd);'
- lang: Csharp + Restsharp
source: 'var client = new RestClient("https://weather.api.dtn.com/v2/conditions/batch");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/json");
request.AddHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
request.AddParameter("application/json", "{\"locations\":[{\"lat\":35.46,\"lon\":-97.51},{\"lat\":44.93,\"lon\":-93.2}],\"startTime\":\"1995-01-01T00:00:00Z\",\"endTime\":\"1995-01-10T00:00:00Z\",\"parameters\":[\"airTemp\",\"dewPoint\",\"precipAmount\"],\"units\":\"si-std\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);'
- lang: Go + Native
source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://weather.api.dtn.com/v2/conditions/batch\"\n\n\tpayload := strings.NewReader(\"{\\\"locations\\\":[{\\\"lat\\\":35.46,\\\"lon\\\":-97.51},{\\\"lat\\\":44.93,\\\"lon\\\":-93.2}],\\\"startTime\\\":\\\"1995-01-01T00:00:00Z\\\",\\\"endTime\\\":\\\"1995-01-10T00:00:00Z\\\",\\\"parameters\\\":[\\\"airTemp\\\",\\\"dewPoint\\\",\\\"precipAmount\\\"],\\\"units\\\":\\\"si-std\\\"}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"content-type\", \"application/json\")\n\treq.Header.Add(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
- lang: Java + Okhttp
source: "OkHttpClient client = new OkHttpClient();\n\nMediaType mediaType = MediaType.parse(\"application/json\");\nRequestBody body = RequestBody.create(mediaType, \"{\\\"locations\\\":[{\\\"lat\\\":35.46,\\\"lon\\\":-97.51},{\\\"lat\\\":44.93,\\\"lon\\\":-93.2}],\\\"startTime\\\":\\\"1995-01-01T00:00:00Z\\\",\\\"endTime\\\":\\\"1995-01-10T00:00:00Z\\\",\\\"parameters\\\":[\\\"airTemp\\\",\\\"dewPoint\\\",\\\"precipAmount\\\"],\\\"units\\\":\\\"si-std\\\"}\");\nRequest request = new Request.Builder()\n .url(\"https://weather.api.dtn.com/v2/conditions/batch\")\n .post(body)\n .addHeader(\"content-type\", \"application/json\")\n .addHeader(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n .build();\n\nResponse response = client.newCall(request).execute();"
- lang: Java + Unirest
source: "HttpResponse response = Unirest.post(\"https://weather.api.dtn.com/v2/conditions/batch\")\n .header(\"content-type\", \"application/json\")\n .header(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\")\n .body(\"{\\\"locations\\\":[{\\\"lat\\\":35.46,\\\"lon\\\":-97.51},{\\\"lat\\\":44.93,\\\"lon\\\":-93.2}],\\\"startTime\\\":\\\"1995-01-01T00:00:00Z\\\",\\\"endTime\\\":\\\"1995-01-10T00:00:00Z\\\",\\\"parameters\\\":[\\\"airTemp\\\",\\\"dewPoint\\\",\\\"precipAmount\\\"],\\\"units\\\":\\\"si-std\\\"}\")\n .asString();"
- lang: Javascript + Jquery
source: "const settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://weather.api.dtn.com/v2/conditions/batch\",\n \"method\": \"POST\",\n \"headers\": {\n \"content-type\": \"application/json\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n },\n \"processData\": false,\n \"data\": \"{\\\"locations\\\":[{\\\"lat\\\":35.46,\\\"lon\\\":-97.51},{\\\"lat\\\":44.93,\\\"lon\\\":-93.2}],\\\"startTime\\\":\\\"1995-01-01T00:00:00Z\\\",\\\"endTime\\\":\\\"1995-01-10T00:00:00Z\\\",\\\"parameters\\\":[\\\"airTemp\\\",\\\"dewPoint\\\",\\\"precipAmount\\\"],\\\"units\\\":\\\"si-std\\\"}\"\n};\n\n$.ajax(settings).done(function (response) {\n console.log(response);\n});"
- lang: Javascript + Xhr
source: "const data = JSON.stringify({\n \"locations\": [\n {\n \"lat\": 35.46,\n \"lon\": -97.51\n },\n {\n \"lat\": 44.93,\n \"lon\": -93.2\n }\n ],\n \"startTime\": \"1995-01-01T00:00:00Z\",\n \"endTime\": \"1995-01-10T00:00:00Z\",\n \"parameters\": [\n \"airTemp\",\n \"dewPoint\",\n \"precipAmount\"\n ],\n \"units\": \"si-std\"\n});\n\nconst xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === this.DONE) {\n console.log(this.responseText);\n }\n});\n\nxhr.open(\"POST\", \"https://weather.api.dtn.com/v2/conditions/batch\");\nxhr.setRequestHeader(\"content-type\", \"application/json\");\nxhr.setRequestHeader(\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\");\n\nxhr.send(data);"
- lang: Javascript + Jquery
source: "const settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://weather.api.dtn.com/v2/conditions/batch\",\n \"method\": \"POST\",\n \"headers\": {\n \"content-type\": \"application/json\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n },\n \"processData\": false,\n \"data\": \"{\\\"locations\\\":[{\\\"lat\\\":35.46,\\\"lon\\\":-97.51},{\\\"lat\\\":44.93,\\\"lon\\\":-93.2}],\\\"startTime\\\":\\\"1995-01-01T00:00:00Z\\\",\\\"endTime\\\":\\\"1995-01-10T00:00:00Z\\\",\\\"parameters\\\":[\\\"airTemp\\\",\\\"dewPoint\\\",\\\"precipAmount\\\"],\\\"units\\\":\\\"si-std\\\"}\"\n};\n\n$.ajax(settings).done(function (response) {\n console.log(response);\n});"
- lang: Node + Native
source: "const http = require(\"https\");\n\nconst options = {\n \"method\": \"POST\",\n \"hostname\": \"weather.api.dtn.com\",\n \"port\": null,\n \"path\": \"/v2/conditions/batch\",\n \"headers\": {\n \"content-type\": \"application/json\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n }\n};\n\nconst req = http.request(options, function (res) {\n const chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n const body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n});\n\nreq.write(JSON.stringify({\n locations: [{lat: 35.46, lon: -97.51}, {lat: 44.93, lon: -93.2}],\n startTime: '1995-01-01T00:00:00Z',\n endTime: '1995-01-10T00:00:00Z',\n parameters: ['airTemp', 'dewPoint', 'precipAmount'],\n units: 'si-std'\n}));\nreq.end();"
- lang: Node + Request
source: "const request = require('request');\n\nconst options = {\n method: 'POST',\n url: 'https://weather.api.dtn.com/v2/conditions/batch',\n headers: {\n 'content-type': 'application/json',\n Authorization: 'Bearer REPLACE_BEARER_TOKEN'\n },\n body: {\n locations: [{lat: 35.46, lon: -97.51}, {lat: 44.93, lon: -93.2}],\n startTime: '1995-01-01T00:00:00Z',\n endTime: '1995-01-10T00:00:00Z',\n parameters: ['airTemp', 'dewPoint', 'precipAmount'],\n units: 'si-std'\n },\n json: true\n};\n\nrequest(options, function (error, response, body) {\n if (error) throw new Error(error);\n\n console.log(body);\n});\n"
- lang: Node + Unirest
source: "const unirest = require(\"unirest\");\n\nconst req = unirest(\"POST\", \"https://weather.api.dtn.com/v2/conditions/batch\");\n\nreq.headers({\n \"content-type\": \"application/json\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n});\n\nreq.type(\"json\");\nreq.send({\n \"locations\": [\n {\n \"lat\": 35.46,\n \"lon\": -97.51\n },\n {\n \"lat\": 44.93,\n \"lon\": -93.2\n }\n ],\n \"startTime\": \"1995-01-01T00:00:00Z\",\n \"endTime\": \"1995-01-10T00:00:00Z\",\n \"parameters\": [\n \"airTemp\",\n \"dewPoint\",\n \"precipAmount\"\n ],\n \"units\": \"si-std\"\n});\n\nreq.end(function (res) {\n if (res.error) throw new Error(res.error);\n\n console.log(res.body);\n});\n"
- lang: Objc + Nsurlsession
source: "#import \n\nNSDictionary *headers = @{ @\"content-type\": @\"application/json\",\n @\"Authorization\": @\"Bearer REPLACE_BEARER_TOKEN\" };\nNSDictionary *parameters = @{ @\"locations\": @[ @{ @\"lat\": @35.46, @\"lon\": @-97.51 }, @{ @\"lat\": @44.93, @\"lon\": @-93.2 } ],\n @\"startTime\": @\"1995-01-01T00:00:00Z\",\n @\"endTime\": @\"1995-01-10T00:00:00Z\",\n @\"parameters\": @[ @\"airTemp\", @\"dewPoint\", @\"precipAmount\" ],\n @\"units\": @\"si-std\" };\n\nNSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://weather.api.dtn.com/v2/conditions/batch\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\n[request setHTTPMethod:@\"POST\"];\n[request setAllHTTPHeaderFields:headers];\n[request setHTTPBody:postData];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\n completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSLog(@\"%@\", httpResponse);\n }\n }];\n[dataTask resume];"
- lang: Ocaml + Cohttp
source: "open Cohttp_lwt_unix\nopen Cohttp\nopen Lwt\n\nlet uri = Uri.of_string \"https://weather.api.dtn.com/v2/conditions/batch\" in\nlet headers = Header.add_list (Header.init ()) [\n (\"content-type\", \"application/json\");\n (\"Authorization\", \"Bearer REPLACE_BEARER_TOKEN\");\n] in\nlet body = Cohttp_lwt_body.of_string \"{\\\"locations\\\":[{\\\"lat\\\":35.46,\\\"lon\\\":-97.51},{\\\"lat\\\":44.93,\\\"lon\\\":-93.2}],\\\"startTime\\\":\\\"1995-01-01T00:00:00Z\\\",\\\"endTime\\\":\\\"1995-01-10T00:00:00Z\\\",\\\"parameters\\\":[\\\"airTemp\\\",\\\"dewPoint\\\",\\\"precipAmount\\\"],\\\"units\\\":\\\"si-std\\\"}\" in\n\nClient.call ~headers ~body `POST uri\n>>= fun (res, body_stream) ->\n (* Do stuff with the result *)"
- lang: Php + Curl
source: " \"https://weather.api.dtn.com/v2/conditions/batch\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_POSTFIELDS => \"{\\\"locations\\\":[{\\\"lat\\\":35.46,\\\"lon\\\":-97.51},{\\\"lat\\\":44.93,\\\"lon\\\":-93.2}],\\\"startTime\\\":\\\"1995-01-01T00:00:00Z\\\",\\\"endTime\\\":\\\"1995-01-10T00:00:00Z\\\",\\\"parameters\\\":[\\\"airTemp\\\",\\\"dewPoint\\\",\\\"precipAmount\\\"],\\\"units\\\":\\\"si-std\\\"}\",\n CURLOPT_HTTPHEADER => [\n \"Authorization: Bearer REPLACE_BEARER_TOKEN\",\n \"content-type: application/json\"\n ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n echo \"cURL Error #:\" . $err;\n} else {\n echo $response;\n}"
- lang: Php + Http1
source: "setUrl('https://weather.api.dtn.com/v2/conditions/batch');\n$request->setMethod(HTTP_METH_POST);\n\n$request->setHeaders([\n 'content-type' => 'application/json',\n 'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'\n]);\n\n$request->setBody('{\"locations\":[{\"lat\":35.46,\"lon\":-97.51},{\"lat\":44.93,\"lon\":-93.2}],\"startTime\":\"1995-01-01T00:00:00Z\",\"endTime\":\"1995-01-10T00:00:00Z\",\"parameters\":[\"airTemp\",\"dewPoint\",\"precipAmount\"],\"units\":\"si-std\"}');\n\ntry {\n $response = $request->send();\n\n echo $response->getBody();\n} catch (HttpException $ex) {\n echo $ex;\n}"
- lang: Php + Http2
source: "append('{\"locations\":[{\"lat\":35.46,\"lon\":-97.51},{\"lat\":44.93,\"lon\":-93.2}],\"startTime\":\"1995-01-01T00:00:00Z\",\"endTime\":\"1995-01-10T00:00:00Z\",\"parameters\":[\"airTemp\",\"dewPoint\",\"precipAmount\"],\"units\":\"si-std\"}');\n\n$request->setRequestUrl('https://weather.api.dtn.com/v2/conditions/batch');\n$request->setRequestMethod('POST');\n$request->setBody($body);\n\n$request->setHeaders([\n 'content-type' => 'application/json',\n 'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"
- lang: Python + Python3
source: "import http.client\n\nconn = http.client.HTTPSConnection(\"weather.api.dtn.com\")\n\npayload = \"{\\\"locations\\\":[{\\\"lat\\\":35.46,\\\"lon\\\":-97.51},{\\\"lat\\\":44.93,\\\"lon\\\":-93.2}],\\\"startTime\\\":\\\"1995-01-01T00:00:00Z\\\",\\\"endTime\\\":\\\"1995-01-10T00:00:00Z\\\",\\\"parameters\\\":[\\\"airTemp\\\",\\\"dewPoint\\\",\\\"precipAmount\\\"],\\\"units\\\":\\\"si-std\\\"}\"\n\nheaders = {\n 'content-type': \"application/json\",\n 'Authorization': \"Bearer REPLACE_BEARER_TOKEN\"\n }\n\nconn.request(\"POST\", \"/v2/conditions/batch\", payload, headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"
- lang: Python + Requests
source: "import requests\n\nurl = \"https://weather.api.dtn.com/v2/conditions/batch\"\n\npayload = {\n \"locations\": [\n {\n \"lat\": 35.46,\n \"lon\": -97.51\n },\n {\n \"lat\": 44.93,\n \"lon\": -93.2\n }\n ],\n \"startTime\": \"1995-01-01T00:00:00Z\",\n \"endTime\": \"1995-01-10T00:00:00Z\",\n \"parameters\": [\"airTemp\", \"dewPoint\", \"precipAmount\"],\n \"units\": \"si-std\"\n}\nheaders = {\n \"content-type\": \"application/json\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\nprint(response.text)"
- lang: Ruby + Native
source: 'require ''uri''
require ''net/http''
require ''openssl''
url = URI("https://weather.api.dtn.com/v2/conditions/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["content-type"] = ''application/json''
request["Authorization"] = ''Bearer REPLACE_BEARER_TOKEN''
request.body = "{\"locations\":[{\"lat\":35.46,\"lon\":-97.51},{\"lat\":44.93,\"lon\":-93.2}],\"startTime\":\"1995-01-01T00:00:00Z\",\"endTime\":\"1995-01-10T00:00:00Z\",\"parameters\":[\"airTemp\",\"dewPoint\",\"precipAmount\"],\"units\":\"si-std\"}"
response = http.request(request)
puts response.read_body'
- lang: Shell + Curl
source: "curl --request POST \\\n --url https://weather.api.dtn.com/v2/conditions/batch \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \\\n --header 'content-type: application/json' \\\n --data '{\"locations\":[{\"lat\":35.46,\"lon\":-97.51},{\"lat\":44.93,\"lon\":-93.2}],\"startTime\":\"1995-01-01T00:00:00Z\",\"endTime\":\"1995-01-10T00:00:00Z\",\"parameters\":[\"airTemp\",\"dewPoint\",\"precipAmount\"],\"units\":\"si-std\"}'"
- lang: Shell + Httpie
source: "echo '{\"locations\":[{\"lat\":35.46,\"lon\":-97.51},{\"lat\":44.93,\"lon\":-93.2}],\"startTime\":\"1995-01-01T00:00:00Z\",\"endTime\":\"1995-01-10T00:00:00Z\",\"parameters\":[\"airTemp\",\"dewPoint\",\"precipAmount\"],\"units\":\"si-std\"}' | \\\n http POST https://weather.api.dtn.com/v2/conditions/batch \\\n Authorization:'Bearer REPLACE_BEARER_TOKEN' \\\n content-type:application/json"
- lang: Shell + Wget
source: "wget --quiet \\\n --method POST \\\n --header 'content-type: application/json' \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \\\n --body-data '{\"locations\":[{\"lat\":35.46,\"lon\":-97.51},{\"lat\":44.93,\"lon\":-93.2}],\"startTime\":\"1995-01-01T00:00:00Z\",\"endTime\":\"1995-01-10T00:00:00Z\",\"parameters\":[\"airTemp\",\"dewPoint\",\"precipAmount\"],\"units\":\"si-std\"}' \\\n --output-document \\\n - https://weather.api.dtn.com/v2/conditions/batch"
- lang: Swift + Nsurlsession
source: "import Foundation\n\nlet headers = [\n \"content-type\": \"application/json\",\n \"Authorization\": \"Bearer REPLACE_BEARER_TOKEN\"\n]\nlet parameters = [\n \"locations\": [\n [\n \"lat\": 35.46,\n \"lon\": -97.51\n ],\n [\n \"lat\": 44.93,\n \"lon\": -93.2\n ]\n ],\n \"startTime\": \"1995-01-01T00:00:00Z\",\n \"endTime\": \"1995-01-10T00:00:00Z\",\n \"parameters\": [\"airTemp\", \"dewPoint\", \"precipAmount\"],\n \"units\": \"si-std\"\n] as [String : Any]\n\nlet postData = JSONSerialization.data(withJSONObject: parameters, options: [])\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://weather.api.dtn.com/v2/conditions/batch\")! as URL,\n cachePolicy: .useProtocolCachePolicy,\n timeoutInterval: 10.0)\nrequest.httpMethod = \"POST\"\nrequest.allHTTPHeaderFields = headers\nrequest.httpBody = postData as Data\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n if (error != nil) {\n print(error)\n } else {\n let httpResponse = response as? HTTPURLResponse\n print(httpResponse)\n }\n})\n\ndataTask.resume()"
servers:
- url: https://weather.api.dtn.com
components:
schemas:
GeoJsonAlertInfo:
properties:
event:
type: string
title: Event
description: The text denoting the type of the subject event of the alert message
eventCode:
items: {}
type: array
title: Eventcode
description: A system- specific code identifying the event type of the alert message
category:
type: string
title: Category
description: The code denoting the category of the subject event of the alert message
language:
type: string
title: Language
description: The code denoting the language of the info sub- element of the alert message
urgency:
type: string
title: Urgency
description: The code denoting the urgency of the subject event of the alert message
severity:
type: string
title: Severity
description: The code denoting the severity of the subject event of the alert message
certainty:
type: string
title: Certainty
description: The code denoting the certainty of the subject event of the alert message
responseType:
type: string
title: Responsetype
description: The code denoting the type of action recommended for the target audience
effective:
type: string
format: date-time
title: Effective
description: The effective time of the information of the alert message
onset:
type: string
format: date-time
title: Onset
description: The expected time of the beginning of the subject event of the alert message
expires:
type: string
format: date-time
title: Expires
description: The expiry time of the information of the alert message
audience:
type: string
title: Audience
description: The text describing the intended audience of the alert message
senderName:
type: string
title: Sendername
description: The text naming the originator of the alert message
headline:
type: string
title: Headline
description: The text headline of the alert message
description:
type: string
title: Description
description: The text describing the subject event of the alert message
instruction:
type: string
title: Instruction
description: The text describing the recommended action to be taken by recipients of the alert message
web:
type: string
title: Web
description: The identifier of the hyperlink associating additional information with the alert message
contact:
type: string
title: Contact
description: The text describing the contact for follow-up and confirmation of the alert message
parameters:
items:
type: object
type: array
title: Parameters
description: A system- specific additional parameter associated with the alert message
area:
items:
$ref: '#/components/schemas/GeoJsonAlertInfoArea'
type: array
title: Area
description: The container for all component parts of the area sub-element of the info sub- element of the alert message
type: object
required:
- event
- category
- language
- urgency
- severity
- certainty
- expires
- area
title: GeoJsonAlertInfo
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError
Values:
properties:
valueName:
type: string
title: Valuename
description: Value name
value:
type: string
title: Value
description: Actual value
type: object
required:
- valueName
- value
title: Values
GeoJsonAlertInfoArea:
properties:
areaDesc:
type: string
title: Areadesc
description: The text describing the affected area of the alert message
polygon:
type: object
title: Polygon
description: The paired values of points defining a polygon that delineates the affected area of the alert message
circle:
type: string
title: Circle
description: The paired values of a point and radius delineating the affected area of the alert message
ceiling:
type: number
title: Ceiling
description: The maximum altitude of the affected area of the alert message
altitude:
type: number
title: Altitude
description: The specific or minimum altitude of the affected area of the alert message
geocodes:
items:
$ref: '#/components/schemas/Values'
type: array
title: Geocodes
description: The geographic code delineating the affected area of the alert message
type: object
required:
- areaDesc
title: GeoJsonAlertInfoArea
GeoJsonAlertProperties:
properties:
identifier:
type: string
title: Identifier
description: The identifier of the alert message
sender:
type: string
title: Sender
description: The identifier of the sender of the alert message
sent:
type: string
format: date-time
title: Sent
description: The time and date of the origination of the alert message
status:
type: string
title: Status
description: The code denoting the appropriate handling of the alert message
msgType:
type: string
title: Msgtype
description: The code denoting the nature of the alert message
scope:
type: string
title: Scope
description: The code denoting the intended distribution of the alert message
code:
type: string
title: Code
description: The code denoting the special handling of the alert message
source:
type: string
title: Source
description: The text identifying the source of the alert message
updated:
type: string
format: date-time
title: Updated
description: Date when the alert was last updated
restriction:
type: string
title: Restriction
description: The text describing the rule for limiting distribution of the restricted alert message
addresses:
type: string
title: Addresses
description: The group listing of intended recipients of the alert message
note:
type: string
title: Note
description: The text describing the purpose or significance of the alert message
references:
type: string
title: References
description: The group listing identifying earlier message(s) referenced by alert message
info:
items:
$ref: '#/components/schemas/GeoJsonAlertInfo'
type: array
title: Info
description: Additional information about the alert
type: object
required:
- identifier
- sender
- sent
- status
- msgType
- scope
- updated
- info
title: GeoJsonAlertProperties
MetadataResponse:
properties:
url:
type: string
title: Url
metadata:
additionalProperties:
additionalProperties:
additionalProperties:
additionalProperties:
additionalProperties:
items:
type: string
type: array
type: object
type: object
type: object
type: object
type: object
title: Metadata
type: object
required:
- url
- metadata
title: MetadataResponse
example:
url: https://wxbulletin.api.dtn.com/v2/metadata
metadata:
US:
NWS:
event:
en-US:
Wind:
- Brisk Wind Advisory
- Extreme Wind Warning
- Wind Advisory
- High Wind Watch
- Gale Warning
- Gale Watch
- Lake Wind Advisory
- High Wind Warning
Low Temperature:
- Wind Chill Advisory
- Wind Chill Warning
- Extreme Cold Warning
- Extreme Cold Watch
- Freeze Warning
- Freeze Watch
- Frost Advisory
- Hard Freeze Warning
- Hard Freeze Watch
- Winter Weather Advisory
- Wind Chill Watch
- Cold Weather Advisory
Smoke:
- Dense Smoke Advisory
Flood:
- Flood Advisory
- Flood Statement
- Small Stream Flood Advisory
- Urban And Small Stream Flood Advisory
- Flood Watch
- Flood Warning
- Coastal Flood Advisory
- Coastal Flood Statement
- Coastal Flood Warning
- Coastal Flood Watch
- Lakeshore Flood Advisory
- Lakeshore Flood Statement
- Lakeshore Flood Warning
- Lakeshore Flood Watch
- Flash Flood Statement
- Flash Flood Warning
- Flash Flood Watch
- Hydrologic Advisory
- Arroyo And Small Stream Flood Advisory
- Hydrologic Outlook
Fog:
- Dense Fog Advisory
- Freezing Fog Advisory
Heat:
- Excessive Heat Warning
- Excessive Heat Watch
- Heat Advisory
- Extreme Heat Warning
- Extreme Heat Watch
Marine and Coastal:
- Small Craft Advisory
- Small Craft Advisory For Rough Bar
- Hazardous Seas Warning
- Hazardous Seas Watch
- Small Craft Advisory For Winds
- Special Marine Warning
- Marine Weather Statement
- Rip Current Statement
- Low Water Advisory
- High Surf Advisory
- High Surf Warning
- Beach Hazards Statement
- Freezing Spray Advisory
- Heavy Freezing Spray Warning
- Heavy Freezing Spray Watch
- Small Craft Advisory For Hazardous Seas
- Heavy Freezing Spray Advisory
Snow:
- Lake Effect Snow Watch
- Lake Effect Snow Warning
- Lake Effect Snow Advisory
- Snow Squall Warning
Winter Storm:
- Storm Warning
- Storm Watch
- Blizzard Warning
- Blizzard Watch
- Winter Storm Warning
- Winter Storm Watch
- Ice Storm Warning
Tropical Storm, Hurricane, and Typhoon:
- Tropical Storm Local Statement
- Tropical Storm Warning
- Tropical Storm Watch
- Tropical Depression Local Statement
- Storm Surge Warning
- Storm Surge Watch
- Hurricane Warning
- Hurricane Watch
- Hurricane Force Wind Warning
- Hurricane Force Wind Watch
- Typhoon Local Statement
- Typhoon Warning
- Typhoon Watch
- Tropical Cyclone Statement
- Hurricane Local Statement
Thunderstorm:
- Severe Thunderstorm Watch
- Severe Thunderstorm Warning
Tornado:
- Tornado Warning
- Tornado Watch
Radiological Hazard:
- Radiological Hazard Warning
Volcano:
- Volcano Warning
- Ashfall Advisory
- Ashfall Warning
Avalanche:
- Avalanche Warning
- Avalanche Watch
- Avalanche Advisory
Tsunami:
- Tsunami Advisory
- Tsunami Warning
- Tsunami Watch
Rain:
- Freezing Rain Advisory
Weather Conditions:
- Severe Weather Statement
- Special Weather Statement
- Short Term Forecast
- Hazardous Weather Outlook
Administrative Message:
- Administrative Message
Air Quality:
- Air Quality Alert
- Air Stagnation Advisory
Civil Emergency Message:
- Child Abduction Emergency
- Civil Danger Warning
- Civil Emergency Message
- Evacuation - Immediate
- Law Enforcement Warning
- Local Area Emergency
- Shelter In Place Warning
- Hazardous Materials Warning
- 911 Telephone Outage Emergency
- Nuclear Power Plant Warning
- 911 Telephone Outage
Dust:
- Blowing Dust Advisory
- Blowing Dust Warning
- Dust Storm Warning
- Dust Advisory
Fire:
- Extreme Fire Danger
- Fire Warning
- Fire Weather Watch
- Red Flag Warning
Test:
- Test
Earthquake:
- Earthquake Warning
AU:
BOM:
event:
en-AU:
Marine and Coastal:
- Large Coastal Surf
Thunderstorm:
- Thunderstorm
Wind:
- Wind
Flood:
- Riverine Flood
Weather Conditions:
- Weather
- Exposure
Agriculture:
- Sheep Grazier Warning
- Plant Disease
Civil Emergency Message:
- Hazardous Road Conditions
Low Temperature:
- Frost
Heat:
- Extreme Heat
Fire:
- Fire Weather
DE:
DWD:
event:
en-US:
Thunderstorm:
- extreme thunderstorms with gale- or storm-force gusts
- extreme thunderstorms with gale- or storm-force gusts, extremely heavy rain and hail
- extreme thunderstorms with hurricane-force gusts, extremely heavy rain and hail
- heavy thunderstorms
- heavy thunderstorms with gale- or storm-force gusts
- heavy thunderstorms with gale- or storm-force gusts and heavy rain
- heavy thunderstorms with gale- or storm-force gusts and very heavy rain
- heavy thunderstorms with gale- or storm-force gusts, heavy rain and hail
- heavy thunderstorms with heavy rain
- severe thunderstorms
- severe thunderstorms with gale- or storm-force gusts, very heavy rain and hail
- severe thunderstorms with violent storm or hurricane-force gusts
- severe thunderstorms with violent storm or hurricane-force gusts and very heavy rain
- severe thunderstorms with violent storm or hurricane-force gusts, very heavy rain, and hail
- thunderstorms
- thunderstorms, possibly with wind gusts
- extreme thunderstorms
- extreme thunderstorms with extreme hurricane-force gusts
- extreme thunderstorms with extreme hurricane-force gusts and very heavy rain
- extreme thunderstorms with extreme hurricane-force gusts, very heavy rain and hail
Wind:
- wind gusts
- gale-force gusts
- storm-force gusts
- violent storm gusts
- hurricane-force gusts
- extreme hurricane-force gusts
- strong wind
- storm
- near gale
- gale
Rain:
- heavy rain
- very heavy rain
- persistent rain
- heavy persistent rain
- extremely persistent rain
- extremely heavy rain
- very heavy / persistent rain
Weather Conditions:
- thaw
- heavy thaw
Civil Emergency Message:
- powerline vibrations
Test:
- moderate test warning
- severe test warning
- test weather watch
Snow:
- light snowfall
- snowfall
- heavy snowfall
- extremely heavy snowfall
- snow drifts
- heavy snow drifts
- extremely heavy snow drifts
- heavy snowfall with snow drifts
Low Temperature:
- frost
- severe frost
- slight risk of icy surfaces
- black ice
- extreme black ice
- icy surfaces
- significant icy surfaces
Fog:
- fog
Heat:
- high UV Index
- strong heat
- extreme heat
Marine and Coastal:
- minor gusts (sea)
- moderate gusts (sea)
- severe gusts (sea)
de-DE:
Snow:
- LEICHTER SCHNEEFALL
- SCHNEEFALL
- STARKER SCHNEEFALL
- EXTREM STARKER SCHNEEFALL
- SCHNEEVERWEHUNG
- STARKE SCHNEEVERWEHUNG
- EXTREM STARKE SCHNEEVERWEHUNG
- VORABINFORMATION STARKER SCHNEEFALL / SCHNEEVERWEHUNG
Low Temperature:
- FROST
- STRENGER FROST
- GERINGE GLÄTTE
- GLATTEIS
- EXTREMES GLATTEIS
- VORABINFORMATION GLATTEIS
- GLÄTTE
- MARKANTE GLÄTTE
Fog:
- NEBEL
Heat:
- UV-INDEX
- STARKE HITZE
- EXTREME HITZE
Marine and Coastal:
- Starkwind
- Sturm
- schwerer Sturm
Wind:
- SCHWERE STURMBÖEN
- ORKANARTIGE BÖEN
- ORKANBÖEN
- EXTREME ORKANBÖEN
- STARKWIND
- WINDBÖEN
- STURMBÖEN
- STURM
- VORABINFORMATION ORKANBÖEN
- BÖEN
- WIND
- ORKAN
Thunderstorm:
- GEWITTER
- STARKES GEWITTER
- SCHWERES GEWITTER mit ORKANBÖEN
- SCHWERES GEWITTER mit EXTREMEN ORKANBÖEN
- SCHWERES GEWITTER mit HEFTIGEM STARKREGEN
- SCHWERES GEWITTER mit ORKANBÖEN und HEFTIGEM STARKREGEN
- SCHWERES GEWITTER mit EXTREMEN ORKANBÖEN und HEFTIGEM STARKREGEN
- SCHWERES GEWITTER mit HEFTIGEM STARKREGEN und HAGEL
- SCHWERES GEWITTER
- EXTREMES GEWITTER
- SCHWERES GEWITTER mit EXTREM HEFTIGEM STARKREGEN und HAGEL
- SCHWERES GEWITTER mit ORKANBÖEN, HEFTIGEM STARKREGEN und HAGEL
- SCHWERES GEWITTER mit EXTREMEN ORKANBÖEN, HEFTIGEM STARKREGEN und HAGEL
- SCHWERES GEWITTER mit ORKANBÖEN, EXTREM HEFTIGEM STARKREGEN und HAGEL
- VORABINFORMATION SCHWERES GEWITTER
Rain:
- STARKREGEN
- HEFTIGER STARKREGEN
- DAUERREGEN
- ERGIEBIGER DAUERREGEN
- EXTREM ERGIEBIGER DAUERREGEN
- EXTREM HEFTIGER STARKREGEN
- VORABINFORMATION HEFTIGER / ERGIEBIGER REGEN
Weather Conditions:
- TAUWETTER
- STARKES TAUWETTER
- VORABINFORMATION STARKES TAUWETTER
Civil Emergency Message:
- LEITERSEILSCHWINGUNGEN
Test:
- TEST-WARNUNG
- TEST-UNWETTERWARNUNG
- TEST-VORABINFORMATION UNWETTER
CH:
METEOALARM:
event:
en-GB:
Snow:
- Danger of road icing
- Heavy snowfall
- Snowfall
Wind:
- Gale force wind
Rain:
- Strong rainfall
- Continuous rain
de-DE:
Snow:
- Strassenglättegefahr
- Starker Schneefall
- Schneefall
Wind:
- Stürmischer Wind
Rain:
- Starker Regen
- Intensiver Dauerregen
fr-FR:
Snow:
- Chaussées glissantes
- Fortes chutes de neige
- Chutes de neige
Wind:
- Vent fort
Rain:
- Fortes pluies
- Précipitations abondantes
it-IT:
Snow:
- Strade sdrucciolevoli
- Forti nevicate
- Nevicate
Wind:
- Venti tempestosi
Rain:
- Forti piogge
rm-CH:
Snow:
- Privel da vias glischas
- Navaglias
- Naiv
Wind:
- Vent burascus
Rain:
- Plievgia ferma
- Plievgia permanenta intensiva
UK:
UKMO:
event:
en-GB:
Low Temperature:
- ICE
Fog:
- FOG
Heat:
- EXTREME HEAT
Thunderstorm:
- THUNDERSTORM
- LIGHTNING
Wind:
- WIND
Rain:
- RAIN
Snow:
- SNOW
UKENVA:
event:
en-GB:
Flood:
- Severe flood warning
- Flood alert
- Flood warning
NATWALES:
event:
en-GB:
Flood:
- Severe Flood Warning
- Flood Alert
- Flood Warning
cy-GB:
Flood:
- Severe Flood Warning
- Flood Alert
- Flood Warning
NL:
METEOALARM:
event:
en-GB:
Snow:
- Minor snow-ice warning
- Moderate snow-ice warning
- Severe snow-ice warning
- Extreme snow-ice warning
Low Temperature:
- Minor low-temperature warning
- Moderate low-temperature warning
- Severe low-temperature warning
- Extreme low-temperature warning
Fog:
- Minor fog warning
- Moderate fog warning
- Severe fog warning
- Extreme fog warning
Heat:
- Minor high-temperature warning
- Moderate high-temperature warning
- Severe high-temperature warning
- Extreme high-temperature warning
Marine and Coastal:
- awareness_type=07,awareness_level=1.0
- awareness_type=07,awareness_level=2.0
- awareness_type=07,awareness_level=3.0
- awareness_type=07,awareness_level=4.0
Thunderstorm:
- Minor thunderstorm warning
- Moderate thunderstorm warning
- Severe thunderstorm warning
- Extreme thunderstorm warning
Wind:
- Minor Wind warning
- Moderate Wind warning
- Severe Wind warning
- Extreme Wind warning
Flood:
- awareness_type=12,awareness_level=1.0
- awareness_type=12,awareness_level=2.0
- awareness_type=12,awareness_level=3.0
- awareness_type=12,awareness_level=4.0
Rain:
- Minor rain warning
- Moderate rain warning
- Severe rain warning
- Extreme rain warning
nl-NL:
Snow:
- Minor snow-ice warning
- Moderate snow-ice warning
- Severe snow-ice warning
- Extreme snow-ice warning
Low Temperature:
- Minor low-temperature warning
- Moderate low-temperature warning
- Severe low-temperature warning
- Extreme low-temperature warning
Fog:
- Minor fog warning
- Moderate fog warning
- Severe fog warning
- Extreme fog warning
Heat:
- Minor high-temperature warning
- Moderate high-temperature warning
- Severe high-temperature warning
- Extreme high-temperature warning
Marine and Coastal:
- awareness_type=07,awareness_level=1.0
- awareness_type=07,awareness_level=2.0
- awareness_type=07,awareness_level=3.0
- awareness_type=07,awareness_level=4.0
Thunderstorm:
- Minor thunderstorm warning
- Moderate thunderstorm warning
- Severe thunderstorm warning
- Extreme thunderstorm warning
Wind:
- Minor Wind warning
- Moderate Wind warning
- Severe Wind warning
- Extreme Wind warning
Flood:
- awareness_type=12,awareness_level=1.0
- awareness_type=12,awareness_level=2.0
- awareness_type=12,awareness_level=3.0
- awareness_type=12,awareness_level=4.0
Rain:
- Minor rain warning
- Moderate rain warning
- Severe rain warning
- Extreme rain warning
FR:
METEOALARM:
event:
en-GB:
Snow:
- Moderate snow-ice warning
- Severe snow-ice warning
- Extreme snow-ice warning
Low Temperature:
- Moderate low-temperature warning
- Severe low-temperature warning
- Extreme low-temperature warning
Fog:
- Moderate fog warning
- Severe fog warning
- Extreme fog warning
Heat:
- Moderate high-temperature warning
- Severe high-temperature warning
- Extreme high-temperature warning
Marine and Coastal:
- Moderate coastalevent warning
- Severe coastalevent warning
- Extreme coastalevent warning
Thunderstorm:
- Moderate thunderstorm warning
- Severe thunderstorm warning
- Extreme thunderstorm warning
Avalanche:
- Moderate avalanches warning
- Severe avalanches warning
- Extreme avalanches warning
Wind:
- Moderate wind warning
- Severe wind warning
- Extreme wind warning
Flood:
- Moderate flooding warning
- Severe flooding warning
- Extreme flooding warning
- Moderate rain-flood warning
- Severe rain-flood warning
- Extreme rain-flood warning
Rain:
- Moderate rain warning
- Severe rain warning
- Extreme rain warning
Fire:
- Moderate forest-fire warning
- Severe forest-fire warning
- Extreme forest-fire warning
fr-FR:
Snow:
- Vigilance jaune neige-verglas
- Vigilance orange neige-verglas
- Vigilance rouge neige-verglas
Marine and Coastal:
- Vigilance jaune vagues-submersion
- Vigilance orange vagues-submersion
- Vigilance rouge vagues-submersion
Thunderstorm:
- Vigilance jaune orages
- Vigilance orange orages
- Vigilance rouge orages
Avalanche:
- Vigilance jaune avalanches
- Vigilance orange avalanches
- Vigilance rouge avalanches
Wind:
- Vigilance jaune vent-violent
- Vigilance orange vent-violent
- Vigilance rouge vent-violent
Flood:
- Vigilance jaune inondations
- Vigilance orange inondations
- Vigilance rouge inondations
- Vigilance jaune pluie-inondation
- Vigilance orange pluie-inondation
- Vigilance rouge pluie-inondation
IT:
METEOALARM:
event:
en-GB:
Rain:
- Green Rain Warning
- Yellow Rain Warning
- Orange Rain Warning
- Red Rain Warning
Wind:
- Green Wind Warning
- Yellow Wind Warning
- Orange Wind Warning
Fog:
- Green Fog Warning
- Yellow Fog Warning
Thunderstorm:
- Green Thunderstorm Warning
- Yellow Thunderstorm Warning
- Orange Thunderstorm Warning
Snow:
- Red Snow-ice Warning
- Yellow Snow-ice Warning
- Orange Snow-ice Warning
- Green Snow-ice Warning
Heat:
- Yellow High-temperature Warning
- Orange High-temperature Warning
- Green High-temperature Warning
it-IT:
Rain:
- Verde Pioggia Allerta
- Giallo Pioggia Allerta
- Arancione Pioggia Allerta
- Rosso Pioggia Allerta
Wind:
- Verde Vento Allerta
- Giallo Vento Allerta
- Arancione Vento Allerta
Fog:
- Verde Nebbia Allerta
- Giallo Nebbia Allerta
Thunderstorm:
- Verde Temporali Allerta
- Giallo Temporali Allerta
- Arancione Temporali Allerta
Snow:
- Rosso Neve-ghiaccio Allerta
- Giallo Neve-ghiaccio Allerta
- Arancione Neve-ghiaccio Allerta
- Verde Neve-ghiaccio Allerta
Heat:
- Giallo Onda Di Calore Allerta
- Arancione Onda Di Calore Allerta
- Verde Onda Di Calore Allerta
ES:
METEOALARM:
event:
es-ES:
Heat:
- Aviso de temperaturas máximas de nivel verde
- Aviso de temperaturas máximas de nivel amarillo
- Aviso de temperaturas máximas de nivel naranja
Fog:
- Aviso de nieblas de nivel verde
- Aviso de nieblas de nivel amarillo
Marine and Coastal:
- Aviso de costeros de nivel verde
- Aviso de galernas de nivel verde
- Aviso de rissagas de nivel verde
- Aviso de costeros de nivel amarillo
- Aviso de costeros de nivel naranja
- Aviso de rissagas de nivel amarillo
- Aviso de galernas de nivel amarillo
- Aviso de rissagas de nivel naranja
Low Temperature:
- Aviso de temperaturas mínimas de nivel verde
- Aviso de temperaturas mínimas de nivel amarillo
Snow:
- Aviso de nevadas de nivel verde
- Aviso de nevadas de nivel amarillo
- Aviso de nevadas de nivel naranja
Avalanche:
- Aviso de aludes de nivel verde
Thunderstorm:
- Aviso de tormentas de nivel verde
- Aviso de tormentas de nivel amarillo
- Aviso de tormentas de nivel naranja
Wind:
- Aviso de vientos de nivel verde
- Aviso de vientos de nivel amarillo
- Aviso de vientos de nivel naranja
Rain:
- Aviso de lluvias de nivel verde
- Aviso de lluvias de nivel amarillo
- Aviso de lluvias de nivel naranja
en-GB:
Heat:
- Minor high-temperature warning
- Moderate high-temperature warning
- Severe high-temperature warning
Fog:
- Minor fog warning
- Moderate fog warning
Marine and Coastal:
- Minor coastalevent warning
- Minor galerna warning
- Minor rissagas warning
- Moderate coastalevent warning
- Severe coastalevent warning
- Moderate rissagas warning
- Moderate galerna warning
- Severe rissagas warning
Low Temperature:
- Minor low-temperature warning
- Moderate low-temperature warning
- Minor low-temperature warning warning
Snow:
- Minor snow warning
- Moderate snow warning
- Severe snow warning
Avalanche:
- Minor avalanches warning
Thunderstorm:
- Minor thunderstorm warning
- Moderate thunderstorm warning
- Severe thunderstorm warning
Wind:
- Minor wind warning
- Moderate wind warning
- Severe wind warning
Rain:
- Minor rain warning
- Moderate rain warning
- Severe rain warning
SE:
METEOALARM:
event:
sv-SE:
Flood:
- High water discharge
en-GB:
Flood:
- High water discharge
CA:
ENVCA:
event:
en-CA:
Wind:
- arctic outflow
- squall
- wind
- gale wind
- storm force wind
- strong wind
- wind chill
Winter Storm:
- blizzard
- winter storm
Snow:
- blowing snow
- snowfall
- snow squall
Dust:
- dust storm
Low Temperature:
- extreme cold
- flash freeze
- ice
- ice pressure
- special ice
- iceberg
- cold wave
- frost
Fog:
- fog
Rain:
- freezing drizzle
- freezing rain
- rainfall
Heat:
- heat
- heat wave
- high heat and humidity
Tropical Storm, Hurricane, and Typhoon:
- hurricane
- storm surge
- tropical storm
- hurricane force wind
- storm
Thunderstorm:
- severe thunderstorm
- thunderstorm
Tornado:
- tornado
- waterpout
Tsunami:
- tsunami
Weather Conditions:
- weather
Flood:
- flood
- overland flow flood
Marine and Coastal:
- high water level
- rapid closing of coastal leads
- marine
- freezing spray
- special marine
Air Quality:
- air quality
fr-CA:
Wind:
- poussée d'air arctique
- vent
- coup de vent
- grain
- grains
- vent de tempête
- vent fort
- refroidissement éolien
Winter Storm:
- blizzard
- tempête hivernale
Snow:
- poudrerie
- chute de neige
- bourrasque de neige
Dust:
- tempête de poussière
Low Temperature:
- gel soudain
- glaces
- pression des glaces
- conditions particulières des glaces
- iceberg
- vague de froid
- gel
Rain:
- bruine verglaçante
- pluie verglaçante
- pluie
Tropical Storm, Hurricane, and Typhoon:
- ouragan
- onde de tempête
- tempête tropicale
- vent de la force d'un ouragan
- tempête
Tornado:
- tornade
- trombe marine
Tsunami:
- tsunami
Weather Conditions:
- météo
Flood:
- inondation
- inondation par ruissellement
Marine and Coastal:
- niveau élevé des eaux
- fermeture rapide de chenaux côtiers
- maritime
- embruns verglaçants
- incident maritime particulier
Thunderstorm:
- orage
- orages
Heat:
- vague de chaleur
- chaleur et humidité accablantes
Air Quality:
- qualité de l'air
ID:
BMKG:
event:
en-US:
Rain:
- Waspada Hujan Lebat - Minor
- Waspada Hujan Lebat - Moderate
- Waspada Hujan Lebat - Severe
- Waspada Hujan Lebat - Extreme
id-ID:
Rain:
- Waspada Hujan Lebat - Minor
- Waspada Hujan Lebat - Moderate
- Waspada Hujan Lebat - Severe
- Waspada Hujan Lebat - Extreme
MetadataDTNResponse:
properties:
url:
type: string
title: Url
dtnEvents:
additionalProperties:
type: string
type: object
title: Dtnevents
type: object
required:
- url
- dtnEvents
title: MetadataDTNResponse
example:
url: https://wxbulletin.api.dtn.com/v2/metadata/dtn
dtnEvents:
'0': Uncategorized
'1': Snow
'2': Low Temperature
'3': Fog
'4': Heat
'5': Marine and Coastal
'6': Winter Storm
'7': Tropical Storm, Hurricane, and Typhoon
'8': Thunderstorm
'9': Tornado
'10': Radiological Hazard
'11': Volcano
'12': Avalanche
'13': Tsunami
'14': Wind
'15': Smoke
'16': Flood
'17': Rain
'18': Weather Conditions
'19': Administrative Message
'20': Air Quality
'21': Civil Emergency Message
'22': Dust
'23': Fire
'24': Test
'25': Earthquake
'26': Agriculture
GeoJsonAlert:
properties:
id:
type: string
title: Id
description: The identifier of the alert message
agency:
type: string
title: Agency
description: Agency issuing the alert
country:
type: string
title: Country
description: Country code of the alert
type:
type: string
title: Type
description: Type of the GeoJSON object
geometry:
anyOf:
- type: object
- type: object
- type: object
title: Geometry
description: Geometry of the alert area
properties:
allOf:
- $ref: '#/components/schemas/GeoJsonAlertProperties'
title: Properties
description: Properties of the alert
dtnInfo:
type: object
title: Dtninfo
description: Additional DTN information about the alert
type: object
required:
- id
- agency
- country
- type
- properties
- dtnInfo
title: GeoJsonAlert
GeoJsonAlertResponse:
properties:
url:
type: string
title: Url
description: The complete URL to access the alert data, including any query parameters
totalAlerts:
type: integer
title: Totalalerts
description: Total number of alerts
type:
type: string
title: Type
description: Type of the GeoJSON object
features:
items:
$ref: '#/components/schemas/GeoJsonAlert'
type: array
title: Features
description: List of alert features
type: object
required:
- url
- type
- features
title: GeoJsonAlertResponse
example:
url: https://wxbulletin.api.dtn.com/v2/bulletins?excludeGeometry=true&showTotal=true&country=US&startTime=2024-06-24T20%3A49%3A00&event=heat+advisory
totalAlerts: 1
type: FeatureCollection
features:
- id: nws1364c1bdd210c7f036b66585590bcff39d46ea0f7c77a0a2e8f1db8651256caa
agency: NWS
country: US
type: Feature
geometry:
type: Polygon
coordinates:
- - - -98
- 40
- - -98
- 41
- - -97
- 41
- - -97
- 40
- - -98
- 40
properties:
identifier: nws1364c1bdd210c7f036b66585590bcff39d46ea0f7c77a0a2e8f1db8651256caa
sender: w-nws.webmaster@noaa.gov
sent: '2024-06-24T20:49:00'
status: Actual
msgType: Update
scope: Public
code: IPAWSv1.0
updated: '2024-06-24T20:49:00'
references: w-nws.webmaster@noaa.gov,urn:oid:2.49.0.1.840.0.29e524a2edad47b728e81f62a538ac730e40e49a.001.1,2024-06-24T02:54:00-05:00
info:
- event: Heat Advisory
eventCode:
- valueName: SAME
value: NWS
- valueName: NationalWeatherService
value: HTY
category: Met
language: en-US
urgency: Expected
severity: Moderate
certainty: Likely
responseType: Execute
effective: '2024-06-24T20:49:00'
onset: '2024-06-25T18:00:00'
expires: '2024-06-26T00:00:00'
senderName: NWS Hastings NE
headline: Heat Advisory issued June 24 at 3:49PM CDT until June 25 at 7:00PM CDT by NWS Hastings NE
description: '* WHAT...For the first Heat Advisory, heat index values up to 110
possible. For the second Heat Advisory, heat index values around
105 expected.
* WHERE...In Kansas, Jewell, Mitchell, Osborne, Phillips, Rooks, and
Smith Counties. In Nebraska, Nuckolls and Thayer Counties.
* WHEN...For the first Heat Advisory, until 8 PM CDT this evening.
For the second Heat Advisory, from 1 PM to 7 PM CDT Tuesday.
* IMPACTS...Hot temperatures and high humidity may cause heat
illnesses.'
instruction: 'Take extra precautions when outside. Wear lightweight and loose
fitting clothing. Try to limit strenuous activities to early morning
or evening. Take action when you see symptoms of heat exhaustion and
heat stroke. Drink plenty of fluids, stay in an air-conditioned
room, stay out of
the sun, and check up on relatives and neighbors.'
web: http://www.weather.gov
parameters:
- valueName: AWIPSidentifier
value: NPWGID
- valueName: WMOidentifier
value: WWUS73 KGID 242049
- valueName: NWSheadline
value: HEAT ADVISORY REMAINS IN EFFECT UNTIL 8 PM CDT THIS EVENING... ...HEAT ADVISORY REMAINS IN EFFECT FROM 1 PM TO 7 PM CDT TUESDAY
- valueName: BLOCKCHANNEL
value: EAS,NWEM,CMAS
- valueName: VTEC
value: /O.CON.KGID.HT.Y.0002.240625T1800Z-240626T0000Z/
- valueName: eventEndingTime
value: 2024-06-26T00:00:00+0000
- valueName: CAPversion
value: '1.2'
- valueName: originalID
value: 2.49.0.1.840.0.f950770a5e0de71a60b45e3820f5c39fcdfe4222.001.2
area:
- areaDesc: Phillips; Smith; Jewell; Rooks; Osborne; Mitchell; Nuckolls; Thayer
geocodes:
- valueName: UGC
value: KSZ005
- valueName: UGC
value: KSZ006
- valueName: UGC
value: KSZ007
- valueName: UGC
value: KSZ017
- valueName: UGC
value: KSZ018
- valueName: UGC
value: KSZ019
- valueName: UGC
value: NEZ086
- valueName: UGC
value: NEZ087
dtnInfo:
dtnMsgType: Update
dtnExpires: '2024-06-26T00:00:00'
dtnEvent: Heat
dtnEventCode: '4'
dtnDisclaimer: Any DTN expiration dates, times, and message types shown here are automatically generated by the DTN's system, not by the alerting agencies themselves. Additionally, the dtnEvent and dtnEventCode are DTN's normalized event parameters for uniformity and do not necessarily reflect the exact terminology of the issuing agency. To access the original event name as published by the agency, please refer to the event parameter in the response.
ValidationError:
properties:
loc:
items:
anyOf:
- type: string
- type: integer
type: array
title: Location
msg:
type: string
title: Message
type:
type: string
title: Error Type
type: object
required:
- loc
- msg
- type
title: ValidationError
SunMoon:
type: object
properties:
url:
type: string
type:
type: string
features:
type: array
items:
type: object
properties:
type:
type: string
geometry:
type: object
properties:
type:
type: string
coordinates:
type: array
items:
type: number
example:
- 4.875
- 52.369
properties:
type: object
properties:
'2023-08-10':
type: object
properties:
sun:
type: object
properties:
solarNoon:
type: string
format: date-time
nadir:
type: string
format: date-time
sunrise:
type: string
format: date-time
sunset:
type: string
format: date-time
sunriseEnd:
type: string
format: date-time
sunsetStart:
type: string
format: date-time
dawn:
type: string
format: date-time
dusk:
type: string
format: date-time
nauticalDawn:
type: string
format: date-time
nauticalDusk:
type: string
format: date-time
nightEnd:
type: string
format: date-time
night:
type: string
format: date-time
goldenHourEnd:
type: string
format: date-time
goldenHour:
type: string
format: date-time
moon:
type: object
properties:
illumination:
type: string
phaseId:
type: integer
minimum: 1
maximum: 8
phaseName:
type: string
enum:
- New Moon
- Waxing Crescent
- First Quarter
- Waxing Gibbous
- Full Moon
- Waning Gibbous
- Last Quarter
- Waning Crescent
moonrise:
type: string
format: date-time
moonset:
type: string
format: date-time
example:
url: https://astronomical.api.dtn.com/v2/sun-moon?lat=52.369298973574985&lon=4.874941498041485&startDate=2023-08-10&endDate=2023-08-12
type: FeatureCollection
features:
- type: Feature
geometry:
type: Point
coordinates:
- 4.875
- 52.369
properties:
'2023-08-10':
sun:
solarNoon: '2023-08-10T11:47:17Z'
nadir: '2023-08-09T23:47:17Z'
sunrise: '2023-08-10T04:15:46Z'
sunset: '2023-08-10T19:18:47Z'
sunriseEnd: '2023-08-10T04:19:41Z'
sunsetStart: '2023-08-10T19:14:52Z'
dawn: '2023-08-10T03:36:02Z'
dusk: '2023-08-10T19:58:31Z'
nauticalDawn: '2023-08-10T02:43:49Z'
nauticalDusk: '2023-08-10T20:50:45Z'
nightEnd: '2023-08-10T01:35:56Z'
night: '2023-08-10T21:58:38Z'
goldenHourEnd: '2023-08-10T05:04:21Z'
goldenHour: '2023-08-10T18:30:13Z'
moon:
illumination: 29.7%
phaseId: 8
phaseName: Waning Crescent
moonrise: '2023-08-10T22:46:37Z'
moonset: '2023-08-10T15:49:49Z'
'2023-08-11':
sun:
solarNoon: '2023-08-11T11:47:08Z'
nadir: '2023-08-10T23:47:08Z'
sunrise: '2023-08-11T04:17:25Z'
sunset: '2023-08-11T19:16:52Z'
sunriseEnd: '2023-08-11T04:21:19Z'
sunsetStart: '2023-08-11T19:12:58Z'
dawn: '2023-08-11T03:37:55Z'
dusk: '2023-08-11T19:56:22Z'
nauticalDawn: '2023-08-11T02:46:10Z'
nauticalDusk: '2023-08-11T20:48:06Z'
nightEnd: '2023-08-11T01:39:41Z'
night: '2023-08-11T21:54:36Z'
goldenHourEnd: '2023-08-11T05:05:49Z'
goldenHour: '2023-08-11T18:28:28Z'
moon:
illumination: 20.8%
phaseId: 8
phaseName: Waning Crescent
moonrise: '2023-08-11T23:28:00Z'
moonset: '2023-08-11T17:01:30Z'
'2023-08-12':
sun:
solarNoon: '2023-08-12T11:47:00Z'
nadir: '2023-08-11T23:47:00Z'
sunrise: '2023-08-12T04:19:03Z'
sunset: '2023-08-12T19:14:56Z'
sunriseEnd: '2023-08-12T04:22:57Z'
sunsetStart: '2023-08-12T19:11:02Z'
dawn: '2023-08-12T03:39:47Z'
dusk: '2023-08-12T19:54:12Z'
nauticalDawn: '2023-08-12T02:48:32Z'
nauticalDusk: '2023-08-12T20:45:28Z'
nightEnd: '2023-08-12T01:43:21Z'
night: '2023-08-12T21:50:38Z'
goldenHourEnd: '2023-08-12T05:07:17Z'
goldenHour: '2023-08-12T18:26:42Z'
moon:
illumination: 13.4%
phaseId: 8
phaseName: Waning Crescent
moonrise: Never Rise
moonset: '2023-08-12T17:57:59Z'
general-error:
type: object
properties:
detail:
type: string
description: A human-readable description of the specific error.
type:
type: string
description: The error type.
title:
type: string
description: A short, human-readable title for the general error type.
status:
type: number
description: The HTTP status code.
instance:
type: string
format: uri
description: A URL with the specific error ID (often pointing to an error log for that specific response).
additionalProperties: false
parameters:
lat:
name: lat
in: query
schema:
type: number
format: float
example: 52.369
required: true
endDate:
name: endDate
in: query
schema:
type: string
format: date
example: '2023-08-12'
startDate:
name: startDate
in: query
schema:
type: string
format: date
example: '2023-08-10'
lon:
name: lon
in: query
schema:
type: number
format: float
example: 4.875
required: true
responses:
unauthorized:
description: Unable to authenticate credentials.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/general-error'
example:
type: unauthorized
title: Error while authenticating the user.
detail: invalid token
status: 401
instance: urn:dtn:one-astronomical-service:/v2/sun-moon:requestId:123e4567-e89b-12d3-a458-426614176000
not-acceptable:
description: Unable to produce a response matching the Accept request header.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/general-error'
example:
type: not-acceptable
title: Not Acceptable
detail: The Accept header value is invalid or unsupported.
status: 406
instance: urn:dtn:one-astronomical-service:/v2/sun-moon:requestId:123e4567-e89b-12d3-a458-426614176000
bad-request:
description: An invalid request.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/general-error'
example:
type: bad request
title: Invalid Request
detail: Validation failed.
status: 400
instance: urn:dtn:one-astronomical-service:/v2/sun-moon:requestId:123e4567-e89b-12d3-a458-426614176000
securitySchemes:
clientCredentials:
type: oauth2
x-receive-token-in: request-body
flows:
clientCredentials:
tokenUrl: https://api.auth.dtn.com/v1/tokens/authorize
description: "# Using DAIS for M2M/API Auth\nYou have been given a Client ID and a Client Secret, which are used to request a DTN Access Token. DTN Access Tokens are required when making calls to each and every DTN API endpoint. The following information provides additional details on these tokens and how they are generated.\n## What is an Access Token and how is it different from an API Key?\nAn API Key is a random string of characters that an API uses to authorize whether or not a calling client has approved access to an endpoint. These keys are a non-standard approach to API authorization and are generally issued on a per-API basis.\n\nAn Access Token is also a string of characters but is a base-64 encoded JavaScript Object Notation Web Token, or JWT. JWTs are a widely accepted standard that use OAuth concepts and approaches. \n\nBoth API Keys and Access Tokens are used in an Authorization Request Header as a Bearer, meaning there is no difference in where you put this string of characters when you make calls to DTN APIs.\n## How to generate an Access Token?\nWhen requested, an Access Token is generated for your specific Client (ID/Secret) and for a specific API. The DTN Auth and Identity Service (DAIS) generates new Access Tokens for your client. The DAIS endpoint is `POST https://api.auth.dtn.com/v1/tokens/authorize`.\n\nThis endpoint takes two Header parameters:\n * `Content-Type: application/json`\n * `Accept: application/json`\n\nThis endpoint takes four parameters in the Request Body:\n * `grant_type`: this should always be client_credentials for generating machine-to-machine tokens.\n * `client_id`: this is the Client ID or Application ID using the token and is given to you by DTN's Identity Team. This ID will never change for your client/application.\n * `client_secret`: this is the Client Secret that is associated with the Application ID and is given to you by DTN's Identity Team. This key is subject to rotation for security purposes but always with the client's knowledge.\n * `audience`: this is the API for which this Access Token will be used. For the DTN Agency Bulletin API, you need to use the following audience: https://weather.api.dtn.com\n\nYou can use this CURL command template as a reference for obtaining an access token:\n ```\n curl --location --request POST 'https://api.auth.dtn.com/v1/tokens/authorize' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n\"grant_type\": \"client_credentials\",\n\"client_id\": \"insert your client id here\",\n\"client_secret\": \"insert your client secret here\",\n\"audience\": \"insert your audience here\"\n}' \n ```\n\n*This document, for demonstration purposes, supplies a client_id and client_secret in all code examples. This client/application is for a fictitious API and cannot be used in practice to gain unauthorized access to any other DTN API.*\nUpon generating a new Access Token, you should receive an HTTP Response from DAIS similar to this:\n ```\n {\n \"data\": {\n \"access_token\": \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6InpfX21pZW13NGhoTmdvQWQxR3N6ciJ9.eyJodHRwczovL2F1dGguZHRuLmNvbS9jdXN0b21lcklkIjoiMTIzNDU2Nzg5MERlbW8iLCJodHRwczovL2F1dGguZHRuLmNvbS9wcm9kdWN0Q29kZSI6IkRlbW9BcGlQIiwiaHR0cHM6Ly9hdXRoLmR0bi5jb20vcmVxdWVzdGVySXAiOiIxOC4yMTMuMTc0LjI3IiwiaHR0cHM6Ly9hdXRoLmR0bi5jb20vcnBzIjoiMTAwIiwiaHR0cHM6Ly9hdXRoLmR0bi5jb20vdGllciI6IkJhc2ljIiwiaHR0cHM6Ly9hdXRoLmR0bi5jb20vcXVvdGEiOiI5OTk5OTkiLCJpc3MiOiJodHRwczovL2lkLmF1dGguZHRuLmNvbS8iLCJzdWIiOiJuZnlPM0tpS1BSOE4wREtSNUNMOGpTOUdGQkNEZXlGTUBjbGllbnRzIiwiYXVkIjoiaHR0cHM6Ly9kZW1vLWFwaS5hdXRoLmR0bi5jb20vIiwiaWF0IjoxNjU2MDk5MDY4LCJleHAiOjE2NTYwOTkxNTgsImF6cCI6Im5meU8zS2lLUFI4TjBES1I1Q0w4alM5R0ZCQ0RleUZNIiwic2NvcGUiOiJyZWFkOmRlbW8gY3JlYXRlOmRlbW8gdXBkYXRlOmRlbW8iLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMiLCJwZXJtaXNzaW9ucyI6WyJyZWFkOmRlbW8iLCJjcmVhdGU6ZGVtbyIsInVwZGF0ZTpkZW1vIl19.0VHdyp1w9PPFVI0FPheAwuKZwb5C25rwP-LPMXcSNoRmouvga1DZtNLA67ZzE_sAlc_VpaDRr6daLKr_Alw4347mw9sdjP8wKR27kCZa9JZK5PGQMmXHscATbzBEJYpCPklfyGaajgymqTBGnedcv8F0UvlRzQPsFeRPnVoX7BWOSXpMbyToGiXWkQLBQT7r96KAmLZOPJFZspPtjw-wH2mSL2WNa_nkB4j5vMGhGxlKiNRsKb30TH_WAel2hsxNlcPK3XHCmrMTYsNnu7HNqOTMn2i0__0rvBrhSWEw-_grqQDmWFJuWd7Qhi1q81AaJcdqgoSa_efz93QFclJUNw\",\n \"scope\": \"read:demo create:demo update:demo\",\n \"expires_in\": 90,\n \"token_type\": \"Bearer\"\n },\n \"meta\": {\n \"date_time\": \"2022-06-24T19:09:42.963Z\",\n \"name\": \"v1.tokens.authorize\",\n \"uuid\": \"ee6f9feb-dcf8-4421-a6fd-efd6beabdaa9\",\n \"start_timestamp\": 1656097782509,\n \"end_timestamp\": 1656097782963,\n \"execution_time\": 454\n }\n }\n ```\nLooking at this Response, you will see:\n * `access_token`: contains the JWT Access Token string you will use as your Bearer token.\n * `scope`: contains the scopes that this Access Token gives you permissions to access.\n * `expires_in`: contains the length of time before this Access Token will expire, in seconds.\n * `token_type`: verifies that this Access Token should be used as a Bearer token.\n\n## How to use an Access Token after one is generated?\nOnce a new Access Token is obtained, it is used in each call to a DTN API endpoint as a Bearer token in an Authorization Request Header. For example:\n ```\n Header: 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6InpfX21pZW13NGhoTmdvQWQxR3N6ciJ9.eyJodHRwczovL2F1dGguZHRuLmNvbS9jdXN0b21lcklkIjoiMTIzNDU2Nzg5MERlbW8iLCJodHRwczovL2F1dGguZHRuLmNvbS9wcm9kdWN0Q29kZSI6IkRlbW9BcGlQIiwiaHR0cHM6Ly9hdXRoLmR0bi5jb20vcmVxdWVzdGVySXAiOiIxOC4yMTMuMTc0LjI3IiwiaHR0cHM6Ly9hdXRoLmR0bi5jb20vcnBzIjoiMTAwIiwiaHR0cHM6Ly9hdXRoLmR0bi5jb20vdGllciI6IkJhc2ljIiwiaHR0cHM6Ly9hdXRoLmR0bi5jb20vcXVvdGEiOiI5OTk5OTkiLCJpc3MiOiJodHRwczovL2lkLmF1dGguZHRuLmNvbS8iLCJzdWIiOiJuZnlPM0tpS1BSOE4wREtSNUNMOGpTOUdGQkNEZXlGTUBjbGllbnRzIiwiYXVkIjoiaHR0cHM6Ly9kZW1vLWFwaS5hdXRoLmR0bi5jb20vIiwiaWF0IjoxNjU2MDk5MDY4LCJleHAiOjE2NTYwOTkxNTgsImF6cCI6Im5meU8zS2lLUFI4TjBES1I1Q0w4alM5R0ZCQ0RleUZNIiwic2NvcGUiOiJyZWFkOmRlbW8gY3JlYXRlOmRlbW8gdXBkYXRlOmRlbW8iLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMiLCJwZXJtaXNzaW9ucyI6WyJyZWFkOmRlbW8iLCJjcmVhdGU6ZGVtbyIsInVwZGF0ZTpkZW1vIl19.0VHdyp1w9PPFVI0FPheAwuKZwb5C25rwP-LPMXcSNoRmouvga1DZtNLA67ZzE_sAlc_VpaDRr6daLKr_Alw4347mw9sdjP8wKR27kCZa9JZK5PGQMmXHscATbzBEJYpCPklfyGaajgymqTBGnedcv8F0UvlRzQPsFeRPnVoX7BWOSXpMbyToGiXWkQLBQT7r96KAmLZOPJFZspPtjw-wH2mSL2WNa_nkB4j5vMGhGxlKiNRsKb30TH_WAel2hsxNlcPK3XHCmrMTYsNnu7HNqOTMn2i0__0rvBrhSWEw-_grqQDmWFJuWd7Qhi1q81AaJcdqgoSa_efz93QFclJUNw'\n ```\n\n## Deconstructing the Access Token\nA DTN Access Token carries information within its JWT Body that is available on every API call. By deconstructing the JWT token, our Access Tokens will resemble:\n ```\n {\n \"https://auth.dtn.com/customerId\": \"1234567890Demo\",\n \"https://auth.dtn.com/productCode\": \"DemoApiP\",\n \"https://auth.dtn.com/requesterIp\": \"18.213.174.27\",\n \"https://auth.dtn.com/rps\": \"100\",\n \"https://auth.dtn.com/tier\": \"Basic\",\n \"https://auth.dtn.com/quota\": \"999999\",\n \"iss\": \"https://id.auth.dtn.com/\",\n \"sub\": \"nfyO3KiKPR8N0DKR5CL8jS9GFBCDeyFM@clients\",\n \"aud\": \"https://demo-api.auth.dtn.com/\",\n \"iat\": 1656099068,\n \"exp\": 1656099158,\n \"azp\": \"nfyO3KiKPR8N0DKR5CL8jS9GFBCDeyFM\",\n \"scope\": \"read:demo create:demo update:demo\",\n \"gty\": \"client-credentials\",\n \"permissions\": [\n \"read:demo\",\n \"create:demo\",\n \"update:demo\"\n ]\n }\n ```\n### Description of Claims\n\n | Claim | Type | Description |\n | -----------------------------------| --------------------------------------------| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n | `https://auth.dtn.com/customerId` | String | Custom DTN claim containing the Customer ID found in the DTN Order Management/Salesforce system associated with this token. |\n | `https://auth.dtn.com/productCode` | String | Custom DTN claim containing the Identity product code associated with this token. |\n | `https://auth.dtn.com/requesterIp` | String | Custom DTN claim containing the IP address of the requesting client. |\n | `https://auth.dtn.com/rps` | String | Custom DTN claim containing the maximum rate per second this customer is authorized to utilize. |\n | `https://auth.dtn.com/tier` | String | Custom DTN claim containing the data tier the customer purchased for the requested access. |\n | `https://auth.dtn.com/quota` | String | Custom DTN claim containing the maximum yearly quota the customer purchased for calling DTN endpoints for the specific product. |\n | `iss` | String (URI) | The Security Token Service (STS) that issues and returns the token. If this value is not from `https://id.auth.dtn.com/`, the token should not be considered trusted. |\n | `sub` | String (URI) | The principle about which the token asserts information (the User ID or Client ID within the Identity Provider). A User ID will start with a prefix of `auth0\\|`, while the Client ID will end with the suffix `@clients`. |\n | `aud` | String \\| Array (Strings) (URI \\| [URI, …]) | Identifies the intended recipient(s) of the token – its audience. The token should be rejected if the audience does not contain values expected by the calling application. |\n | `iat` | Number (Timestamp) | “Issued At” indicates when the authentication for this token occurred. |\n | `exp` | Number (Timestamp) | The “expiration time” on or after which the JWT must not be accepted for processing. |\n | `azp` | String | The application/client ID of the client using the token. The application can cat as itself or on behalf of a user. |\n | `gty` | String (Space-delimited) | The grant type that was used to request the token – not an RFC 7519 registered claim (Auth0-specific). |\n | `permissions` | Array (Strings) | The grant type that was used to request the token – not an RFC 7519 registered claim (Auth0-specific). |\n\n "
x-refined-from:
- dtn-agency-bulletin-api-openapi.json
- dtn-agency-bulletin-websocket-api-openapi.json
- dtn-astronomical-api-openapi.json
- dtn-climatology-api-openapi.json
- dtn-marine-weather-api-openapi.json
- dtn-precipitation-api-openapi.json
- dtn-probabilistic-api-openapi.json
- dtn-renewables-api-openapi.json
- dtn-soil-api-openapi.json
- dtn-weather-conditions-api-openapi.json