GET /dmas/{{dma_id}}/astronomy

Description

Returns a collection of astronomical data for a Nielsen Designated Marketing Area (“DMA”).

Our patented OnPoint™ system uniquely derives data for every DMA.

Requires a subscription plan with the “read_astronomy” and “access_dmas” capabilities to access this resource.

This resource is not available to free 30-day developer plans. However, postal code astronomy is available. Please email sales@weathersource.com or call (844) 813-2617 if you need access to this resource.

Resource URL

https://api.weathersource.com/v1/{{api_key}}/dmas/{{dma_id}}/astronomy.{{format}}

Resource URL Replacement Parts

{{api_key}}

Your API Key. If you do not have an API key, you may sign up for a free developer account 30-day trial.

{{dma_id}}

A valid Designated Marketing Area ID.

{{format}}

The desired response format. Allowed formats are:

  • json
  • csv

Parameters


Warning: Undefined array key "private" in /var/www/html/wp-content/themes/developer.weathersource.com/single-resource.php on line 108

Warning: Undefined array key "private" in /var/www/html/wp-content/themes/developer.weathersource.com/single-resource.php on line 110

Warning: Undefined array key "private" in /var/www/html/wp-content/themes/developer.weathersource.com/single-resource.php on line 108

Warning: Undefined array key "private" in /var/www/html/wp-content/themes/developer.weathersource.com/single-resource.php on line 110

Warning: Undefined array key "private" in /var/www/html/wp-content/themes/developer.weathersource.com/single-resource.php on line 108

Warning: Undefined array key "private" in /var/www/html/wp-content/themes/developer.weathersource.com/single-resource.php on line 110

Warning: Undefined array key "private" in /var/www/html/wp-content/themes/developer.weathersource.com/single-resource.php on line 108

Warning: Undefined array key "private" in /var/www/html/wp-content/themes/developer.weathersource.com/single-resource.php on line 110
timestamp_eq optional

A response condition that returns a single element matching a timestamp.

Either timestamp_eq or timestamp_between must be provided in ISO 8601 format.

All timestamps are assumed local to the request location unless a UTC offset is provided (as part of the ISO 8601 format).

The returned timestamp may not equal the provided value, but will be representative of the value. For example, if the period parameter is set to hour and the provided timestamp is for 8:15 a.m., the returned element will be for the 8 a.m. hour.

Allowed Values: ISO 8601 timestamp

Example Value: 2007-02-12T08:00-07:00 or 2007-02-12

timestamp_between optional

A response condition that returns a single element matching a timestamp.

Either timestamp_eq or timestamp_between must be provided in ISO 8601 format.

The total date range must not exceed 1 year in length. If a longer date range is required, multiple requests must be made.

All timestamps are assumed local to the request location unless a UTC offset is provided (as part of the ISO 8601 format).

The returned timestamp may not equal the provided value, but will be representative of the value. For example, if the period parameter is set to hour and the provided timestamp is for 8:15 a.m., the returned element will be for the 8 a.m. hour.

Allowed Values: Two comma separated ISO 8601 timestamps

Example Value: 2007-02-12T08:00-07:00,2007-02-12T23:00-07:00

period optional

Identifies the class of weather observations (i.e. weather for a day or for an hour).

Allowed Values: hour, day

Default Value: day

fields optional

Set response to a subset of fields within each element.

For fastest response times, limit the fields to those required.

Available field names:

The Hour class of weather data fields (period parameter is set to hour):

The Day class of weather data fields (period parameter is set to day):

Field groups (available for day and hour periods):

Allowed Values: Comma separated list of field names

Default Value: all

Resource Information

API Versions v1
Rate Limited? Yes
Requires Authentication? Yes
Response Formats JSON
JSONP
CSV
HTTP Method GET

Related Documentation

Example Request

GET https://api.weathersource.com/v1/{{api_key}}/dmas/529/astronomy.json?period=day&timestamp_eq=2014-12-30T00:00&fields=all

[{"dma_id":"529","dma_name":"Louisville","timestamp":"2014-12-30T00:00:00-05:00","sunrise":"2014-12-30T07:59:01-05:00","sun_transit_time":"2014-12-30T12:45:47-05:00","sunset":"2014-12-30T17:32:32-05:00","sun_distance":91406098,"sun_diameter":31.06,"civil_twilight_begin":"2014-12-30T07:29:40-05:00","civil_twilight_end":"2014-12-30T18:01:53-05:00","nautical_twilight_begin":"2014-12-30T06:56:39-05:00","nautical_twilight_end":"2014-12-30T18:34:54-05:00","astronomical_twilight_begin":"2014-12-30T06:24:36-05:00","astronomical_twilight_end":"2014-12-30T19:06:57-05:00","moonrise":"2014-12-30T13:41:22-05:00","moonset":"2014-12-30T02:23:56-05:00","moon_distance":230578,"moon_diameter":30.75,"moon_phase":"Waxing Gibbous","moon_illumination":65.61,"moon_age":8.87445}]