openapi: 3.0.3
info:
title: OnPoint Lightning Observations | a TWN API
description: |
**Description:**
Global lightning archive, updated in real time. OnPoint Lightning Observations API provides the most accurate and reliable global lightning data available. All matching lightning events within 12 km (7 miles) of a provided location (and within the provided time range) are returned.
TWN APIs are built upon the [OnPoint™ Platform](https://business.theweathernetwork.com/onpoint/) which ensures data that is gap-free, homogeneous, and ready for immediate analysis. We offer one of the highest resolution grids on the market, covering every landmass in the world and up to 200 miles offshore.
**Authorization:**
Requests are authorized by a header named `X-API-KEY` with a value of your API key. If you do not have a TWN API key [sign up for a free developer account](https://developer.weathersourceapis.com/account/sign-up/) to trial the data, or contact sales at [business@theweathernetwork.com](mailto:business@theweathernetwork.com) to explore the right subscription package for your business.
When using the \"Try it out\" capability in the documentation, your API key should be added by clicking the green \"Authorize\" button at the top of the page. You may use the evaluation API Key `C0W60UOFRML47ytbXk4xlLBfv` to access example locations found in this documentation.
termsOfService: https://www.pelmorex.com/en/legal/terms-of-service-pws-weather-source-llc/
contact:
name: The Weather Network for Business
url: https://developer.weathersourceapis.com/
email: business@theweathernetwork.com
version: 2.0.3
servers:
- url: https://lightning.twnapis.com/v2
- url: https://lightning.weathersourceapis.com/v2
security:
- ApiKeyAuth: []
tags:
- name: points
description: Latitude/Longitude lightning events
- name: onpoints
description: OnPoint™ point lightning events
paths:
/points/{latitude},{longitude}/period/{timestampStart},{timestampEnd}:
get:
tags:
- points
summary: Lightning data proximate to a Latitude/Longitude point.
description: |
Returns all lightning events that are both within 12 km (7 miles) of a provided Latitude/Longitude point and within the provided time range. The temporal range provided must not exceed 1 year in duration.
**IMPORTANT:** To authenticate to the OnPoint Lightning Observations API, each request must contain your API key set to a custom header named `X-API-KEY`. If you do not have a TWN API key [sign up for a free 30-day developer account](https://developer.weathersourceapis.com/account/sign-up/). You may use the evaluation API Key `C0W60UOFRML47ytbXk4xlLBfv` to access example locations found in this documentation.
When using the \"Try it out\" capability in the documentation, the API key should be added by clicking the green \"Authorize\" button at the top of the page.
parameters:
- name: latitude
in: path
description: A latitude value between -90° and 90°.
required: true
schema:
maximum: 90
minimum: -90
type: number
format: float
example: 38.8552
- name: longitude
in: path
description: A longitude value between -180° (West) and 180° (East).
required: true
schema:
maximum: 180
minimum: -180
type: number
format: float
example: -77.0513
- name: timestampStart
in: path
description: A timestamp formatted as an RFC3339 date-time value that must occur temporally before timestampEnd. The UTC offset is required.
required: true
schema:
type: string
format: date-time
example: 2020-12-20T23:00:00-05:00
- name: timestampEnd
in: path
description: A timestamp formatted as an RFC3339 date-time value that must occur temporally after timestampStart. The UTC offset is required.
required: true
schema:
type: string
format: date-time
example: 2020-12-20T23:00:00-05:00
- name: fields
in: query
description: |
A comma separated list of field names to return. The timestamp field is always returned.
**Limiting the query to needed fields will improve the query response time.**
required: true
style: form
explode: false
schema:
type: array
example:
- all
items:
type: string
enum:
- timestamp
- latitude
- longitude
- distance
- peakCurrent
- flashMult
- sensorCnt
- df
- t
- su
- sv
- chi2
- riseTime
- fallTime
- rateOfChange
- cloudFlag
- angleFlag
- signalFlag
- timingFlag
- all
- allBasic
- allMeta
- allConfidence
- name: unitScale
in: query
description: The unit scale for returned values.
required: false
schema:
type: string
example: IMPERIAL
enum:
- IMPERIAL
- METRIC
- SI
default: IMPERIAL
- name: limit
in: query
description: |
Limit the number of matching events returned. Returned events are ordered by distance from the provided location. Applying a limit will return the nearest events. A value of 0 means no limit.
required: false
schema:
type: integer
example: 5
default: 0
responses:
"200":
description: Lightning data proximate to a Latitude/Longitude point.
content:
application/json:
schema:
$ref: "#/components/schemas/lightningPointObj"
default:
$ref: "#/components/responses/errorResponse"
/onpoints/{onpointId}/period/{timestampStart},{timestampEnd}:
get:
tags:
- onpoints
summary: Lightning data proximate to an OnPoint™ point.
description: |
Returns all lightning events that are both within 12 km (7 miles) of a provided OnPoint™ point and within the provided time range. The temporal range provided must not exceed 1 year in duration.
**IMPORTANT:** To authenticate to the OnPoint Lightning Observations API, each request must contain your API key set to a custom header named `X-API-KEY`. If you do not have a TWN API key [sign up for a free 30-day developer account](https://developer.weathersourceapis.com/account/sign-up/). You may use the evaluation API Key `C0W60UOFRML47ytbXk4xlLBfv` to access example locations found in this documentation.
When using the \"Try it out\" capability in the documentation, the API key should be added by clicking the green \"Authorize\" button at the top of the page.
parameters:
- name: onpointId
in: path
description: An OnPoint™ ID on the Global Grid.
required: true
schema:
type: integer
example: 6110184
- name: timestampStart
in: path
description: A timestamp formatted as an RFC3339 date-time value that must occur temporally before timestampEnd. The UTC offset is required.
required: true
schema:
type: string
format: date-time
example: 2020-12-20T23:00:00-05:00
- name: timestampEnd
in: path
description: A timestamp formatted as an RFC3339 date-time value that must occur temporally after timestampStart. The UTC offset is required.
required: true
schema:
type: string
format: date-time
example: 2020-12-20T23:00:00-05:00
- name: fields
in: query
description: |
A comma separated list of field names to return. The timestamp field is always returned.
**Limiting the query to needed fields will improve the query response time.**
required: true
style: form
explode: false
schema:
type: array
example:
- all
items:
type: string
enum:
- timestamp
- latitude
- longitude
- distance
- peakCurrent
- flashMult
- sensorCnt
- df
- t
- su
- sv
- chi2
- riseTime
- fallTime
- rateOfChange
- cloudFlag
- angleFlag
- signalFlag
- timingFlag
- all
- allBasic
- allMeta
- allConfidence
- name: unitScale
in: query
description: The unit scale for returned values.
required: false
schema:
type: string
example: IMPERIAL
enum:
- IMPERIAL
- METRIC
- SI
default: IMPERIAL
- name: limit
in: query
description: |
Limit the number of matching events returned. Returned events are ordered by distance from the provided location. Applying a limit will return the nearest events. A value of 0 means no limit.
required: false
schema:
type: integer
example: 5
default: 0
responses:
"200":
description: App Weather response for an OnPoint™ point.
content:
application/json:
schema:
$ref: "#/components/schemas/lightningOnpointObj"
default:
$ref: "#/components/responses/errorResponse"
components:
schemas:
lightningPointObj:
required:
- fields
- lightning
- location
type: object
properties:
location:
$ref: "#/components/schemas/pointObj"
fields:
$ref: "#/components/schemas/fieldListObj"
lightning:
$ref: "#/components/schemas/lightningArr"
description: Latitude/Longitude lightning object
lightningOnpointObj:
required:
- fields
- lightning
- location
type: object
properties:
location:
$ref: "#/components/schemas/onpointObj"
fields:
$ref: "#/components/schemas/fieldListObj"
lightning:
$ref: "#/components/schemas/lightningArr"
description: OnPoint™ point lightning object
lightningArr:
type: array
description: An array of lighting objects.
items:
$ref: "#/components/schemas/lightningObj"
lightningObj:
required:
- latitude
- longitude
- timestamp
type: object
properties:
timestamp:
$ref: "#/components/schemas/timestamp"
latitude:
$ref: "#/components/schemas/latitude"
longitude:
$ref: "#/components/schemas/longitude"
distance:
$ref: "#/components/schemas/distance"
peakCurrent:
$ref: "#/components/schemas/peakCurrent"
flashMult:
$ref: "#/components/schemas/flashMult"
sensorCnt:
$ref: "#/components/schemas/sensorCnt"
df:
$ref: "#/components/schemas/df"
t:
$ref: "#/components/schemas/t"
su:
$ref: "#/components/schemas/su"
sv:
$ref: "#/components/schemas/sv"
chi2:
$ref: "#/components/schemas/chi2"
riseTime:
$ref: "#/components/schemas/riseTime"
fallTime:
$ref: "#/components/schemas/fallTime"
rateOfChange:
$ref: "#/components/schemas/rateOfChange"
cloudFlag:
$ref: "#/components/schemas/cloudFlag"
angleFlag:
$ref: "#/components/schemas/angleFlag"
signalFlag:
$ref: "#/components/schemas/signalFlag"
timingFlag:
$ref: "#/components/schemas/timingFlag"
description: A lightning object.
fieldListObj:
title: fieldListObj
required:
- fields
type: object
properties:
fields:
$ref: "#/components/schemas/fields"
description: A list of returned field names the associated units.
example:
fields:
timestamp: "Timestamp as string: RFC 3339"
latitude: "Decimal Degrees (-90.0,90.0)"
longitude: "Decimal Degrees [-180.0, 180.0)"
distance: Miles
peakCurrent: Kiloamperes
flashMult: Integer Count
sensorCnt: Integer Count
df: Degrees of Freedom
t: "Degrees [0,360] (0 = North)"
su: Miles
sv: Miles
chi2: Chi-squared
riseTime: Microseconds
fallTime: Microseconds
rateOfChange: Kiloamperes per Microsecond
cloudFlag: Boolean value
angleFlag: Boolean value
signalFlag: Boolean value
timingFlag: Boolean value
latitude:
maximum: 90
minimum: -90
type: number
description: Latitude of the calculated location in decimal degrees.
format: float
example: 38.8552
longitude:
maximum: 180
minimum: -180
type: number
description: Longitude of the calculated location in decimal degrees.
format: float
example: -77.0513
distance:
type: number
description: "Distance from the requested location in miles (imperial) or km (metric, si)."
format: float
example: 2.59
peakCurrent:
maximum: 9999
minimum: -9999
type: integer
description: Estimated peak current in kiloamps.
format: int32
example: 30
flashMult:
maximum: 99
minimum: 0
type: integer
description: Multiplicity for flash data (0 for strokes).
format: int32
example: 2
sensorCnt:
maximum: 99
minimum: 2
type: integer
description: Number of sensors participating in the solution.
format: int32
example: 2
df:
maximum: 99
minimum: 0
type: integer
description: Degrees of freedom when optimizing location.
format: int32
example: 6
t:
maximum: 180
minimum: 0
type: number
description: The error ellipse angle as a clockwise bearing from 0 degrees north.
format: float
example: 35.2
su:
type: number
description: "The error ellipse semi-major axis length in miles (imperial) or km (metric, si)."
format: float
example: 1.4
sv:
type: number
description: "The error ellipse semi-minor axis length in miles (imperial) or km (metric, si)."
format: float
example: 0.8
chi2:
maximum: 999.99
minimum: 0
type: number
description: Chi-squared value from location optimization.
format: float
example: 4.1
riseTime:
maximum: 99.99
minimum: 0
type: number
description: Rise time of the waveform in microseconds.
format: float
example: 9.5
fallTime:
maximum: 999.9
minimum: 0
type: number
description: Peak-to-zero time of the waveform in microseconds.
format: float
example: 943.2
rateOfChange:
maximum: 999.9
minimum: 0
type: number
description: Maximum rate-of-rise of the waveform in kA/usec.
format: float
example: 115.8
cloudFlag:
type: boolean
description: "Cloud indicator, true if Cloud-to-cloud discharge, false for Cloud-to-ground."
example: false
angleFlag:
type: boolean
description: "Angle indicator, true if sensor angle data used to compute position, false otherwise."
example: false
signalFlag:
type: boolean
description: "Signal indicator, true if sensor signal data used to compute position, false otherwise."
example: true
timingFlag:
type: boolean
description: "Timing indicator, true if sensor timing data used to compute position, false otherwise."
example: false
errorObj:
type: object
properties:
errorCode:
maximum: 600
minimum: 100
type: integer
example: 404
errorMessage:
type: string
example: NOT FOUND. Item not found.
pointObj:
required:
- boundingPoints
- elevation
- grid
- latitude
- longitude
- timezone
type: object
properties:
latitude:
$ref: "#/components/schemas/latitude_1"
longitude:
$ref: "#/components/schemas/longitude_1"
timezone:
$ref: "#/components/schemas/timezone"
countryCode:
$ref: "#/components/schemas/countryCode"
countryName:
$ref: "#/components/schemas/countryName"
subdivCode:
$ref: "#/components/schemas/subdivCode"
subdivName:
$ref: "#/components/schemas/subdivName"
boundingPoints:
$ref: "#/components/schemas/boundingPoints"
grid:
$ref: "#/components/schemas/grid"
elevation:
$ref: "#/components/schemas/elevation"
description: Metadata object for a postcode
latitude_1:
maximum: 90
minimum: -90
type: number
description: A latitude value between -90° and 90°.
format: float
example: 38.8552
longitude_1:
maximum: 180
minimum: -180
type: number
description: A longitude value between -180° (West) and 180° (East).
format: float
example: -77.0513
timezone:
type: string
description: An Olson timezone ID.
example: America/New_York
countryCode:
type: string
description: "An [ISO 3166-1 Alpha-2 country code](https://developer.weathersourceapis.com/apis/countries-with-postal-code-support/)."
example: US
countryName:
type: string
description: A common country name.
example: United States of America
subdivCode:
type: string
description: An ISO 3166-2 country subdivision code.
example: US-VA
subdivName:
type: string
description: A common country subdivision name.
example: Virginia
boundingPoints:
type: array
description: A list of OnPoint™ points related to the location
items:
$ref: "#/components/schemas/boundingPoints_inner"
onpointId:
type: integer
description: An OnPoint™ ID.
example: 10725864
grid:
type: string
description: The OnPoint™ grid on which the resource exists.
example: NORTH_AMERICA_GRID
enum:
- GLOBAL_GRID
- NORTH_AMERICA_GRID
distance_1:
type: number
description: A distance from the provided point in miles.
format: float
example: 2.6772
elevation:
type: number
description: The elevation above sea level of a location in meters
format: float
example: 173.5
onpointObj:
required:
- elevation
- grid
- latitude
- longitude
- onpointId
- timezone
type: object
properties:
onpointId:
$ref: "#/components/schemas/onpointId"
latitude:
$ref: "#/components/schemas/latitude_1"
longitude:
$ref: "#/components/schemas/longitude_1"
timezone:
$ref: "#/components/schemas/timezone"
countryCode:
$ref: "#/components/schemas/countryCode"
countryName:
$ref: "#/components/schemas/countryName"
subdivCode:
$ref: "#/components/schemas/subdivCode"
subdivName:
$ref: "#/components/schemas/subdivName"
grid:
$ref: "#/components/schemas/grid"
elevation:
$ref: "#/components/schemas/elevation"
description: An OnPoint™ point location metadata object
timestamp:
type: string
description: A timestamp formatted as an RFC3339 date-time value.
format: date-time
example: 2020-12-20T23:00:00-05:00
fields:
type: object
additionalProperties:
type: string
description: Unit value for field identified in the related key.
example: Fahrenheit
boundingPoints_inner:
required:
- distance
- elevation
- grid
- latitude
- longitude
- onpointId
type: object
properties:
onpointId:
$ref: "#/components/schemas/onpointId"
latitude:
$ref: "#/components/schemas/latitude_1"
longitude:
$ref: "#/components/schemas/longitude_1"
grid:
$ref: "#/components/schemas/grid"
distance:
$ref: "#/components/schemas/distance_1"
elevation:
$ref: "#/components/schemas/elevation"
responses:
errorResponse:
description: Unexpected error response
content:
application/json:
schema:
$ref: "#/components/schemas/errorObj"
parameters:
fields:
name: fields
in: query
description: |
A comma separated list of field names to return. The timestamp field is always returned.
**Limiting the query to needed fields will improve the query response time.**
required: true
style: form
explode: false
schema:
type: array
example:
- all
items:
type: string
enum:
- timestamp
- latitude
- longitude
- distance
- peakCurrent
- flashMult
- sensorCnt
- df
- t
- su
- sv
- chi2
- riseTime
- fallTime
- rateOfChange
- cloudFlag
- angleFlag
- signalFlag
- timingFlag
- all
- allBasic
- allMeta
- allConfidence
limit:
name: limit
in: query
description: |
Limit the number of matching events returned. Returned events are ordered by distance from the provided location. Applying a limit will return the nearest events. A value of 0 means no limit.
required: false
schema:
type: integer
example: 5
default: 0
latitude:
name: latitude
in: path
description: A latitude value between -90° and 90°.
required: true
schema:
maximum: 90
minimum: -90
type: number
format: float
example: 38.8552
longitude:
name: longitude
in: path
description: A longitude value between -180° (West) and 180° (East).
required: true
schema:
maximum: 180
minimum: -180
type: number
format: float
example: -77.0513
timestampStart:
name: timestampStart
in: path
description: A timestamp formatted as an RFC3339 date-time value that must occur temporally before timestampEnd. The UTC offset is required.
required: true
schema:
type: string
format: date-time
example: 2020-12-20T23:00:00-05:00
timestampEnd:
name: timestampEnd
in: path
description: A timestamp formatted as an RFC3339 date-time value that must occur temporally after timestampStart. The UTC offset is required.
required: true
schema:
type: string
format: date-time
example: 2020-12-20T23:00:00-05:00
unitScale:
name: unitScale
in: query
description: The unit scale for returned values.
required: false
schema:
type: string
example: IMPERIAL
enum:
- IMPERIAL
- METRIC
- SI
default: IMPERIAL
onpointIdGlobal:
name: onpointId
in: path
description: An OnPoint™ ID on the Global Grid.
required: true
schema:
type: integer
example: 6110184
securitySchemes:
ApiKeyAuth:
type: apiKey
description: |
API key to authorize requests. If you do not have a TWN API key [sign up for a free developer account](https://developer.weathersourceapis.com/account/sign-up/) to trial the data, or contact sales at [business@theweathernetwork.com](mailto:business@theweathernetwork.com) to explore the right subscription package for your business. You may use the evaluation API Key `C0W60UOFRML47ytbXk4xlLBfv` to access example locations found in this documentation.
name: X-API-KEY
in: header