INTRO

You can use our test environment or interactive web console like Postman to test our API.

While you are testing, here are some helpful pointers to assist your debugging:

  • Ensure you are always using the POST method for each call.
  • Always use your Subscription key

API REFERENCE

The API is organized around REST. Our API has predictable, resource-oriented URLs, and uses HTTP response codes to indicate API errors. We use built-in HTTP features, like HTTP authentication and HTTP verbs, which are understood by off-the-shelf HTTP clients. We support cross-origin resource sharing, allowing you to interact securely with our API from a client-side web application (though you should never expose your secret API key in any public website’s client-side code). JSON is returned by all API responses, including errors, although our API libraries convert responses to appropriate language-specific objects.

AUTHENTICATION

Authenticate your account when using the API by including your secret API key in the request. You can manage your API keys in the Earth Networks Enterprise Portal. Your API keys carry many privileges, so be sure to keep them secret! Do not share your secret API keys in publicly accessible areas such GitHub, client-side code, and so forth.

All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.

 

 

Daily Forecast

DESCRIPTION

The Earth Networks ENCast City 10 Day‐Night Forecast Feed provides a descriptive day and night period forecast covering the next 10 days. The day period of the forecast is considered to be 7am‐7pm local time, while the night period of the forecast is considered to be the hours straddling the date change from 7 pm to 7 am local time. This forecast will be available for 2.6 million cities across the entire globe and will be available in multiple languages.

REQUEST URL

https://earthnetworks.azure-api.net/data/forecasts/v1/daily?locationtype={locationtype}&location={location}[&verbose][&cultureInfo]

 

REQUEST PARAMETERS

Name Type Description
locationtype string “city” or “latitudelongitude”
location string a valid cityId or valid latitude/longitude. For the cityId use “Location Search v2” API call.

 

REQUEST HEADERS

Name Type Description
Ocp-Apim-Subscription-Key string Subscription key which provides access to this API. Found in your Profile.
Test request
 

Expected response

{
  "dailyForecastPeriods": [
    {
      "cloudCoverPercent": 60,
      "dewPoint": 19,
      "iconCode": 3,
      "precipCode": 1,
      "precipProbability": 0,
      "relativeHumidity": 75,
      "summaryDescription": "Partly Cloudy",
      "temperature": 29,
      "thunderstormProbability": 0,
      "windDirectionDegrees": 353,
      "windSpeed": 7,
      "snowAmountMm": 0,
      "detailedDescription": "Partly cloudy. High temperature around 29C. Dew point will be around 19C with an average humidity of 75%. Winds will be 7 kph from the N.",
      "forecastDateLocalStr": "2017-09-22T06:00:00",
      "forecastDateUtcStr": "2017-09-22T10:00:00Z",
      "isNightTimePeriod": false
    },
  ],
  "forecastCreatedUtcStr": "2017-09-22T08:01:00.0000000Z",
  "location": "US51W0003",
  "locationType": "city"
}
@ECHO OFF

curl -v -X GET "https://earthnetworks.azure-api.net/data/forecasts/v1/daily?locationtype={locationtype}&location={location}?verbose={string}&cultureInfo={string}"
-H "Ocp-Apim-Subscription-Key: {subscription key}"

--data-ascii "{body}" 
using System;
using System.Net.Http.Headers;
using System.Text;
using System.Net.Http;
using System.Web;

namespace CSHttpClientSample
{
    static class Program
    {
        static void Main()
        {
            MakeRequest();
            Console.WriteLine("Hit ENTER to exit...");
            Console.ReadLine();
        }
        
        static async void MakeRequest()
        {
            var client = new HttpClient();
            var queryString = HttpUtility.ParseQueryString(string.Empty);

            // Request headers
            client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{subscription key}");

            // Request parameters
            queryString["verbose"] = "{string}";
            queryString["cultureInfo"] = "{string}";
            var uri = "https://earthnetworks.azure-api.net/data/forecasts/v1/daily?locationtype={locationtype}&location={location}&" + queryString;

            var response = await client.GetAsync(uri);
        }
    }
}	
// // This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class JavaSample 
{
    public static void main(String[] args) 
    {
        HttpClient httpclient = HttpClients.createDefault();

        try
        {
            URIBuilder builder = new URIBuilder("https://earthnetworks.azure-api.net/data/forecasts/v1/daily?locationtype={locationtype}&location={location}");

            builder.setParameter("verbose", "{string}");
            builder.setParameter("cultureInfo", "{string}");

            URI uri = builder.build();
            HttpGet request = new HttpGet(uri);
            request.setHeader("Ocp-Apim-Subscription-Key", "{subscription key}");


            // Request body
            StringEntity reqEntity = new StringEntity("{body}");
            request.setEntity(reqEntity);

            HttpResponse response = httpclient.execute(request);
            HttpEntity entity = response.getEntity();

            if (entity != null) 
            {
                System.out.println(EntityUtils.toString(entity));
            }
        }
        catch (Exception e)
        {
            System.out.println(e.getMessage());
        }
    }
}
$(function() {
    var params = {
        // Request parameters
        "verbose": "{string}",
        "cultureInfo": "{string}",
    };
  
    $.ajax({
        url: "https://earthnetworks.azure-api.net/data/forecasts/v1/daily?locationtype={locationtype}&location={location}&" + $.param(params),
        beforeSend: function(xhrObj){
            // Request headers
            xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key","{subscription key}");
        },
        type: "GET",
        // Request body
        data: "{body}",
    })
    .done(function(data) {
        alert("success");
    })
    .fail(function() {
        alert("error");
    });
});
#import 

int main(int argc, const char * argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    
    NSString* path = @"https://earthnetworks.azure-api.net/data/forecasts/v1/daily?locationtype={locationtype}&location={location}";
    NSArray* array = @[
                         // Request parameters
                         @"entities=true",
                         @"verbose={string}",
                         @"cultureInfo={string}",
                      ];
    
    NSString* string = [array componentsJoinedByString:@"&"];
    path = [path stringByAppendingFormat:@"?%@", string];

    NSLog(@"%@", path);

    NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:path]];
    [_request setHTTPMethod:@"GET"];
    // Request headers
    [_request setValue:@"{subscription key}" forHTTPHeaderField:@"Ocp-Apim-Subscription-Key"];
    // Request body
    [_request setHTTPBody:[@"{body}" dataUsingEncoding:NSUTF8StringEncoding]];
    
    NSURLResponse *response = nil;
    NSError *error = nil;
    NSData* _connectionData = [NSURLConnection sendSynchronousRequest:_request returningResponse:&response error:&error];

    if (nil != error)
    {
        NSLog(@"Error: %@", error);
    }
    else
    {
        NSError* error = nil;
        NSMutableDictionary* json = nil;
        NSString* dataString = [[NSString alloc] initWithData:_connectionData encoding:NSUTF8StringEncoding];
        NSLog(@"%@", dataString);
        
        if (nil != _connectionData)
        {
            json = [NSJSONSerialization JSONObjectWithData:_connectionData options:NSJSONReadingMutableContainers error:&error];
        }
        
        if (error || !json)
        {
            NSLog(@"Could not parse loaded json with error:%@", error);
        }
        
        NSLog(@"%@", json);
        _connectionData = nil;
    }
    
    [pool drain];

    return 0;
}
getUrl();

$headers = array(
    // Request headers
    'Ocp-Apim-Subscription-Key' => '{subscription key}',
);

$request->setHeader($headers);

$parameters = array(
    // Request parameters
    'verbose' => '{string}',
    'cultureInfo' => '{string}',
);

$url->setQueryVariables($parameters);

$request->setMethod(HTTP_Request2::METHOD_GET);

// Request body
$request->setBody("{body}");

try
{
    $response = $request->send();
    echo $response->getBody();
}
catch (HttpException $ex)
{
    echo $ex;
}

?>
########### Python 2.7 #############
import httplib, urllib, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.urlencode({
    # Request parameters
    'verbose': '{string}',
    'cultureInfo': '{string}',
})

try:
    conn = httplib.HTTPSConnection('earthnetworks.azure-api.net')
    conn.request("GET", "/data/forecasts/v1/daily?locationtype={locationtype}&location={location}&%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################

########### Python 3.2 #############
import http.client, urllib.request, urllib.parse, urllib.error, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.parse.urlencode({
    # Request parameters
    'verbose': '{string}',
    'cultureInfo': '{string}',
})

try:
    conn = http.client.HTTPSConnection('earthnetworks.azure-api.net')
    conn.request("GET", "/data/forecasts/v1/daily?locationtype={locationtype}&location={location}&%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################
require 'net/http'

uri = URI('https://earthnetworks.azure-api.net/data/forecasts/v1/daily?locationtype={locationtype}&location={location}')

query = URI.encode_www_form({
    # Request parameters
    'verbose' => '{string}',
    'cultureInfo' => '{string}'
})

if uri.query && uri.query.length > 0
    uri.query += '&' + query
else
    uri.query = query
end

request = Net::HTTP::Get.new(uri.request_uri)
# Request headers
request['Ocp-Apim-Subscription-Key'] = '{subscription key}'
# Request body
request.body = "{body}"

response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
    http.request(request)
end

puts response.body

10 Day-Night Forecast

https://earthnetworks.azure-api.net/data/forecasts/v1/daily
Headers
Ocp-Apim-Subscription-Key

Query parameters
locationtype

location

Optional parameters
verbose

cultureInfo

 

Hourly Forecast

Description:

The hourly forecast call provides hourly forecast data by lat/long. The data itself is updated once an hour at around 20 minutes after the hour. The forecast includes a description of the conditions for that hour. The description will be translated into additional languages according to the culture passed in.

Request URL:

https://earthnetworks.azure-api.net/getHourly6DayForecast/data/forecasts/v1/hourly?location={location}&locationtype={locationtype}[&verbose][&units][&metadata][&offset][&length]

Limitations:

The latitude and longitude location type will only provide data if there is a city within 40 miles of the latitude and longitude requested.

 

Request parameters:

locationtype string „city“ or “latitudelongitude”
latitude string  
longitude string  
location string a valid EN „CityId“ from Search Location or longitude,latitude

Optional parameters:

verbose (optional) boolean true, false
units string the units determine the return type for the system. Currently the following values are supported: english = all units are returned in English units metric = all units are returned Metric units
metadata boolean determines if metadata should be returned in the response. Metadata can be used to describe the data returned by the feed
offset Number determines the starting period to return. A value of 0 will return the current UTC hour. This means if the forecast hasn’t updated yet for the current hour then it may mean that only 143 periods of forecast data are returned. Default is 0
length number determines the number of forecast periods to return. This value can be between 1 and 144. If there is less data then the value, all the data will be returned. Default is 144

Request headers:

Ocp-Apim-Subscription-Key string Subscription key which provides access to this API. Found in your Profile.

 

Test request
 

Expected response

{
  "hourlyForecastPeriod": [
    {
      "adjustedPrecipProbability": 0,
      "cloudCoverPercent": 40,
      "description": "Partly Cloudy",
      "dewPoint": 18,
      "feelsLike": 19,
      "forecastDateLocalStr": "2017-09-22T08:00:00",
      "forecastDateUtcStr": "2017-09-22T12:00:00Z",
      "iconCode": 3,
      "precipCode": 1,
      "precipProbability": 0,
      "precipRate": 0,
      "relativeHumidity": 93,
      "temperature": 19,
      "thunderstormProbability": 0,
      "windDirectionDegrees": 290,
      "windSpeed": 7,
      "surfacePressure": 1014,
      "snowRate": 0,
      "globeTemperature": 21,
      "wetBulbTemperature": 19
    }
  ],
  "forecastCreatedUtcStr": "2017-09-22T11:36:00.0000000Z",
  "location": "US51W0003",
  "locationType": "city"
}
@ECHO OFF

curl -v -X GET "https://earthnetworks.azure-api.net/getHourly6DayForecast/data/forecasts/v1/hourly?location={location}&locationtype={locationtype}?verbose={boolean}&units={string}&metadata={boolean}&offset={number}&length={number}"
-H "Ocp-Apim-Subscription-Key: {subscription key}"

--data-ascii "{body}" 
using System;
using System.Net.Http.Headers;
using System.Text;
using System.Net.Http;
using System.Web;

namespace CSHttpClientSample
{
    static class Program
    {
        static void Main()
        {
            MakeRequest();
            Console.WriteLine("Hit ENTER to exit...");
            Console.ReadLine();
        }
        
        static async void MakeRequest()
        {
            var client = new HttpClient();
            var queryString = HttpUtility.ParseQueryString(string.Empty);

            // Request headers
            client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{subscription key}");

            // Request parameters
            queryString["verbose"] = "{boolean}";
            queryString["units"] = "{string}";
            queryString["metadata"] = "{boolean}";
            queryString["offset"] = "{number}";
            queryString["length"] = "{number}";
            var uri = "https://earthnetworks.azure-api.net/getHourly6DayForecast/data/forecasts/v1/hourly?location={location}&locationtype={locationtype}&" + queryString;

            var response = await client.GetAsync(uri);
        }
    }
}	
// // This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class JavaSample 
{
    public static void main(String[] args) 
    {
        HttpClient httpclient = HttpClients.createDefault();

        try
        {
            URIBuilder builder = new URIBuilder("https://earthnetworks.azure-api.net/getHourly6DayForecast/data/forecasts/v1/hourly?location={location}&locationtype={locationtype}");

            builder.setParameter("verbose", "{boolean}");
            builder.setParameter("units", "{string}");
            builder.setParameter("metadata", "{boolean}");
            builder.setParameter("offset", "{number}");
            builder.setParameter("length", "{number}");

            URI uri = builder.build();
            HttpGet request = new HttpGet(uri);
            request.setHeader("Ocp-Apim-Subscription-Key", "{subscription key}");


            // Request body
            StringEntity reqEntity = new StringEntity("{body}");
            request.setEntity(reqEntity);

            HttpResponse response = httpclient.execute(request);
            HttpEntity entity = response.getEntity();

            if (entity != null) 
            {
                System.out.println(EntityUtils.toString(entity));
            }
        }
        catch (Exception e)
        {
            System.out.println(e.getMessage());
        }
    }
}
$(function() {
    var params = {
        // Request parameters
        "verbose": "{boolean}",
        "units": "{string}",
        "metadata": "{boolean}",
        "offset": "{number}",
        "length": "{number}",
    };
  
    $.ajax({
        url: "https://earthnetworks.azure-api.net/getHourly6DayForecast/data/forecasts/v1/hourly?location={location}&locationtype={locationtype}&" + $.param(params),
        beforeSend: function(xhrObj){
            // Request headers
            xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key","{subscription key}");
        },
        type: "GET",
        // Request body
        data: "{body}",
    })
    .done(function(data) {
        alert("success");
    })
    .fail(function() {
        alert("error");
    });
});
#import 

int main(int argc, const char * argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    
    NSString* path = @"https://earthnetworks.azure-api.net/getHourly6DayForecast/data/forecasts/v1/hourly?location={location}&locationtype={locationtype}";
    NSArray* array = @[
                         // Request parameters
                         @"entities=true",
                         @"verbose={boolean}",
                         @"units={string}",
                         @"metadata={boolean}",
                         @"offset={number}",
                         @"length={number}",
                      ];
    
    NSString* string = [array componentsJoinedByString:@"&"];
    path = [path stringByAppendingFormat:@"?%@", string];

    NSLog(@"%@", path);

    NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:path]];
    [_request setHTTPMethod:@"GET"];
    // Request headers
    [_request setValue:@"{subscription key}" forHTTPHeaderField:@"Ocp-Apim-Subscription-Key"];
    // Request body
    [_request setHTTPBody:[@"{body}" dataUsingEncoding:NSUTF8StringEncoding]];
    
    NSURLResponse *response = nil;
    NSError *error = nil;
    NSData* _connectionData = [NSURLConnection sendSynchronousRequest:_request returningResponse:&response error:&error];

    if (nil != error)
    {
        NSLog(@"Error: %@", error);
    }
    else
    {
        NSError* error = nil;
        NSMutableDictionary* json = nil;
        NSString* dataString = [[NSString alloc] initWithData:_connectionData encoding:NSUTF8StringEncoding];
        NSLog(@"%@", dataString);
        
        if (nil != _connectionData)
        {
            json = [NSJSONSerialization JSONObjectWithData:_connectionData options:NSJSONReadingMutableContainers error:&error];
        }
        
        if (error || !json)
        {
            NSLog(@"Could not parse loaded json with error:%@", error);
        }
        
        NSLog(@"%@", json);
        _connectionData = nil;
    }
    
    [pool drain];

    return 0;
}
getUrl();

$headers = array(
    // Request headers
    'Ocp-Apim-Subscription-Key' => '{subscription key}',
);

$request->setHeader($headers);

$parameters = array(
    // Request parameters
    'verbose' => '{boolean}',
    'units' => '{string}',
    'metadata' => '{boolean}',
    'offset' => '{number}',
    'length' => '{number}',
);

$url->setQueryVariables($parameters);

$request->setMethod(HTTP_Request2::METHOD_GET);

// Request body
$request->setBody("{body}");

try
{
    $response = $request->send();
    echo $response->getBody();
}
catch (HttpException $ex)
{
    echo $ex;
}

?>
########### Python 2.7 #############
import httplib, urllib, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.urlencode({
    # Request parameters
    'verbose': '{boolean}',
    'units': '{string}',
    'metadata': '{boolean}',
    'offset': '{number}',
    'length': '{number}',
})

try:
    conn = httplib.HTTPSConnection('earthnetworks.azure-api.net')
    conn.request("GET", "/getHourly6DayForecast/data/forecasts/v1/hourly?location={location}&locationtype={locationtype}&%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################

########### Python 3.2 #############
import http.client, urllib.request, urllib.parse, urllib.error, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.parse.urlencode({
    # Request parameters
    'verbose': '{boolean}',
    'units': '{string}',
    'metadata': '{boolean}',
    'offset': '{number}',
    'length': '{number}',
})

try:
    conn = http.client.HTTPSConnection('earthnetworks.azure-api.net')
    conn.request("GET", "/getHourly6DayForecast/data/forecasts/v1/hourly?location={location}&locationtype={locationtype}&%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################
require 'net/http'

uri = URI('https://earthnetworks.azure-api.net/getHourly6DayForecast/data/forecasts/v1/hourly?location={location}&locationtype={locationtype}')

query = URI.encode_www_form({
    # Request parameters
    'verbose' => '{boolean}',
    'units' => '{string}',
    'metadata' => '{boolean}',
    'offset' => '{number}',
    'length' => '{number}'
})

if uri.query && uri.query.length > 0
    uri.query += '&' + query
else
    uri.query = query
end

request = Net::HTTP::Get.new(uri.request_uri)
# Request headers
request['Ocp-Apim-Subscription-Key'] = '{subscription key}'
# Request body
request.body = "{body}"

response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
    http.request(request)
end

puts response.body

Hourly 6-Day Forecast

https://earthnetworks.azure-api.net/getHourly6DayForecast/data/forecasts/v1/hourly?locationtype={locationtype}&location={location}
Headers
Ocp-Apim-Subscription-Key

Query parameters
locationtype

location

Optional parameters
verbose

units

metadata

offset

length

 

Air Quality Forecast

Description:

The AirQuality feed provides Air Quality Index and discussion data for a city or a lat/long.

Request URL:

https://earthnetworks.azure-api.net/getStationList/data/locations/v3/stationlist

Request parameters:

locationtype string “latitudelongitude”
latitude string  
longitude string  

Optional parameters:

verbose (optional) boolean true, false
cultureInfo (optional) string en-us, es-es, fr-fr, pt-pt

Request headers:

Ocp-Apim-Subscription-Key string Subscription key which provides access to this API. Found in your Profile.

 

Test request
 

Expected response

"CurrentDay": [{

        "ReportType": "Forecast",
        "dateString": "2013-08-14",
        "timeOfDayLocalString": null,
        "AirQualityIndexes": [{
            "ParticulateType": "Ozone",
            "Index": 36,
            "ShortDescription": "Good"
        }],
        "Discussion": "A frontal boundary has moved through much of the state on this Wednesday afternoon.
        Skies are mostly cloudy and temperatures are cooler than this time yesterday in the wake of this front,
        but GREEN ground level ozone concentrations remain unchanged for the most part. The aforementioned front
        is expected to become stationary along the northern Gulf Coast on Thursday.Atmospheric computer models 
        are generating a weak area of low pressure over southern Alabama on the tail end of this front.Flow 
        around this low pressure system will likely lift warm and moist air in the mid - levels north of the 
        front across the Southeast US.This should lead to another cool and cloudy day by August standards on 
        Thursday.As a result, CODE GREEN concentrations will continue statewide.
        ",
        "DiscussionIsDuplicate": false
    },
    {
        "ReportType": "Observed",
        "dateString": "2013-08-14",
        "timeOfDayLocalString": "15:00",
        "AirQualityIndexes": [{
                "ParticulateType": "Small Particulate Matter",
                "Index": 55,
                "ShortDescription": "Moderate"
            },
            {
                "ParticulateType": "Ozone",
                "Index": 35,
                "ShortDescription": "Good"
            }
        ],
        "Discussion": null,
        "DiscussionIsDuplicate": false
    }
],
"Forecast”: {}
@ECHO OFF

curl -v -X GET "https://earthnetworks.azure-api.net/getAirQuality/data/aqi/v1/daily?locationtype={locationtype}&latitude={latitude}&longitude={longitude}?verbose={boolean}&cultureInfo={string}"
-H "Ocp-Apim-Subscription-Key: {subscription key}"

--data-ascii "{body}" 
using System;
using System.Net.Http.Headers;
using System.Text;
using System.Net.Http;
using System.Web;

namespace CSHttpClientSample
{
    static class Program
    {
        static void Main()
        {
            MakeRequest();
            Console.WriteLine("Hit ENTER to exit...");
            Console.ReadLine();
        }
        
        static async void MakeRequest()
        {
            var client = new HttpClient();
            var queryString = HttpUtility.ParseQueryString(string.Empty);

            // Request headers
            client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{subscription key}");

            // Request parameters
            queryString["verbose"] = "{boolean}";
            queryString["cultureInfo"] = "{string}";
            var uri = "https://earthnetworks.azure-api.net/getAirQuality/data/aqi/v1/daily?locationtype={locationtype}&latitude={latitude}&longitude={longitude}&" + queryString;

            var response = await client.GetAsync(uri);
        }
    }
}	
// // This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class JavaSample 
{
    public static void main(String[] args) 
    {
        HttpClient httpclient = HttpClients.createDefault();

        try
        {
            URIBuilder builder = new URIBuilder("https://earthnetworks.azure-api.net/getAirQuality/data/aqi/v1/daily?locationtype={locationtype}&latitude={latitude}&longitude={longitude}");

            builder.setParameter("verbose", "{boolean}");
            builder.setParameter("cultureInfo", "{string}");

            URI uri = builder.build();
            HttpGet request = new HttpGet(uri);
            request.setHeader("Ocp-Apim-Subscription-Key", "{subscription key}");


            // Request body
            StringEntity reqEntity = new StringEntity("{body}");
            request.setEntity(reqEntity);

            HttpResponse response = httpclient.execute(request);
            HttpEntity entity = response.getEntity();

            if (entity != null) 
            {
                System.out.println(EntityUtils.toString(entity));
            }
        }
        catch (Exception e)
        {
            System.out.println(e.getMessage());
        }
    }
}
$(function() {
    var params = {
        // Request parameters
        "verbose": "{boolean}",
        "cultureInfo": "{string}",
    };
  
    $.ajax({
        url: "https://earthnetworks.azure-api.net/getAirQuality/data/aqi/v1/daily?locationtype={locationtype}&latitude={latitude}&longitude={longitude}&" + $.param(params),
        beforeSend: function(xhrObj){
            // Request headers
            xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key","{subscription key}");
        },
        type: "GET",
        // Request body
        data: "{body}",
    })
    .done(function(data) {
        alert("success");
    })
    .fail(function() {
        alert("error");
    });
});
#import 

int main(int argc, const char * argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    
    NSString* path = @"https://earthnetworks.azure-api.net/getAirQuality/data/aqi/v1/daily?locationtype={locationtype}&latitude={latitude}&longitude={longitude}";
    NSArray* array = @[
                         // Request parameters
                         @"entities=true",
                         @"verbose={boolean}",
                         @"cultureInfo={string}",
                      ];
    
    NSString* string = [array componentsJoinedByString:@"&"];
    path = [path stringByAppendingFormat:@"?%@", string];

    NSLog(@"%@", path);

    NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:path]];
    [_request setHTTPMethod:@"GET"];
    // Request headers
    [_request setValue:@"{subscription key}" forHTTPHeaderField:@"Ocp-Apim-Subscription-Key"];
    // Request body
    [_request setHTTPBody:[@"{body}" dataUsingEncoding:NSUTF8StringEncoding]];
    
    NSURLResponse *response = nil;
    NSError *error = nil;
    NSData* _connectionData = [NSURLConnection sendSynchronousRequest:_request returningResponse:&response error:&error];

    if (nil != error)
    {
        NSLog(@"Error: %@", error);
    }
    else
    {
        NSError* error = nil;
        NSMutableDictionary* json = nil;
        NSString* dataString = [[NSString alloc] initWithData:_connectionData encoding:NSUTF8StringEncoding];
        NSLog(@"%@", dataString);
        
        if (nil != _connectionData)
        {
            json = [NSJSONSerialization JSONObjectWithData:_connectionData options:NSJSONReadingMutableContainers error:&error];
        }
        
        if (error || !json)
        {
            NSLog(@"Could not parse loaded json with error:%@", error);
        }
        
        NSLog(@"%@", json);
        _connectionData = nil;
    }
    
    [pool drain];

    return 0;
}
// This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
require_once 'HTTP/Request2.php';

$request = new Http_Request2('https://earthnetworks.azure-api.net/getAirQuality/data/aqi/v1/daily?locationtype={locationtype}&latitude={latitude}&longitude={longitude}');
$url = $request->getUrl();

$headers = array(
    // Request headers
    'Ocp-Apim-Subscription-Key' => '{subscription key}',
);

$request->setHeader($headers);

$parameters = array(
    // Request parameters
    'verbose' => '{boolean}',
    'cultureInfo' => '{string}',
);

$url->setQueryVariables($parameters);

$request->setMethod(HTTP_Request2::METHOD_GET);

// Request body
$request->setBody("{body}");

try
{
    $response = $request->send();
    echo $response->getBody();
}
catch (HttpException $ex)
{
    echo $ex;
}
########### Python 2.7 #############
import httplib, urllib, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.urlencode({
    # Request parameters
    'verbose': '{boolean}',
    'cultureInfo': '{string}',
})

try:
    conn = httplib.HTTPSConnection('earthnetworks.azure-api.net')
    conn.request("GET", "/getAirQuality/data/aqi/v1/daily?locationtype={locationtype}&latitude={latitude}&longitude={longitude}&%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################

########### Python 3.2 #############
import http.client, urllib.request, urllib.parse, urllib.error, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.parse.urlencode({
    # Request parameters
    'verbose': '{boolean}',
    'cultureInfo': '{string}',
})

try:
    conn = http.client.HTTPSConnection('earthnetworks.azure-api.net')
    conn.request("GET", "/getAirQuality/data/aqi/v1/daily?locationtype={locationtype}&latitude={latitude}&longitude={longitude}&%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################
require 'net/http'

uri = URI('https://earthnetworks.azure-api.net/getAirQuality/data/aqi/v1/daily?locationtype={locationtype}&latitude={latitude}&longitude={longitude}')

query = URI.encode_www_form({
    # Request parameters
    'verbose' => '{boolean}',
    'cultureInfo' => '{string}'
})

if uri.query && uri.query.length > 0
    uri.query += '&' + query
else
    uri.query = query
end

request = Net::HTTP::Get.new(uri.request_uri)
# Request headers
request['Ocp-Apim-Subscription-Key'] = '{subscription key}'
# Request body
request.body = "{body}"

response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
    http.request(request)
end

puts response.body

Air Quality Forecast

https://earthnetworks.azure-api.net/getAirQuality/data/aqi/v1/daily
Headers
Ocp-Apim-Subscription-Key

Query parameters
locationtype

longitude

latitude

Optional parameters
verbose

cultureInfo

 

Google Map Layers

For displaying map tiles over Google Maps you must first make a Google Account and get an API Key from the Google API Console (https://developers.google.com/maps/documentation/javascript/get-api-key). After the API Key is obtained you can use the following approach for displaying the tiles:

1) Load the Google Maps Javascript API, substitute YOUR_API_KEY in the code below with your API key:

<script async defer src=”https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap” type=”text/javascript”></script>

2) Get current time slot value t from metadata call (the subscriptionKey key variable is your Earth Networks subscription key)


var t;
var subscriptionKey;

    var json = (function() {
        var json = null;
        $.ajax({
           'async': false,
           'global': false,
            'url': "https://earthnetworks.azure-api.net/maps/overlays/v2/metadata?lid=Radar.NA.LoAlt&subscription-key=" + subscriptionKey,
            'dataType': "json",
            'success': function(data) {
                json = data;
            }
        });
        return json;
    })();
    t = json.Result.LatestSlot;

3) Initiate the map with the following code where the t variable is the current time slot value got from metadata call


function initMap() {
   var map = new google.maps.Map(document.getElementById('map'), {
        zoom: 6,
        center: { lat: 37.514938, lng: -99.337306 }
   });
   var imageMapType = new google.maps.ImageMapType({
        getTileUrl: function (coord, zoom) {
            return "https://earthnetworks.azure-api.net/maps/overlays/tile?x=" + coord.x + "&y=" + coord.y + "&z=" + zoom + "&t=" + t + "&lid=pulserad&epsg=3857&subscription-key=" + subscriptionKey
        },
        tileSize: new google.maps.Size(256, 256)
   });
   map.overlayMapTypes.push(imageMapType);
}

Location Search

Description:

The location search provides the details for a single specific station similar to station list.

Request URL:

https://earthnetworks.azure-api.net/getLocations/data/locations/v2/location?searchString={searchString} [&cultureInfo]

Request parameters:

searchString string this variable can be a zipcode, or city or combination separated with comma

Optional parameters:

cultureInfo (optional) string en-us, es-es
locationtype string “latitudelongitude”
location string a valid latitude/longitude
maxresults number  

Request headers:

Ocp-Apim-Subscription-Key string Subscription key which provides access to this API. Found in your Profile.

 

Test request
 

Expected response

[
{
    "CityId": "US04C0012",
    "CityName": "Chinle",
    "Territory": "Arizona",
    "StateCode": "AZ",
    "Country": "US",
    "Latitude": 36.1209,
    "Longitude": -109.5237,
    "Dma": "790",
    "Zip": "86503"
},
{
    "CityId": "US04T0015",
    "CityName": "Tsaile",
    "Territory": "Arizona",
    "StateCode": "AZ",
    "Country": "US",
    "Latitude": 36.3243,
    "Longitude": -109.269,
    "Dma": "790",
    "Zip": "86556"
},
{
    "CityId": "US04N0002",
    "CityName": "Nazlini",
    "Territory": "Arizona",
    "StateCode": "AZ",
    "Country": "US",
    "Latitude": 35.8982,
    "Longitude": -109.446,
    "Dma": "790",
    "Zip": "86540"
},
{
    "CityId": "US04L0008",
    "CityName": "Lukachukai",
    "Territory": "Arizona",
    "StateCode": "AZ",
    "Country": "US",
    "Latitude": 36.3989,

    "Longitude": -109.2586,
    "Dma": "790",
    "Zip": "86507"
}]
@ECHO OFF

curl -v -X GET "https://earthnetworks.azure-api.net/getLocations/data/locations/v2/location?searchString={searchString}?locationtype={string}&location={string}&cultureInfo={string}"
-H "Ocp-Apim-Subscription-Key: {subscription key}"

--data-ascii "{body}" 
using System;
using System.Net.Http.Headers;
using System.Text;
using System.Net.Http;
using System.Web;

namespace CSHttpClientSample
{
    static class Program
    {
        static void Main()
        {
            MakeRequest();
            Console.WriteLine("Hit ENTER to exit...");
            Console.ReadLine();
        }
        
        static async void MakeRequest()
        {
            var client = new HttpClient();
            var queryString = HttpUtility.ParseQueryString(string.Empty);

            // Request headers
            client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{subscription key}");

            // Request parameters
            queryString["locationtype"] = "{string}";
            queryString["location"] = "{string}";
            queryString["cultureInfo"] = "{string}";
            var uri = "https://earthnetworks.azure-api.net/getLocations/data/locations/v2/location?searchString={searchString}&" + queryString;

            var response = await client.GetAsync(uri);
        }
    }
}	
// // This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class JavaSample 
{
    public static void main(String[] args) 
    {
        HttpClient httpclient = HttpClients.createDefault();

        try
        {
            URIBuilder builder = new URIBuilder("https://earthnetworks.azure-api.net/getLocations/data/locations/v2/location?searchString={searchString}");

            builder.setParameter("locationtype", "{string}");
            builder.setParameter("location", "{string}");
            builder.setParameter("cultureInfo", "{string}");

            URI uri = builder.build();
            HttpGet request = new HttpGet(uri);
            request.setHeader("Ocp-Apim-Subscription-Key", "{subscription key}");


            // Request body
            StringEntity reqEntity = new StringEntity("{body}");
            request.setEntity(reqEntity);

            HttpResponse response = httpclient.execute(request);
            HttpEntity entity = response.getEntity();

            if (entity != null) 
            {
                System.out.println(EntityUtils.toString(entity));
            }
        }
        catch (Exception e)
        {
            System.out.println(e.getMessage());
        }
    }
}
$(function() {
    var params = {
        // Request parameters
        "locationtype": "{string}",
        "location": "{string}",
        "cultureInfo": "{string}",
    };

    $.ajax({
            url: "https://earthnetworks.azure-api.net/getLocations/data/locations/v2/location?searchString={searchString}&" + $.param(params),
            beforeSend: function(xhrObj) {
                // Request headers
                xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key", "{subscription key}");
            },
            type: "GET",
            // Request body
            data: "{body}",
        })
        .done(function(data) {
            alert("success");
        })
        .fail(function() {
            alert("error");
        });
});
#import 

int main(int argc, const char * argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    
    NSString* path = @"https://earthnetworks.azure-api.net/getLocations/data/locations/v2/location?searchString={searchString}";
    NSArray* array = @[
                         // Request parameters
                         @"entities=true",
                         @"locationtype={string}",
                         @"location={string}",
                         @"cultureInfo={string}",
                      ];
    
    NSString* string = [array componentsJoinedByString:@"&"];
    path = [path stringByAppendingFormat:@"?%@", string];

    NSLog(@"%@", path);

    NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:path]];
    [_request setHTTPMethod:@"GET"];
    // Request headers
    [_request setValue:@"{subscription key}" forHTTPHeaderField:@"Ocp-Apim-Subscription-Key"];
    // Request body
    [_request setHTTPBody:[@"{body}" dataUsingEncoding:NSUTF8StringEncoding]];
    
    NSURLResponse *response = nil;
    NSError *error = nil;
    NSData* _connectionData = [NSURLConnection sendSynchronousRequest:_request returningResponse:&response error:&error];

    if (nil != error)
    {
        NSLog(@"Error: %@", error);
    }
    else
    {
        NSError* error = nil;
        NSMutableDictionary* json = nil;
        NSString* dataString = [[NSString alloc] initWithData:_connectionData encoding:NSUTF8StringEncoding];
        NSLog(@"%@", dataString);
        
        if (nil != _connectionData)
        {
            json = [NSJSONSerialization JSONObjectWithData:_connectionData options:NSJSONReadingMutableContainers error:&error];
        }
        
        if (error || !json)
        {
            NSLog(@"Could not parse loaded json with error:%@", error);
        }
        
        NSLog(@"%@", json);
        _connectionData = nil;
    }
    
    [pool drain];

    return 0;
}
// This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
require_once 'HTTP/Request2.php';

$request = new Http_Request2('https://earthnetworks.azure-api.net/getLocations/data/locations/v2/location?searchString={searchString}');
$url = $request->getUrl();

$headers = array(
    // Request headers
    'Ocp-Apim-Subscription-Key' => '{subscription key}',
);

$request->setHeader($headers);

$parameters = array(
    // Request parameters
    'locationtype' => '{string}',
    'location' => '{string}',
    'cultureInfo' => '{string}',
);

$url->setQueryVariables($parameters);

$request->setMethod(HTTP_Request2::METHOD_GET);

// Request body
$request->setBody("{body}");

try
{
    $response = $request->send();
    echo $response->getBody();
}
catch (HttpException $ex)
{
    echo $ex;
}
########### Python 2.7 #############
import httplib, urllib, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.urlencode({
    # Request parameters
    'locationtype': '{string}',
    'location': '{string}',
    'cultureInfo': '{string}',
})

try:
    conn = httplib.HTTPSConnection('earthnetworks.azure-api.net')
    conn.request("GET", "/getLocations/data/locations/v2/location?searchString={searchString}&%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################

########### Python 3.2 #############
import http.client, urllib.request, urllib.parse, urllib.error, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.parse.urlencode({
    # Request parameters
    'locationtype': '{string}',
    'location': '{string}',
    'cultureInfo': '{string}',
})

try:
    conn = http.client.HTTPSConnection('earthnetworks.azure-api.net')
    conn.request("GET", "/getLocations/data/locations/v2/location?searchString={searchString}&%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################
require 'net/http'

uri = URI('https://earthnetworks.azure-api.net/getLocations/data/locations/v2/location?searchString={searchString}')

query = URI.encode_www_form({
    # Request parameters
    'locationtype' => '{string}',
    'location' => '{string}',
    'cultureInfo' => '{string}'
})

if uri.query && uri.query.length > 0
    uri.query += '&' + query
else
    uri.query = query
end

request = Net::HTTP::Get.new(uri.request_uri)
# Request headers
request['Ocp-Apim-Subscription-Key'] = '{subscription key}'
# Request body
request.body = "{body}"

response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
    http.request(request)
end

puts response.body

Location Search

https://earthnetworks.azure-api.net/getLocations/data/locations/v2/location
Headers
Ocp-Apim-Subscription-Key

Query parameters
searchString

locationtype

location

Optional parameters
verbose

cultureInfo

Max number

 

Radar and Maps

Description:

Radar and Maps provides URLs for Satellite, Radar, and Temperature maps as well as other various images of the United States, Puerto Rico and the Virgin Islands.

Maps can be provided in standard (373×272) size or enlarged (640×480) size. Earth Networks provides the capability for end users to navigate between maps (traveling N, S, E, W), and to zoom in and out between local, regional, and national maps. Navigation XML can be optionally added to provide a way to create an interface for your users to pan and zoom throughout the maps.

An animation option allows for a number of time-sequential images to be returned. Cycling through these images provides for a small animation loop. Note that images should be used in the same order as they are returned in the XML. Radar and Maps provide specific information for the given zip code or city code RequestType “RadarAndMaps” or 5.

Request URL:

https://earthnetworks.azure-api.net/getRadarsandMaps?RequestType=5&ZipCode=<zip code>&PostalCode=<postalcode>&CityCode=<citycode>[&MapType=<Map Type>][&Zoom=<Zoom>][&Animate=<Animate>][&Navigation=<Navigation>][&Enlarge=<Enlarge>]&subscription-key=<Your subscription key>

Request parameters:

RequestType string 5 or RadarAndMaps

Optionaly required parameters:

ZipCode A valid 5-digit zip code or 9- digit zip code

The zip code for the area that you wish to have data returned for.

We now support 9-digit zipcodes.

For example, 20171, 20171-

1234 both of these formats will be accepted if passed in

PostalCode 5-digit number

A series of letters and/or digits appended to a postal address for the purpose of sorting mail.

CityCode integer

The city code that identifies this location. This is the value that will be used in other calls to identify a specific list of stations for the provided city code

Optional parameters:

MapType

1 = Doppler Radar

2 = Infrared Satellite

3 = Satellite/Radar

4 = Visible Satellite

5 = Current Temperatures

6 = High Temps Today

7 = High Temps Tomorrow

8 = Wind Chill/Heat Index

9 = Wind Speed/Direction

10 = Topography

The type of map to retrieve.

Not all map types are available in all zip codes, such as Puerto Rico.

Zoom (Only for US)

1 = Local (closest view)

2 = Metro

3 = Regional

4 = National

8 = Hawaii

10 = Alaska

12 = Puerto Rico/Virgin Islands

The zoom level for the map

to retrieve. If you desire a map of Hawaii, Alaska, Puerto Rico or the Virgin Islands, be sure to specify the corresponding Zoom level. Not all map types are available in all zoom levels.

Animate

0 or blank = Show only the

current map URL

1 = Show a list of URLs for animation loops

Provides the animation image list, rather than a single image XML in the response.
Navigation An XML Node containing an ID attribute as well as two sub-nodes. Contains information about the current category ID and has sub-nodes to indicate the next and previous categories.
Enlarge

0 or blank = Show standard

size map URL(s)

1 = Show large image URL(s)

when 0 is entered standard is returned 363×272 images in the XML response. When 1 is entered enlarged is returned 640×480 images

Request headers:

Ocp-Apim-Subscription-Key string Subscription key which provides access to this API. Found in your Profile.

 

Test request
 

Expected response

<aws:weather xmlns:aws="http://www.aws.com/aws">
<aws:map xmlns:aws="http://www.aws.com/aws" target-zip="20878" size="standard" type="doppler" image-type="local">
<aws:id>180</aws:id>
<aws:img-src height="272" width="363">
http://radarimg.weatherbug.com/images/AWSRadars2/bugradar_metro/7/radar0.large.jpg?rnd=2-092220170819
</aws:img-src>
</aws:map>
<aws:map-navigation xmlns:aws="http://www.aws.com/aws" target-zip="20878" image-type="local">
<aws:id>180</aws:id>
<aws:local>180</aws:local>
<aws:metro>93</aws:metro>
<aws:regional>233</aws:regional>
<aws:national>239</aws:national>
<aws:east status="on">94</aws:east>
<aws:north status="on">56</aws:north>
<aws:northeast status="on">55</aws:northeast>
<aws:northwest status="on">57</aws:northwest>
<aws:south status="on">96</aws:south>
<aws:southeast status="on">95</aws:southeast>
<aws:southwest status="on">97</aws:southwest>
<aws:west status="on">92</aws:west>
<aws:animate status="on">180</aws:animate>
<aws:enlarge status="on">248</aws:enlarge>
<aws:zoom-out status="on">93</aws:zoom-out>
<aws:zoom-in status="off">-1</aws:zoom-in>
</aws:map-navigation>
</aws:weather>
@ECHO OFF

curl -v -X GET "https://earthnetworks.azure-api.net/getRadarsandMaps/?RequestType={RequestType}"
-H "Ocp-Apim-Subscription-Key: {subscription key}"

--data-ascii "{body}" 
using System;
using System.Net.Http.Headers;
using System.Text;
using System.Net.Http;
using System.Web;

namespace CSHttpClientSample
{
    static class Program
    {
        static void Main()
        {
            MakeRequest();
            Console.WriteLine("Hit ENTER to exit...");
            Console.ReadLine();
        }
        
        static async void MakeRequest()
        {
            var client = new HttpClient();
            var queryString = HttpUtility.ParseQueryString(string.Empty);

            // Request headers
            client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{subscription key}");

            var uri = "https://earthnetworks.azure-api.net/getRadarsandMaps/?RequestType={RequestType}&" + queryString;

            var response = await client.GetAsync(uri);
        }
    }
}	
// // This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class JavaSample 
{
    public static void main(String[] args) 
    {
        HttpClient httpclient = HttpClients.createDefault();

        try
        {
            URIBuilder builder = new URIBuilder("https://earthnetworks.azure-api.net/getRadarsandMaps/?RequestType={RequestType}");


            URI uri = builder.build();
            HttpGet request = new HttpGet(uri);
            request.setHeader("Ocp-Apim-Subscription-Key", "{subscription key}");


            // Request body
            StringEntity reqEntity = new StringEntity("{body}");
            request.setEntity(reqEntity);

            HttpResponse response = httpclient.execute(request);
            HttpEntity entity = response.getEntity();

            if (entity != null) 
            {
                System.out.println(EntityUtils.toString(entity));
            }
        }
        catch (Exception e)
        {
            System.out.println(e.getMessage());
        }
    }
}
$(function() {
    var params = {
        // Request parameters
    };

    $.ajax({
            url: "https://earthnetworks.azure-api.net/getRadarsandMaps/?RequestType={RequestType}&" + $.param(params),
            beforeSend: function(xhrObj) {
                // Request headers
                xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key", "{subscription key}");
            },
            type: "GET",
            // Request body
            data: "{body}",
        })
        .done(function(data) {
            alert("success");
        })
        .fail(function() {
            alert("error");
        });
});
#import 

int main(int argc, const char * argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    
    NSString* path = @"https://earthnetworks.azure-api.net/getRadarsandMaps/?RequestType={RequestType}";
    NSArray* array = @[
                         // Request parameters
                         @"entities=true",
                      ];
    
    NSString* string = [array componentsJoinedByString:@"&"];
    path = [path stringByAppendingFormat:@"?%@", string];

    NSLog(@"%@", path);

    NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:path]];
    [_request setHTTPMethod:@"GET"];
    // Request headers
    [_request setValue:@"{subscription key}" forHTTPHeaderField:@"Ocp-Apim-Subscription-Key"];
    // Request body
    [_request setHTTPBody:[@"{body}" dataUsingEncoding:NSUTF8StringEncoding]];
    
    NSURLResponse *response = nil;
    NSError *error = nil;
    NSData* _connectionData = [NSURLConnection sendSynchronousRequest:_request returningResponse:&response error:&error];

    if (nil != error)
    {
        NSLog(@"Error: %@", error);
    }
    else
    {
        NSError* error = nil;
        NSMutableDictionary* json = nil;
        NSString* dataString = [[NSString alloc] initWithData:_connectionData encoding:NSUTF8StringEncoding];
        NSLog(@"%@", dataString);
        
        if (nil != _connectionData)
        {
            json = [NSJSONSerialization JSONObjectWithData:_connectionData options:NSJSONReadingMutableContainers error:&error];
        }
        
        if (error || !json)
        {
            NSLog(@"Could not parse loaded json with error:%@", error);
        }
        
        NSLog(@"%@", json);
        _connectionData = nil;
    }
    
    [pool drain];

    return 0;
}
// This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
require_once 'HTTP/Request2.php';

$request = new Http_Request2('https://earthnetworks.azure-api.net/getRadarsandMaps/?RequestType={RequestType}');
$url = $request->getUrl();

$headers = array(
    // Request headers
    'Ocp-Apim-Subscription-Key' => '{subscription key}',
);

$request->setHeader($headers);

$parameters = array(
    // Request parameters
);

$url->setQueryVariables($parameters);

$request->setMethod(HTTP_Request2::METHOD_GET);

// Request body
$request->setBody("{body}");

try
{
    $response = $request->send();
    echo $response->getBody();
}
catch (HttpException $ex)
{
    echo $ex;
}
########### Python 2.7 #############
import httplib, urllib, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.urlencode({
})

try:
    conn = httplib.HTTPSConnection('earthnetworks.azure-api.net')
    conn.request("GET", "/getRadarsandMaps/?RequestType={RequestType}&%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################

########### Python 3.2 #############
import http.client, urllib.request, urllib.parse, urllib.error, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.parse.urlencode({
})

try:
    conn = http.client.HTTPSConnection('earthnetworks.azure-api.net')
    conn.request("GET", "/getRadarsandMaps/?RequestType={RequestType}&%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################
require 'net/http'

uri = URI('https://earthnetworks.azure-api.net/getRadarsandMaps/?RequestType={RequestType}')

request = Net::HTTP::Get.new(uri.request_uri)
# Request headers
request['Ocp-Apim-Subscription-Key'] = '{subscription key}'
# Request body
request.body = "{body}"

response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
    http.request(request)
end

puts response.body

Radar and Maps

https://earthnetworks.azure-api.net/getRadarsandMaps?RequestType=5&ZipCode=&PostalCode=&CityCode=[&MapType=][&Zoom=][&Animate=][&Navigation=][&Enlarge=]&subscription-key=

Headers
Ocp-Apim-Subscription-Key

Query parameters
RequestType

Optional required parameters
ZipCode

CityCode

PostalCode

Optional parameters
MapType

Zoom (Only for US)

Animate

Navigation

Enlarge

 

Real Time Weather Observations V4

Description:

The Earth Networks Observation Data Feed will provide you with a set of current condition data based on the location or station id requested. For Location the logic is in place to always return the best observation for the location requested based on age, distance and accuracy. For station id the logic is to always return observations for that station id.

Request URL for latitudelongitude:

https://earthnetworks.azure- api.net/data/observations/v4/current?[&cultureinfo][&locationtype][&location][&units][&r uledetails][&verbose][&metadata][&includeqcflags]

Request URL for stationid:

https://earthnetworks.azure- api.net/data/observations/v4/current?[&cultureinfo][&locationtype][&stationid][&providerid][&units][&ruledetails][&verbose][&metadata][&includeqcflags]

Request parameters:

locationtype string „Latitudelongitude“ or „stationid“
location
(if location type is „latitudelongitude“)
string Latitude/Longitude in format: <Latitude>,<Longitude>
providerid (if  locationtype is „stationid“) String Must be valid ID from Search Weather Station API for station

Optional parameters:

verbose boolean

Abbreviations (false)

or long variable names (true)

true, false
units string Metric or English units “metric” or “English”
metadata boolean

determines whether

or not to return metadata

“false” or “true”
cultureinfo string Language “en-en”, “es-es”
ruledetails boolean

determines whether

or not to display explanation of rollover logic

“false” or “true”
includeqcflags boolean provides qc value for filtered measurements “false” or “true”

Request headers:

Ocp-Apim-Subscription-Key string Subscription key which provides access to this API. Found in your Profile.

 

Test request
 

Expected response

{
    "observation":
    {
        "key": "3_REKVL",
        "stationId": "REKVL",
        "providerId": 3,
        "observationTimeLocalStr": "2016-02-08T10:55:38",
        "observationTimeUtcStr": "2016-02-08T15:55:38",
        "iconCode": 3,
        "altimeter": null,
        "altimeterRate": null,
        "dewPoint": 27.8,
        "dewPointQc": "S",
        "dewPointRate": null,
        "heatIndex": 42.3,
        "heatIndexQc": "S",
        "humidity": 56.1,
        "humidityQc": "S",
        "humidityRate": 0.2,
        "humidityRateQc": "S",
        "pressureSeaLevel": 29.76,
        "pressureSeaLevelQc": "S",
        "pressureSeaLevelRate": -0.01,
        "pressureSeaLevelRateQc": "S",
        "rainDaily": 0.0,
        "rainDailyQc": "S",
        "rainRate": 0.0,
        "rainRateQc": "S",
        "rainMonthly": 0.77,
        "rainMonthlyQc": "C",
        "rainYearly": 2.1,
        "rainYearlyQc": "C",
        "snowDaily": null,
        "snowRate": null,
        "snowMonthly": null,
        "snowYearly": null,
        "temperature": 42.3,
        "temperatureQc": "S",
        "temperatureRate": 2.7,
        "temperatureRateQc": "S",
        "visibility": null,
        "visibilityRate": null,
        "windChill": 42.3,
        "windChillQc": "S",
        "windSpeed": 0.0,
        "windSpeedQc": "S",
        "windDirection": 90,
        "windDirectionQc": "S",
        "windSpeedAvg": 2.2,
        "windSpeedAvgQc": "S",
        "windDirectionAvg": 84,
        "windDirectionAvgQc": "S",
        "windGustHourly": 13.4,
        "windGustHourlyQc": "S",
        "windGustTimeLocalHourlyStr": "2016-02-08T10:15:00",
        "windGustTimeUtcHourlyStr": "2016-02-08T15:15:00",
        "windGustDirectionHourly": 14,
        "windGustDirectionHourlyQc": "S",
        "windGustDaily": 13.4,
        "windGustDailyQc": "C",
        "windGustTimeLocalDailyStr": "2016-02-08T10:16:00",
        "windGustTimeUtcDailyStr": "2016-02-08T15:16:00",
        "windGustDirectionDaily": 14,
        "windGustDirectionDailyQc": "C",
        "observationTimeAdjustedLocalStr": "2016-02-08T10:55:57",
        "wetBulbTemperature": 36.5,
        "wetBulbTemperatureQc": "S",
        "RuleDetails": [],
        "FinalDistance": 1.8924466211633089,
        "FromHourlyForecastLocationId": null,
        "IconDescription": "Partly Cloudy",
        "feelsLike": 42.3
    },
    "highlow":
    {
        "humidityHigh": 82.0,
        "humidityHighQc": "C",
        "humidityHighLocalStr": "2016-02-08T07:28:00",
        "humidityHighUtcStr": "2016-02-08T12:28:00",
        "humidityLow": 53.9,
        "humidityLowQc": "C",
        "humidityLowLocalStr": "2016-02-08T09:03:00",
        "humidityLowUtcStr": "2016-02-08T14:03:00",
        "pressureSeaLevelHigh": 29.81,
        "pressureSeaLevelHighQc": "C",
        "pressureSeaLevelHighLocalStr": "2016-02-08T00:00:00",
        "pressureSeaLevelHighUtcStr": "2016-02-08T05:00:00",
        "pressureSeaLevelLow": 29.72,
        "pressureSeaLevelLowQc": "C",
        "pressureSeaLevelLowLocalStr": "2016-02-08T03:03:00",
        "pressureSeaLevelLowUtcStr": "2016-02-08T08:03:00",
        "rainRateMax": 0.0,
        "rainRateMaxQc": "C",
        "rainRateMaxLocalStr": "2016-02-08T00:00:00",
        "rainRateMaxUtcStr": "2016-02-08T05:00:00",
        "temperatureHigh": 43.1,
        "temperatureHighQc": "C",
        "temperatureHighLocalStr": "2016-02-08T10:44:00",
        "temperatureHighUtcStr": "2016-02-08T15:44:00",
        "temperatureLow": 27.8,
        "temperatureLowQc": "C",
        "temperatureLowLocalStr": "2016-02-08T07:19:00",
        "temperatureLowUtcStr": "2016-02-08T12:19:00"
    },
    "station":
    {
        "StationId": "REKVL",
        "ProviderId": 3,
        "ProviderName": "Earth Networks Inc",
        "StationName": "Rock Creek Valley ES",
        "Latitude": 39.0830555555556,
        "Longitude": -77.1022222222222,
        "ElevationAboveSeaLevel": 352.0
    }
}
@ECHO OFF

curl -v -X GET "https://earthnetworks.azure-api.net/data/observations/v4/current??locationtype={string}&location={string}&units={string}&ruledetails={boolean}&verbose={boolean}&metadata={boolean}&includeqcflags={boolean}"
-H "Ocp-Apim-Subscription-Key: {subscription key}"

--data-ascii "{body}" 
using System;
using System.Net.Http.Headers;
using System.Text;
using System.Net.Http;
using System.Web;

namespace CSHttpClientSample
{
    static class Program
    {
        static void Main()
        {
            MakeRequest();
            Console.WriteLine("Hit ENTER to exit...");
            Console.ReadLine();
        }
        
        static async void MakeRequest()
        {
            var client = new HttpClient();
            var queryString = HttpUtility.ParseQueryString(string.Empty);

            // Request headers
            client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{subscription key}");

            // Request parameters
            queryString["locationtype"] = "{string}";
            queryString["location"] = "{string}";
            queryString["units"] = "{string}";
            queryString["ruledetails"] = "{boolean}";
            queryString["verbose"] = "{boolean}";
            queryString["metadata"] = "{boolean}";
            queryString["includeqcflags"] = "{boolean}";
            var uri = "https://earthnetworks.azure-api.net/data/observations/v4/current?&" + queryString;

            var response = await client.GetAsync(uri);
        }
    }
}	
// // This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class JavaSample 
{
    public static void main(String[] args) 
    {
        HttpClient httpclient = HttpClients.createDefault();

        try
        {
            URIBuilder builder = new URIBuilder("https://earthnetworks.azure-api.net/data/observations/v4/current?");

            builder.setParameter("locationtype", "{string}");
            builder.setParameter("location", "{string}");
            builder.setParameter("units", "{string}");
            builder.setParameter("ruledetails", "{boolean}");
            builder.setParameter("verbose", "{boolean}");
            builder.setParameter("metadata", "{boolean}");
            builder.setParameter("includeqcflags", "{boolean}");

            URI uri = builder.build();
            HttpGet request = new HttpGet(uri);
            request.setHeader("Ocp-Apim-Subscription-Key", "{subscription key}");


            // Request body
            StringEntity reqEntity = new StringEntity("{body}");
            request.setEntity(reqEntity);

            HttpResponse response = httpclient.execute(request);
            HttpEntity entity = response.getEntity();

            if (entity != null) 
            {
                System.out.println(EntityUtils.toString(entity));
            }
        }
        catch (Exception e)
        {
            System.out.println(e.getMessage());
        }
    }
}
$(function() {
    var params = {
        // Request parameters
        "locationtype": "{string}",
        "location": "{string}",
        "units": "{string}",
        "ruledetails": "{boolean}",
        "verbose": "{boolean}",
        "metadata": "{boolean}",
        "includeqcflags": "{boolean}",
    };

    $.ajax({
            url: "https://earthnetworks.azure-api.net/data/observations/v4/current?&" + $.param(params),
            beforeSend: function(xhrObj) {
                // Request headers
                xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key", "{subscription key}");
            },
            type: "GET",
            // Request body
            data: "{body}",
        })
        .done(function(data) {
            alert("success");
        })
        .fail(function() {
            alert("error");
        });
});
#import 

int main(int argc, const char * argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    
    NSString* path = @"https://earthnetworks.azure-api.net/data/observations/v4/current?";
    NSArray* array = @[
                         // Request parameters
                         @"entities=true",
                         @"locationtype={string}",
                         @"location={string}",
                         @"units={string}",
                         @"ruledetails={boolean}",
                         @"verbose={boolean}",
                         @"metadata={boolean}",
                         @"includeqcflags={boolean}",
                      ];
    
    NSString* string = [array componentsJoinedByString:@"&"];
    path = [path stringByAppendingFormat:@"?%@", string];

    NSLog(@"%@", path);

    NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:path]];
    [_request setHTTPMethod:@"GET"];
    // Request headers
    [_request setValue:@"{subscription key}" forHTTPHeaderField:@"Ocp-Apim-Subscription-Key"];
    // Request body
    [_request setHTTPBody:[@"{body}" dataUsingEncoding:NSUTF8StringEncoding]];
    
    NSURLResponse *response = nil;
    NSError *error = nil;
    NSData* _connectionData = [NSURLConnection sendSynchronousRequest:_request returningResponse:&response error:&error];

    if (nil != error)
    {
        NSLog(@"Error: %@", error);
    }
    else
    {
        NSError* error = nil;
        NSMutableDictionary* json = nil;
        NSString* dataString = [[NSString alloc] initWithData:_connectionData encoding:NSUTF8StringEncoding];
        NSLog(@"%@", dataString);
        
        if (nil != _connectionData)
        {
            json = [NSJSONSerialization JSONObjectWithData:_connectionData options:NSJSONReadingMutableContainers error:&error];
        }
        
        if (error || !json)
        {
            NSLog(@"Could not parse loaded json with error:%@", error);
        }
        
        NSLog(@"%@", json);
        _connectionData = nil;
    }
    
    [pool drain];

    return 0;
}
getUrl();

$headers = array(
    // Request headers
    'Ocp-Apim-Subscription-Key' => '{subscription key}',
);

$request->setHeader($headers);

$parameters = array(
    // Request parameters
    'locationtype' => '{string}',
    'location' => '{string}',
    'units' => '{string}',
    'ruledetails' => '{boolean}',
    'verbose' => '{boolean}',
    'metadata' => '{boolean}',
    'includeqcflags' => '{boolean}',
);

$url->setQueryVariables($parameters);

$request->setMethod(HTTP_Request2::METHOD_GET);

// Request body
$request->setBody("{body}");

try
{
    $response = $request->send();
    echo $response->getBody();
}
catch (HttpException $ex)
{
    echo $ex;
}

?>
########### Python 2.7 #############
import httplib, urllib, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.urlencode({
    # Request parameters
    'locationtype': '{string}',
    'location': '{string}',
    'units': '{string}',
    'ruledetails': '{boolean}',
    'verbose': '{boolean}',
    'metadata': '{boolean}',
    'includeqcflags': '{boolean}',
})

try:
    conn = httplib.HTTPSConnection('earthnetworks.azure-api.net')
    conn.request("GET", "/data/observations/v4/current?&%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################

########### Python 3.2 #############
import http.client, urllib.request, urllib.parse, urllib.error, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.parse.urlencode({
    # Request parameters
    'locationtype': '{string}',
    'location': '{string}',
    'units': '{string}',
    'ruledetails': '{boolean}',
    'verbose': '{boolean}',
    'metadata': '{boolean}',
    'includeqcflags': '{boolean}',
})

try:
    conn = http.client.HTTPSConnection('earthnetworks.azure-api.net')
    conn.request("GET", "/data/observations/v4/current?&%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################
require 'net/http'

uri = URI('https://earthnetworks.azure-api.net/data/observations/v4/current?')

query = URI.encode_www_form({
    # Request parameters
    'locationtype' => '{string}',
    'location' => '{string}',
    'units' => '{string}',
    'ruledetails' => '{boolean}',
    'verbose' => '{boolean}',
    'metadata' => '{boolean}',
    'includeqcflags' => '{boolean}'
})

if uri.query && uri.query.length > 0
    uri.query += '&' + query
else
    uri.query = query
end

request = Net::HTTP::Get.new(uri.request_uri)
# Request headers
request['Ocp-Apim-Subscription-Key'] = '{subscription key}'
# Request body
request.body = "{body}"

response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
    http.request(request)
end

puts response.body

Real Time Weather Observations V4

https://earthnetworks.azure-api.net/data/observations/v4/current?[&cultureinfo][&locationtype][&location][&units][&r uledetails][&verbose][&metadata][&includeqcflags]
Headers
Ocp-Apim-Subscription-Key

Choose:
Query parameters
locationtype

location

stationid

providerid

Optional parameters
verbose

Units

Metadata

Cultureinfo

Ruledetails

Includeqcflags

 

Real Time Weather Observations V3

Description:

The Earth Networks Observation Data Feed will provide you with a set of current condition data based on the location or station id requested. For Location the logic is in place to always return the best observation for the location requested based on age, distance and accuracy. For station id the logic is to always return observations for that station id.

Request URL:

https://earthnetworks.azure-api.net/data/observations/v3/current?[&locationtype][&location][&verbose]

v3 Parameters for Latitude/Longitude:

Request parameters:

Parameter
Name
Description Input options Default
location Latitude and Longitude Coordinates Must be valid Latitude/Longitude in format: “<Latitude>,<Longitude>” N/A

Optional parameters:

Parameter
Name
Description Input options Default
units Metric or English units “metric” or “english” “metric”
cultureinfo Language “en-en” (English), “es-es” (Spanish) “en-en”
verbose Abbreviations (false) or long variable names (true) “false” or “true” “false”

Request headers:

Ocp-Apim-Subscription-Key string Subscription key which provides access to this API. Found in your Profile.

v3 Parameters for StationId:

Request parameters:

Parameter
Name
Description Input options Default
providerid Provider the station is part of Must be validID from Search Weather StationAPI for station N/A
stationid Identifier forstation Must be validID from Search Weather StationAPI for station N/A

Optional parameters:

Parameter
Name
Description Input options Default
units Metric or English units “metric” or “english” “metric”
cultureinfo Language “en-en” (English), “es-es” (Spanish) “en-en”
verbose Abbreviations (false) or long variable names (true) “false” or “true” “false”

Request headers:

Ocp-Apim-Subscription-Key string Subscription key which provides access to this API. Found in your Profile.

Observation Variables:

The table below outlines the Observation variables contained within the Observation data feed. It also defines the units, format, min/max values, and precision for each variable.

Please note that extensive quality control measures of the data will be implemented to ensure that data values are reasonable. While rare, it is possible that data may occasionally be missing in the Observation Data Feed. If the data is missing, it will be saved as “Null”. A null space is defined as being this: Null = ‘ ‘.

Test request
 

Expected response

{
    "observation":
    {
        "key": "3_STCAM",
        "stationId": "STCAM",
        "providerId": 3,
        "observationTimeLocalStr": "2014-07-18T11:33:43",
        "observationTimeUtcStr": "2014-07-18T15:33:43",
        "iconCode": 1,
        "altimeter": null,
        "altimeterRate": null,
        "dewPoint": 53.6,
        "dewPointRate": null,
        "heatIndex": 78.4,
        "humidity": 42.3,
        "humidityRate": -5.0,
        "pressureSeaLevel": 30.25,
        "pressureSeaLevelRate": 0.0,
        "rainDaily": 0.0,
        "rainRate": 0.0,
        "rainMonthly": 2.53,
        "rainYearly": 16.65,
        "snowDaily": null,
        "snowRate": null,
        "snowMonthly": null,
        "snowYearly": null,
        "temperature": 78.4,
        "temperatureRate": 2.7,
        "visibility": null,
        "visibilityRate": null,
        "windChill": 78.4,
        "windSpeed": 1.8,
        "windDirection": 322,
        "windSpeedAvg": 2.6,
        "windDirectionAvg": 32,
        "windGustHourly": 6.4,
        "windGustTimeLocalHourlyStr": "2014-07-18T11:04:00",
        "windGustTimeUtcHourlyStr": "2014-07-18T15:04:00",
        "windGustDirectionHourly": 62,
        "windGustDaily": 6.8,
        "windGustTimeLocalDailyStr": "2014-07-18T09:56:00",
        "windGustTimeUtcDailyStr": "2014-07-18T13:56:00",
        "windGustDirectionDaily": 62,
        "observationTimeAdjustedLocalStr": "2014-07-18T11:34:13",
        "wetBulbTemperature": 63.2,
        "RuleDetails": [],
        "FinalDistance": 1.893967158296517,
        "FromHourlyForecastLocationId": null,
        "feelsLike": 78.4
    },
    "highlow":
    {
        "humidityHigh": 96.6,
        "humidityHighLocalStr": "2014-07-18T02:07:00",
        "humidityHighUtcStr": "2014-07-18T06:07:00",
        "humidityLow": 39.2,
        "humidityLowLocalStr": "2014-07-18T11:24:00",
        "humidityLowUtcStr": "2014-07-18T15:24:00",
        "pressureSeaLevelHigh": 30.26,
        "pressureSeaLevelHighLocalStr": "2014-07-18T09:02:00",
        "pressureSeaLevelHighUtcStr": "2014-07-18T13:02:00",
        "pressureSeaLevelLow": 30.15,
        "pressureSeaLevelLowLocalStr": "2014-07-18T00:01:00",
        "pressureSeaLevelLowUtcStr": "2014-07-18T04:01:00",
        "rainRateMax": 0.0,
        "rainRateMaxLocalStr": "2014-07-18T00:00:00",
        "rainRateMaxUtcStr": "2014-07-18T04:00:00",
        "temperatureHigh": 79.9,
        "temperatureHighLocalStr": "2014-07-18T11:29:00",
        "temperatureHighUtcStr": "2014-07-18T15:29:00",
        "temperatureLow": 58.7,
        "temperatureLowLocalStr": "2014-07-18T06:21:00",
        "temperatureLowUtcStr": "2014-07-18T10:21:00"
    },
    "station":
    {
        "StationId": "STCAM",
        "ProviderId": 3,
        "ProviderName": "Earth Networks Inc",
        "StationName": "St. Camillus School",
        "Latitude": 39.0105555555556,
        "Longitude": -76.9827777777778,
        "ElevationAboveSeaLevel": 64.9224
    }
}

The Earth Networks Observation Data Feed Version 3.0

Variable Field
(short/long)
Variable Name Units
(Metric/English)
Format Min
Value
Max
Value
Precision
k/key Key (always null)
si/stationId Station ID Text 4 or 5
Characters
N/A N/A 4 or 5
Character s
pi/providerId Provider ID Whole Number 1 or 2
Digits
N/A N/A Whole
Number
otls/observationTimeLoc alStr Observation
Time, Local
Text/Local Time Zone of Station yyyy-MM- ddThh:mm: ss 1969-12-
31T19:00:
00
Presen t Time 1 second
otus/observationTimeUt cStr Observation
Time, UTC
Text/Universal Time
Zone
yyyy-MM- ddThh:mm: ss 1970-11-
01T00:00:
00
Presen t Time 1 second
Ic/iconCode Icon Code Whole Number ### 000 282 Whole
Number
a/altimeter Altimeter (Millibars/inches of
Mercury)
#### N/A N/A 1 millibar/0.
01 inches of Mercury
ar/altimeterRate Altimeter Rate (Millibars/inches of
Mercury) per hour
##/-## N/A N/A 1 millibar/0.
01 inches of Mercury per hour
dp/dewPoint Dew Point Degrees
(Celsius/Fahrenheit)
##.#/-##.# -100 100 0.1 degrees
dpr/dewPointRate Dew Point Rate Degrees (Celsius/Fahrenheit) per hour ##.#/-##.# N/A N/A 0.1 degrees per hour
hi/heatIndex Heat Index Degrees
(Celsius/Fahrenheit)
##.#/-##.# -100 160 0.1 degrees
h/humidity Humidity Percent relative humidity ###.# 0 100 0.1 percent
hr/humidityRate Humidity Rate Change per hour of percent relative humidity ##.#/-##.# -100 100 0.1 percent per hour
psl/pressureSeaLevel Sea Level
Pressure
(Millibars/inches of
Mercury)
##.## or
####.#
N/A N/A 1 millibar/0.
01 inches of Mercury
pslr/pressureSeaLevelRat e Sea Level
Pressure Rate
(Millibars/inches of
Mercury) per hour
##.##/-
##.##
N/A N/A 1 millibar/0.
01 inches of Mercury per hour
rd/rainDaily Daily Rain (Millimeters/Inches) ###.# 0 N/A 0.1 millimeters
/ 0.01 inches
rr/rainRate Rain Rate (Millimeters/Inches)
per hour
###.# 0 N/A 0.1 millimeters
/ 0.01 inches per hour
rm/rainMonthly Monthly Rain (Millimeters/Inches) ###.# 0 N/A 0.1 millimeters
/ 0.01 inches
ry/rainYearly Yearly Rain (Millimeters/Inches) ###.# 0 N/A 0.1 millimeters
/ 0.01 inches
sd/snowDaily Daily Snow (Millimeters/Inches) ###.# 0 N/A 0.1 millimeters
/ 0.01 inches
sr/snowRate Snow Rate (Millimeters/Inches)
per hour
###.# 0 N/A 0.1 millimeters
/ 0.01 inches per hour
sm/snowMonthly Monthly Snow (Millimeters/Inches) ###.# 0 N/A 0.1 millimeters
/ 0.01 inches
sy/snowYearly Yearly Snow (Millimeters/Inches) ###.# 0 N/A 0.1 millimeters
/ 0.01 inches
t/temperature Temperature Degrees
(Celsius/Fahrenheit)
##.#/-##.# -100 100 0.1 degrees
tr/temperatureRate Temperature
Rate
Degrees (Celsius/ Fahrenheit) per hour ##.#/-##.# 0 N/A 0.1 degrees per hour
v/visibility Visibility Kilometers/Miles ##.# 0 N/A 0.1 kilometers
/ 0.1 miles
vr/visibilityRate Visibility Rate Kilometers/Miles per hour ##.# 0 N/A 0.1 kilometers
/ 0.1 miles per hour
wc/windChill Wind Chill Degrees
(Celsius/Fahrenheit)
##.#/-##.# -100 100 0.1 degrees
ws/windSpeed Wind Speed Kilometers/Miles per hour ##.# 0 N/A 0.1 kilometers
/ 0.1 miles
per hour
wd/windDirection Wind Direction Degrees from north
(clockwise)
### 0 359 1 degree
wsa/windSpeedAverage Average Wind
Speed
Kilometers/Miles per hour ##.# 0 N/A 0.1 kilometers
/ 0.1 miles per hour
wda/windDirectionAvera ge Average Wind
Direction
Degrees from north
(clockwise)
### 0 359 1 degree
wgh/windGustHourly Hourly Wind
Gust
Kilometers/Miles per hour ##.# 0 N/A 0.1 kilometers
/ 0.1 miles
per hour
wgtlhs/ windGustTimeLocalHourl yStr Hourly Wind
Gust Time, Local
Text/Local Time Zone of Station yyyy-MM- ddThh:mm: ss 1969-12-
31T19:00:
00
Presen t Time 1 second
wgtuhs/ windGustTimeUtcHourly Str Hourly Wind
Gust Time, UTC
Text/Universal Time
Zone
yyyy-MM- ddThh:mm: ss 1970-11-
01T00:00:
00
Presen t Time 1 second
wgdh/
windGustDirectionHourly
Hourly Wind
Gust Direction
Degrees from north
(clockwise)
### 0 359 1 degree
wgd/windGustDaily Daily Wind Gust Kilometers/Miles per hour ##.# 0 N/A 0.1 kilometers
/ 0.1 miles per hour
wgtlds/ windGustTimeLocalDaily Str Daily Wind Gust
Time, Local
Text/Local Time Zone of Station yyyy-MM- ddThh:mm: ss 1969-12-
31T19:00:
00
Presen t Time 1 second
wgtuds/ windGustTimeUtcDailySt r Daily Wind Gust
Time, UTC String
Text/Universal Time
Zone
yyyy-MM- ddThh:mm: ss 1970-11-
01T00:00:
00
Presen t Time 1 second
wgdd/
windGustDirectionDaily
Daily Wind Gust
Direction
Degrees from north
(clockwise)
### 0 359 1 degree
wbt/wetBulbTemperatur e Wet Bulb
Temperature
Degrees
(Celsius/Fahrenheit)
##.#/-##.# 80 140 0.1 degrees
fl/feelsLike Feels Like (Heat Index/Wind Chill) Degrees
(Celsius/Fahrenheit)
##.#/-##.# -100 160 0.1 degrees
humidityHigh Humidity Daily
High
Percent % ##.# 0 100 0.1 percent
humidityHighLocalStr Humidity Daily
High, Local
Text/Local Time Zone of Station yyyy-MM- ddThh:mm: ss 1969-12-
31T19:00:
00
Presen t Time 1 second
humidityHighUtcStr Humidity Daily
High, UTC String
Text/Universal Time
Zone
yyyy-MM- ddThh:mm: ss 1970-11-
01T00:00:
00
Presen t Time 1 second
humidityLow Humidity Daily
Low
Percent % ##.# 0 100 0.1 percent
humidityLowLocalStr Humidity Daily Low, Local Time String Text/Universal Time
Zone
yyyy-MM- ddThh:mm: ss 1970-11-
01T00:00:
00
Presen t Time 1 second
humidityLowUtcStr Humidity Daily
Low, UTC String
Text/Universal Time
Zone
yyyy-MM- ddThh:mm: ss 1970-11-
01T00:00:
00
Presen t Time 1 second
pressureSeaLevelHigh Mean Sea Level
Pressure (MSLP)
Millibars/Inches of
Mercury
##.## or
####.#
28.00 32.00 .01
pressureSeaLevelHighL
ocalStr
Daily High MSLP, Local Time String Text/Universal Time
Zone
yyyy-MM- ddThh:mm: ss 1970-11-
01T00:00:
00
Presen t Time 1 second
pressureSeaLevelHighU
tcStr
Daily High MSLP, UTC String Text/Universal Time
Zone
yyyy-MM- ddThh:mm: ss 1970-11-
01T00:00:
00
Presen t Time 1 second
pressureSeaLevelLow Mean Sea Level
Pressure (MSLP)
Millibars/Inches of
Mercury
##.## or
####.#
28.00 32.00 .01
pressureSeaLevelLowLo
calStr
Daily Low MSLP, Local Time String Text/Universal Time
Zone
yyyy-MM- ddThh:mm: ss 1970-11-
01T00:00:
00
Presen t Time 1 second
pressureSeaLevelLowUt
cStr
Daily Low MSLP, UTC String Text/Universal Time
Zone
yyyy-MM- ddThh:mm: ss 1970-11-
01T00:00:
00
Presen t Time 1 second
rainRateMax Daily Max Rain
Rate
milimeters or inches per hour ##.## 00.00 20.00 .01
rainRateMaxLocalStr Daily Max Rain Rate, Local Time String Text/Universal Time
Zone
yyyy-MM- ddThh:mm: ss 1970-11-
01T00:00:
00
Presen t Time 1 second
rainRateMaxUtcStr Daily Max Rain
Rate, UTC String
Text/Universal Time
Zone
yyyy-MM- ddThh:mm: ss 1970-11-
01T00:00:
00
Presen t Time 1 second
temperatureHigh Daily High
Temperature
Degrees F or C ###.# -80 140 .1
temperatureHighLocalS
tr
Daily High Temperature, Local Time String Text/Universal Time
Zone
yyyy-MM- ddThh:mm: ss 1970-11-
01T00:00:
00
Presen t Time 1 second
temperatureHighUtcStr Daily High Temperature, UTC String Text/Universal Time
Zone
yyyy-MM- ddThh:mm: ss 1970-11-
01T00:00:
00
Presen t Time 1 second
temperatureLow Daily Low
Temperature
Degrees F or C ###.# -80 140 .1
temperatureLowLocalSt
r
Daily Low Temperature, Local Time String Text/Universal Time
Zone
yyyy-MM- ddThh:mm: ss 1970-11-
01T00:00:
00
Presen t Time 1 second
temperatureLowUtcStr Humidity Low, UTC String Text/Universal Time
Zone
yyyy-MM- ddThh:mm: ss 1970-11-
01T00:00:
00
Presen t Time 1 second
si/stationId Station ID Text 4 or 5
Characters
N/A N/A 4 or 5
Character s
pi/providerId Provider ID Whole Number 1 or 2
Digits
N/A N/A Whole
Number
ProviderName Provider Name Text N/A N/A N/A N/A
StationName Station Name Text N/A N/A N/A N/A
Latitude Latitude Decimal ##.######
##
N/A N/A N/A
Longitude Longitude Decimal ##.######
##
N/A N/A N/A
ElevationAboveSeaLevel Elevation Above
Sea Level
Decimal ##.#### N/A N/A N/A

Wind Direction Descriptor Lookup Table

Compass Wind
Direction
Wind Direction Wind Direction Abbreviation
349-359 or 0-11 north N
12-34 north-northeast NNE
35-56 northeast NE
57-78 east-northeast ENE
79-101 east E
102-123 east-southeast ESE
124-146 southeast SE
147-168 south-southeast SSE
169-191 south S
192-213 south-southwest SSW
214-236 southwest SW
237-258 west-southwest WSW
259-281 west W
282-303 west-northwest WNW
304-326 northwest NW
327-348 north-northwest NNW

Icon Codes

Icon Code Icon Description Day or Night
000 Clear Day
001 Cloudy Day
002 Partly Cloudy Night
003 Partly Cloudy Day
004 Partly Sunny Day
005 Rain Day
006 Thunderstorms Day
007 Sunny Day
008 Snow Day
009 Flurries Day
010 Unknown Day
011 Chance of Snow Day
012 Snow Night
013 Cloudy Night
014 Rain Night
015 Chance of Rain Night
016 Partly Cloudy Night
017 Clear Night
018 Thunderstorms Night
019 Chance of Flurries Day
020 Chance of Rain Day
021 Chance of Sleet Day
022 Chance of Storms Day
023 Hazy Day
024 Mostly Cloudy Day
025 Sleet Day
026 Mostly Sunny Day
027 Chance of Flurries Night
028 Chance of Sleet Night
029 Chance of Snow Night
030 Chance of Storms Night
031 Clear Night
032 Flurries Night
033 Hazy Night
034 Mostly Cloudy Day
035 Mostly Sunny Day
036 Sleet Night
037 Unknown Night
038 Chance of Rain Showers Day
039 Chance of Snow Showers Day
040 Snow Showers Day
041 Rain Showers Day
042 Chance of Rain Showers Night
043 Chance of Snow Showers Night
044 Snow Showers Night
045 Rain Showers Night
046 Freezing Rain Day
047 Freezing Rain Night
048 Chance of Freezing Rain Day
049 Chance of Freezing Rain Night
050 Windy Day
051 Foggy Day
052 Scattered Showers Day
053 Scattered Thunderstorms Day
054 Light Snow Day
055 Chance of Light Snow Day
056 Frozen Mix Day
057 Chance of Frozen Mix Day
058 Drizzle Day
059 Chance of Drizzle Day
060 Freezing Drizzle Day
061 Chance of Freezing Drizzle Day
062 Heavy Snow Day
063 Heavy Rain Day
064 Hot and Humid Day
065 Very Hot Day
066 Increasing Clouds Day
067 Clearing Day
068 Mostly Cloudy Day
069 Very Cold Day
070 Mostly Clear Night
071 Increasing Clouds Night
072 Clearing Night
073 Mostly Cloudy Night
074 Very Cold Night
075 Warm and Humid Night
076 Now Day
077 Exclamation Day
078 30% Chance of Snow Day
079 40% Chance of Snow Day
080 50% Chance of Snow Day
081 30% Chance of Rain Night
082 40% Chance of Rain Night
083 50% Chance of Rain Night
084 30% Chance of Flurries Day
085 40% Chance of Flurries Day
086 50% Chance of Flurries Day
087 30% Chance of Rain Day
088 40% Chance of Rain Day
089 50% Chance of Rain Day
090 30% Chance of Sleet Day
091 40% Chance of Sleet Day
092 50% Chance of Sleet Day
093 30% Chance of Storms Day
094 40% Chance of Storms Day
095 50% Chance of Storms Day
096 30% Chance of Flurries Night
097 40% Chance of Flurries Night
098 50% Chance of Flurries Night
099 30% Chance of Sleet Night
100 40% Chance of Sleet Night
101 50% Chance of Sleet Night
102 30% Chance of Snow Night
103 40% Chance of Snow Night
104 50% Chance of Snow Night
105 30% Chance of Storms Night
106 40% Chance of Storms Night
107 50% Chance of Storms Night
108 30% Chance Rain Showers Day
109 40% Chance Rain Showers Day
110 50% Chance Rain Showers Day
111 30% Chance Snow Showers Day
112 40% Chance Snow Showers Day
113 50% Chance Snow Showers Day
114 30% Chance Rain Showers Night
115 40% Chance Rain Showers Night
116 50% Chance Rain Showers Night
117 30% Chance Snow Showers Night
118 40% Chance Snow Showers Night
119 50% Chance Snow Showers Night
120 30% Chance Freezing Rain Day
121 40% Chance Freezing Rain Day
122 50% Chance Freezing Rain Day
123 30% Chance Freezing Rain Night
124 40% Chance Freezing Rain Night
125 50% Chance Freezing Rain Night
126 30% Chance Light Snow Day
127 40% Chance Light Snow Day
128 50% Chance Light Snow Day
129 30% Chance Frozen Mix Day
130 40% Chance Frozen Mix Day
131 50% Chance Frozen Mix Day
132 30% Chance of Drizzle Day
133 40% Chance of Drizzle Day
134 50% Chance of Drizzle Day
135 30% Chance Freezing Drizzle Day
136 40% Chance Freezing Drizzle Day
137 50% Chance Freezing Drizzle Day
138 Chance of Snow Day
139 Chance of Rain Day
140 Chance of Flurries Day
141 Chance of Rain Day
142 Chance of Sleet Day
143 Chance of Storms Day
144 Chance of Flurries Day
145 Chance of Sleet Day
146 Chance of Snow Day
147 Chance of Storms Day
148 Chance of Rain Showers Day
149 Chance of Snow Showers Day
150 Chance of Rain Showers Day
151 Chance of Snow Showers Day
152 Chance of Freezing Rain Day
153 Chance of Freezing Rain Day
154 Chance of Light Snow Day
155 Chance of Frozen Mix Day
156 Chance of Drizzle Day
157 Chance of Freezing Drizzle Day
158 Windy Night
159 Foggy Night
160 Light Snow Night
161 Frozen Mix Night
162 Drizzle Night
163 Heavy Rain Night
164 Chance of Frozen Mix Night
165 Chance of Drizzle Night
166 Chance of Frozen Drizzle Night
167 30% Chance of Drizzle Night
168 30% Chance Frozen Drizzle Night
169 30% Chance Frozen Mix Night
170 40% Chance of Drizzle Night
171 40% Chance Frozen Drizzle Night
172 40% Chance Frozen Mix Night
173 50% Chance of Drizzle Night
174 50% Chance Frozen Drizzle Night
175 50% Chance Frozen Mix Night
176 Chance of Light Snow Night
177 30% Chance Light Snow Night
178 40% Chance Light Snow Night
179 50% Chance Light Snow Night
180 Scattered Thunderstorms Day
181 Freezing Drizzle Night
182 Scattered Showers Night
183 Scattered Thunderstorms Night
184 Warm and Humid Night
185 60% Chance of Snow Day
186 70% Chance of Snow Day
187 80% Chance of Snow Day
188 60% Chance of Rain Night
189 70% Chance of Rain Night
190 80% Chance of Rain Night
191 60% Chance of Flurries Day
192 70% Chance of Flurries Day
193 80% Chance of Flurries Day
194 60% Chance of Rain Day
195 70% Chance of Rain Day
196 80% Chance of Rain Day
197 60% Chance of Sleet Day
198 70% Chance of Sleet Day
199 80% Chance of Sleet Day
200 60% Chance of Storms Day
201 70% Chance of Storms Day
202 80% Chance of Storms Day
203 60% Chance of Flurries Night
204 70% Chance of Flurries Night
205 80% Chance of Flurries Night
206 60% Chance of Sleet Night
207 70% Chance of Sleet Night
208 80% Chance of Sleet Night
209 60% Chance of Snow Night
210 70% Chance of Snow Night
211 80% Chance of Snow Night
212 60% Chance of Storms Night
213 70% Chance of Storms Night
214 80% Chance of Storms Night
215 60% Chance Rain Showers Day
216 70% Chance Rain Showers Day
217 80% Chance Rain Showers Day
218 60% Chance Snow Showers Day
219 70% Chance Snow Showers Day
220 80% Chance Snow Showers Day
221 60% Chance Rain Showers Night
222 70% Chance Rain Showers Night
223 80% Chance Rain Showers Night
224 60% Chance Snow Showers Night
225 70% Chance Snow Showers Night
226 80% Chance Snow Showers Night
227 60% Chance Freezing Rain Day
228 70% Chance Freezing Rain Day
229 80% Chance Freezing Rain Day
230 60% Chance Freezing Rain Night
231 70% Chance Freezing Rain Night
232 80% Chance Freezing Rain Night
233 60% Chance Light Snow Day
234 70% Chance Light Snow Day
235 80% Chance Light Snow Day
236 60% Chance Frozen Mix Day
236 70% Chance Frozen Mix Day
238 80% Chance Frozen Mix Day
239 60% Chance of Drizzle Day
240 70% Chance of Drizzle Day
241 80% Chance of Drizzle Day
242 60% Chance Freezing Drizzle Day
243 70% Chance Freezing Drizzle Day
244 80% Chance Freezing Drizzle Day
245 60% Chance Light Snow Night
246 70% Chance Light Snow Night
247 80% Chance Light Snow Night
248 60% Chance Frozen Mix Night
249 70% Chance Frozen Mix Night
250 80% Chance Frozen Mix Night
251 Chance of Light Rain Night
252 30% Chance of Light Rain Night
253 40% Chance of Light Rain Night
254 50% Chance of Light Rain Night
255 60% Chance of Light Rain Night
256 70% Chance of Light Rain Night
257 80% Chance of Light Rain Night
258 Light Rain Night
259 Chance of Light Rain Day
260 30% Chance of Light Rain Day
261 40% Chance of Light Rain Day
262 50% Chance of Light Rain Day
263 60% Chance of Light Rain Day
264 70% Chance of Light Rain Day
265 80% Chance of Light Rain Day
266 Light Rain Day
267 Heavy Snow Night
268 Chance of Heavy Snow Night
269 30 % Chance of Heavy Snow Night
270 40% Chance of Heavy Snow Night
271 50% Chance of Heavy Snow Night
272 60% Chance of Heavy Snow Night
273 70% Chance of Heavy Snow Night
274 80% Chance of Heavy Snow Night
275 Heavy Snow Day
276 Chance of Heavy Snow Day
277 30% Chance of Heavy Snow Day
278 40% Chance of Heavy Snow Day
279 50% Chance of Heavy Snow Day
280 60% Chance of Heavy Snow Day
281 70% Chance of Heavy Snow Day
282 80% Chance of Heavy Snow Day

Variable Fields

Variable Field
(short/long)
Variable Name Units
(Metric/English)
Format Min
Value
Max
Value
Precision
k/key Key (always null)
si/stationId Station ID Text 4 or 5
Characters
N/A N/A 4 or 5
Character s
pi/providerId Provider ID Whole Number 1 or 2
Digits
N/A N/A Whole
Number
otls/observationTimeLoc alStr Observation
Time, Local
Text/Local Time Zone of Station yyyy-MM- ddThh:mm: ss 1969-12-
31T19:00:
00
Presen t Time 1 second
otus/observationTimeUt cStr Observation
Time, UTC
Text/Universal Time
Zone
yyyy-MM- ddThh:mm: ss 1970-11-
01T00:00:
00
Presen t Time 1 second
Ic/iconCode Icon Code Whole Number ### 000 282 Whole
Number
a/altimeter Altimeter (Millibars/inches of
Mercury)
#### N/A N/A 1 millibar/0.
01 inches of Mercury
ar/altimeterRate Altimeter Rate (Millibars/inches of
Mercury) per hour
##/-## N/A N/A 1 millibar/0.
01 inches of Mercury per hour
dp/dewPoint Dew Point Degrees
(Celsius/Fahrenheit)
##.#/-##.# -100 100 0.1 degrees
dpr/dewPointRate Dew Point Rate Degrees (Celsius/Fahrenheit) per hour ##.#/-##.# N/A N/A 0.1 degrees per hour
hi/heatIndex Heat Index Degrees
(Celsius/Fahrenheit)
##.#/-##.# -100 160 0.1 degrees
h/humidity Humidity Percent relative humidity ###.# 0 100 0.1 percent
hr/humidityRate Humidity Rate Change per hour of percent relative humidity ##.#/-##.# -100 100 0.1 percent per hour
psl/pressureSeaLevel Sea Level
Pressure
(Millibars/inches of
Mercury)
##.## or
####.#
N/A N/A 1 millibar/0.
01 inches of Mercury
pslr/pressureSeaLevelRat e Sea Level
Pressure Rate
(Millibars/inches of
Mercury) per hour
##.##/-
##.##
N/A N/A 1 millibar/0.
01 inches of Mercury per hour
rd/rainDaily Daily Rain (Millimeters/Inches) ###.# 0 N/A 0.1 millimeters
/ 0.01 inches
rr/rainRate Rain Rate (Millimeters/Inches)
per hour
###.# 0 N/A 0.1 millimeters
/ 0.01 inches per hour
rm/rainMonthly Monthly Rain (Millimeters/Inches) ###.# 0 N/A 0.1 millimeters
/ 0.01 inches
ry/rainYearly Yearly Rain (Millimeters/Inches) ###.# 0 N/A 0.1 millimeters
/ 0.01 inches
sd/snowDaily Daily Snow (Millimeters/Inches) ###.# 0 N/A 0.1 millimeters
/ 0.01 inches
sr/snowRate Snow Rate (Millimeters/Inches)
per hour
###.# 0 N/A 0.1 millimeters
/ 0.01 inches per hour
sm/snowMonthly Monthly Snow (Millimeters/Inches) ###.# 0 N/A 0.1 millimeters
/ 0.01 inches
sy/snowYearly Yearly Snow (Millimeters/Inches) ###.# 0 N/A 0.1 millimeters
/ 0.01 inches
t/temperature Temperature Degrees
(Celsius/Fahrenheit)
##.#/-##.# -100 100 0.1 degrees
tr/temperatureRate Temperature
Rate
Degrees (Celsius/ Fahrenheit) per hour ##.#/-##.# 0 N/A 0.1 degrees per hour
v/visibility Visibility Kilometers/Miles ##.# 0 N/A 0.1 kilometers
/ 0.1 miles
vr/visibilityRate Visibility Rate Kilometers/Miles per hour ##.# 0 N/A 0.1 kilometers
/ 0.1 miles per hour
wc/windChill Wind Chill Degrees
(Celsius/Fahrenheit)
##.#/-##.# -100 100 0.1 degrees
ws/windSpeed Wind Speed Kilometers/Miles per hour ##.# 0 N/A 0.1 kilometers
/ 0.1 miles
per hour
wd/windDirection Wind Direction Degrees from north
(clockwise)
### 0 359 1 degree
wsa/windSpeedAverage Average Wind
Speed
Kilometers/Miles per hour ##.# 0 N/A 0.1 kilometers
/ 0.1 miles per hour
wda/windDirectionAvera ge Average Wind
Direction
Degrees from north
(clockwise)
### 0 359 1 degree
wgh/windGustHourly Hourly Wind
Gust
Kilometers/Miles per hour ##.# 0 N/A 0.1 kilometers
/ 0.1 miles
per hour
wgtlhs/ windGustTimeLocalHourl yStr Hourly Wind
Gust Time, Local
Text/Local Time Zone of Station yyyy-MM- ddThh:mm: ss 1969-12-
31T19:00:
00
Presen t Time 1 second
wgtuhs/ windGustTimeUtcHourly Str Hourly Wind
Gust Time, UTC
Text/Universal Time
Zone
yyyy-MM- ddThh:mm: ss 1970-11-
01T00:00:
00
Presen t Time 1 second
wgdh/
windGustDirectionHourly
Hourly Wind
Gust Direction
Degrees from north
(clockwise)
### 0 359 1 degree
wgd/windGustDaily Daily Wind Gust Kilometers/Miles per hour ##.# 0 N/A 0.1 kilometers
/ 0.1 miles per hour
wgtlds/ windGustTimeLocalDaily Str Daily Wind Gust
Time, Local
Text/Local Time Zone of Station yyyy-MM- ddThh:mm: ss 1969-12-
31T19:00:
00
Presen t Time 1 second
wgtuds/ windGustTimeUtcDailySt r Daily Wind Gust
Time, UTC String
Text/Universal Time
Zone
yyyy-MM- ddThh:mm: ss 1970-11-
01T00:00:
00
Presen t Time 1 second
wgdd/
windGustDirectionDaily
Daily Wind Gust
Direction
Degrees from north
(clockwise)
### 0 359 1 degree
wbt/wetBulbTemperatur e Wet Bulb
Temperature
Degrees
(Celsius/Fahrenheit)
##.#/-##.# 80 140 0.1 degrees
fl/feelsLike Feels Like (Heat Index/Wind Chill) Degrees
(Celsius/Fahrenheit)
##.#/-##.# -100 160 0.1 degrees
humidityHigh Humidity Daily
High
Percent % ##.# 0 100 0.1 percent
humidityHighLocalStr Humidity Daily
High, Local
Text/Local Time Zone of Station yyyy-MM- ddThh:mm: ss 1969-12-
31T19:00:
00
Presen t Time 1 second
humidityHighUtcStr Humidity Daily
High, UTC String
Text/Universal Time
Zone
yyyy-MM- ddThh:mm: ss 1970-11-
01T00:00:
00
Presen t Time 1 second
humidityLow Humidity Daily
Low
Percent % ##.# 0 100 0.1 percent
humidityLowLocalStr Humidity Daily Low, Local Time String Text/Universal Time
Zone
yyyy-MM- ddThh:mm: ss 1970-11-
01T00:00:
00
Presen t Time 1 second
humidityLowUtcStr Humidity Daily
Low, UTC String
Text/Universal Time
Zone
yyyy-MM- ddThh:mm: ss 1970-11-
01T00:00:
00
Presen t Time 1 second
pressureSeaLevelHigh Mean Sea Level
Pressure (MSLP)
Millibars/Inches of
Mercury
##.## or
####.#
28.00 32.00 .01
pressureSeaLevelHighL
ocalStr
Daily High MSLP, Local Time String Text/Universal Time
Zone
yyyy-MM- ddThh:mm: ss 1970-11-
01T00:00:
00
Presen t Time 1 second
pressureSeaLevelHighU
tcStr
Daily High MSLP, UTC String Text/Universal Time
Zone
yyyy-MM- ddThh:mm: ss 1970-11-
01T00:00:
00
Presen t Time 1 second
pressureSeaLevelLow Mean Sea Level
Pressure (MSLP)
Millibars/Inches of
Mercury
##.## or
####.#
28.00 32.00 .01
pressureSeaLevelLowLo
calStr
Daily Low MSLP, Local Time String Text/Universal Time
Zone
yyyy-MM- ddThh:mm: ss 1970-11-
01T00:00:
00
Presen t Time 1 second
pressureSeaLevelLowUt
cStr
Daily Low MSLP, UTC String Text/Universal Time
Zone
yyyy-MM- ddThh:mm: ss 1970-11-
01T00:00:
00
Presen t Time 1 second
rainRateMax Daily Max Rain
Rate
milimeters or inches per hour ##.## 00.00 20.00 .01
rainRateMaxLocalStr Daily Max Rain Rate, Local Time String Text/Universal Time
Zone
yyyy-MM- ddThh:mm: ss 1970-11-
01T00:00:
00
Presen t Time 1 second
rainRateMaxUtcStr Daily Max Rain
Rate, UTC String
Text/Universal Time
Zone
yyyy-MM- ddThh:mm: ss 1970-11-
01T00:00:
00
Presen t Time 1 second
temperatureHigh Daily High
Temperature
Degrees F or C ###.# -80 140 .1
temperatureHighLocalS
tr
Daily High Temperature, Local Time String Text/Universal Time
Zone
yyyy-MM- ddThh:mm: ss 1970-11-
01T00:00:
00
Presen t Time 1 second
temperatureHighUtcStr Daily High Temperature, UTC String Text/Universal Time
Zone
yyyy-MM- ddThh:mm: ss 1970-11-
01T00:00:
00
Presen t Time 1 second
temperatureLow Daily Low
Temperature
Degrees F or C ###.# -80 140 .1
temperatureLowLocalSt
r
Daily Low Temperature, Local Time String Text/Universal Time
Zone
yyyy-MM- ddThh:mm: ss 1970-11-
01T00:00:
00
Presen t Time 1 second
temperatureLowUtcStr Humidity Low, UTC String Text/Universal Time
Zone
yyyy-MM- ddThh:mm: ss 1970-11-
01T00:00:
00
Presen t Time 1 second
si/stationId Station ID Text 4 or 5
Characters
N/A N/A 4 or 5
Character s
pi/providerId Provider ID Whole Number 1 or 2
Digits
N/A N/A Whole
Number
ProviderName Provider Name Text N/A N/A N/A N/A
StationName Station Name Text N/A N/A N/A N/A
Latitude Latitude Decimal ##.######
##
N/A N/A N/A
Longitude Longitude Decimal ##.######
##
N/A N/A N/A
ElevationAboveSeaLevel Elevation Above
Sea Level
Decimal ##.#### N/A N/A N/A
@ECHO OFF

curl -v -X GET "https://earthnetworks.azure-api.net/data/observations/v1/current?verbose={boolean}&cultureinfo={string}&location={string}&locationtype={string}"
-H "Ocp-Apim-Subscription-Key: {subscription key}"

--data-ascii "{body}" 
using System;
using System.Net.Http.Headers;
using System.Text;
using System.Net.Http;
using System.Web;

namespace CSHttpClientSample
{
    static class Program
    {
        static void Main()
        {
            MakeRequest();
            Console.WriteLine("Hit ENTER to exit...");
            Console.ReadLine();
        }
        
        static async void MakeRequest()
        {
            var client = new HttpClient();
            var queryString = HttpUtility.ParseQueryString(string.Empty);

            // Request headers
            client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{subscription key}");

            // Request parameters
            queryString["verbose"] = "{boolean}";
            queryString["cultureinfo"] = "{string}";
            queryString["location"] = "{string}";
            queryString["locationtype"] = "{string}";
            var uri = "https://earthnetworks.azure-api.net/data/observations/v1/current?&" + queryString;

            var response = await client.GetAsync(uri);
        }
    }
}	
// // This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class JavaSample 
{
    public static void main(String[] args) 
    {
        HttpClient httpclient = HttpClients.createDefault();

        try
        {
            URIBuilder builder = new URIBuilder("https://earthnetworks.azure-api.net/data/observations/v1/current?");

            builder.setParameter("verbose", "{boolean}");
            builder.setParameter("cultureinfo", "{string}");
            builder.setParameter("location", "{string}");
            builder.setParameter("locationtype", "{string}");

            URI uri = builder.build();
            HttpGet request = new HttpGet(uri);
            request.setHeader("Ocp-Apim-Subscription-Key", "{subscription key}");


            // Request body
            StringEntity reqEntity = new StringEntity("{body}");
            request.setEntity(reqEntity);

            HttpResponse response = httpclient.execute(request);
            HttpEntity entity = response.getEntity();

            if (entity != null) 
            {
                System.out.println(EntityUtils.toString(entity));
            }
        }
        catch (Exception e)
        {
            System.out.println(e.getMessage());
        }
    }
}
    $(function() {
        var params = {
            // Request parameters
            "verbose": "{boolean}",
            "cultureinfo": "{string}",
            "location": "{string}",
            "locationtype": "{string}",
        };
      
        $.ajax({
            url: "https://earthnetworks.azure-api.net/data/observations/v1/current?&" + $.param(params),
            beforeSend: function(xhrObj){
                // Request headers
                xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key","{subscription key}");
            },
            type: "GET",
            // Request body
            data: "{body}",
        })
        .done(function(data) {
            alert("success");
        })
        .fail(function() {
            alert("error");
        });
    });
#import 

int main(int argc, const char * argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    
    NSString* path = @"https://earthnetworks.azure-api.net/data/observations/v1/current?";
    NSArray* array = @[
                         // Request parameters
                         @"entities=true",
                         @"verbose={boolean}",
                         @"cultureinfo={string}",
                         @"location={string}",
                         @"locationtype={string}",
                      ];
    
    NSString* string = [array componentsJoinedByString:@"&"];
    path = [path stringByAppendingFormat:@"?%@", string];

    NSLog(@"%@", path);

    NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:path]];
    [_request setHTTPMethod:@"GET"];
    // Request headers
    [_request setValue:@"{subscription key}" forHTTPHeaderField:@"Ocp-Apim-Subscription-Key"];
    // Request body
    [_request setHTTPBody:[@"{body}" dataUsingEncoding:NSUTF8StringEncoding]];
    
    NSURLResponse *response = nil;
    NSError *error = nil;
    NSData* _connectionData = [NSURLConnection sendSynchronousRequest:_request returningResponse:&response error:&error];

    if (nil != error)
    {
        NSLog(@"Error: %@", error);
    }
    else
    {
        NSError* error = nil;
        NSMutableDictionary* json = nil;
        NSString* dataString = [[NSString alloc] initWithData:_connectionData encoding:NSUTF8StringEncoding];
        NSLog(@"%@", dataString);
        
        if (nil != _connectionData)
        {
            json = [NSJSONSerialization JSONObjectWithData:_connectionData options:NSJSONReadingMutableContainers error:&error];
        }
        
        if (error || !json)
        {
            NSLog(@"Could not parse loaded json with error:%@", error);
        }
        
        NSLog(@"%@", json);
        _connectionData = nil;
    }
    
    [pool drain];

    return 0;
}
getUrl();

$headers = array(
    // Request headers
    'Ocp-Apim-Subscription-Key' => '{subscription key}',
);

$request->setHeader($headers);

$parameters = array(
    // Request parameters
    'verbose' => '{boolean}',
    'cultureinfo' => '{string}',
    'location' => '{string}',
    'locationtype' => '{string}',
);

$url->setQueryVariables($parameters);

$request->setMethod(HTTP_Request2::METHOD_GET);

// Request body
$request->setBody("{body}");

try
{
    $response = $request->send();
    echo $response->getBody();
}
catch (HttpException $ex)
{
    echo $ex;
}

?>
########### Python 2.7 #############
import httplib, urllib, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.urlencode({
    # Request parameters
    'verbose': '{boolean}',
    'cultureinfo': '{string}',
    'location': '{string}',
    'locationtype': '{string}',
})

try:
    conn = httplib.HTTPSConnection('earthnetworks.azure-api.net')
    conn.request("GET", "/data/observations/v1/current?&%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################

########### Python 3.2 #############
import http.client, urllib.request, urllib.parse, urllib.error, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.parse.urlencode({
    # Request parameters
    'verbose': '{boolean}',
    'cultureinfo': '{string}',
    'location': '{string}',
    'locationtype': '{string}',
})

try:
    conn = http.client.HTTPSConnection('earthnetworks.azure-api.net')
    conn.request("GET", "/data/observations/v1/current?&%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################
require 'net/http'

uri = URI('https://earthnetworks.azure-api.net/data/observations/v1/current?')

query = URI.encode_www_form({
    # Request parameters
    'verbose' => '{boolean}',
    'cultureinfo' => '{string}',
    'location' => '{string}',
    'locationtype' => '{string}'
})

if uri.query && uri.query.length > 0
    uri.query += '&' + query
else
    uri.query = query
end

request = Net::HTTP::Get.new(uri.request_uri)
# Request headers
request['Ocp-Apim-Subscription-Key'] = '{subscription key}'
# Request body
request.body = "{body}"

response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
    http.request(request)
end

puts response.body

Real Time Weather Observations V3

https://earthnetworks.azure-api.net/getStationList/data/locations/v3/stationlist?locationtype={locationtype}&location={location}
Headers
Ocp-Apim-Subscription-Key

Query parameters
locationtype

location

providerid

Optional parameters
verbose

Units

Cultureinfo

 

Real Time Weather Observations V1

Description:

The Earth Networks Observation Data Feed will provide you with a set of current condition data based on the location or station id requested. For Location the logic is in place to always return the best observation for the location requested based on age, distance and accuracy. For station id the logic is to always return observations for that station id.

Request URL for latitudelongitude:

https://earthnetworks.azure-api.net/data/observations/v1/current?location=<location>&locationtype=latitudelongitude&units=<units>&cultureinfo=<cultureinfo>&verbose=<verbose>&subscription-key=<Your subscription key>

Request URL for stationid:

https://earthnetworks.azure-api.net/data/observations/v1/current?providerid=<providerid>&stationid=<stationid>&units=<units>&cultureinfo=<cultureinfo>&verbose=<verbose>&subscription-key=<Your subscription key>

Request parameters:

locationtype string „Latitudelongitude“ or „stationid“
location
(if location type is „latitudelongitude“)
string Latitude/Longitude in format: <Latitude>,<Longitude>
providerid (if  locationtype is „stationid“) String Must be valid ID from Search Weather Station API for station

Optional parameters:

verbose boolean

Abbreviations (false)

or long variable names (true)

true, false
units string Metric or English units “metric” or “English”
cultureinfo string Language “en-en”, “es-es”

Request headers:

Ocp-Apim-Subscription-Key string Subscription key which provides access to this API. Found in your Profile.

 

Test request
 

Expected response

{
    "key": null,
    "stationId": "REKVL",
    "providerId": 3,
    "observationTimeLocalStr": "2014-01-29T15:05:58",
    "observationTimeUtcStr": "2014-01-29T20:05:58",
    "iconCode": null,
    "altimeter": null,
    "altimeterRate": null,
    "dewPoint": -2.0,
    "dewPointRate": null,
    "heatIndex": 20.7,
    "humidity": 36.0,
    "humidityRate": -2.8,
    "pressureSeaLevel": 30.22,
    "pressureSeaLevelRate": -0.02,
    "rainDaily": 0.0,
    "rainRate": 0.0,
    "rainMonthly": 1.67,
    "rainYearly": 1.67,
    "snowDaily": null,
    "snowRate": null,
    "snowMonthly": null,
    "snowYearly": null,
    "temperature": 20.7,
    "temperatureRate": 2.0,
    "visibility": null,
    "visibilityRate": null,
    "windChill": 14.2,
    "windSpeed": 4.6,
    "windDirection": 276,
    "windSpeedAvg": 3.7,
    "windDirectionAvg": 273,
    "windGustHourly": 17.5,
    "windGustTimeLocalHourlyStr": "2014-01-29T14:20:00",
    "windGustTimeUtcHourlyStr": "2014-01-29T19:20:00",
    "windGustDirectionHourly": 273,
    "windGustDaily": 17.8,
    "windGustTimeLocalDailyStr": "2014-01-29T11:04:00",
    "windGustTimeUtcDailyStr": "2014-01-29T16:04:00",
    "windGustDirectionDaily": 251,
    "observationTimeAdjustedLocalStr": "2014-01-29T15:06:36",
    "feelsLike": 14.2
}
@ECHO OFF

curl -v -X GET "https://earthnetworks.azure-api.net/data/observations/v1/current??verbose={boolean}&cultureinfo={string}&location={string}&locationtype={string}"
-H "Ocp-Apim-Subscription-Key: {subscription key}"

--data-ascii "{body}" 
using System;
using System.Net.Http.Headers;
using System.Text;
using System.Net.Http;
using System.Web;

namespace CSHttpClientSample
{
    static class Program
    {
        static void Main()
        {
            MakeRequest();
            Console.WriteLine("Hit ENTER to exit...");
            Console.ReadLine();
        }
        
        static async void MakeRequest()
        {
            var client = new HttpClient();
            var queryString = HttpUtility.ParseQueryString(string.Empty);

            // Request headers
            client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{subscription key}");

            // Request parameters
            queryString["verbose"] = "{boolean}";
            queryString["cultureinfo"] = "{string}";
            queryString["location"] = "{string}";
            queryString["locationtype"] = "{string}";
            var uri = "https://earthnetworks.azure-api.net/data/observations/v1/current?&" + queryString;

            var response = await client.GetAsync(uri);
        }
    }
}	
// // This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class JavaSample 
{
    public static void main(String[] args) 
    {
        HttpClient httpclient = HttpClients.createDefault();

        try
        {
            URIBuilder builder = new URIBuilder("https://earthnetworks.azure-api.net/data/observations/v1/current?");

            builder.setParameter("verbose", "{boolean}");
            builder.setParameter("cultureinfo", "{string}");
            builder.setParameter("location", "{string}");
            builder.setParameter("locationtype", "{string}");

            URI uri = builder.build();
            HttpGet request = new HttpGet(uri);
            request.setHeader("Ocp-Apim-Subscription-Key", "{subscription key}");


            // Request body
            StringEntity reqEntity = new StringEntity("{body}");
            request.setEntity(reqEntity);

            HttpResponse response = httpclient.execute(request);
            HttpEntity entity = response.getEntity();

            if (entity != null) 
            {
                System.out.println(EntityUtils.toString(entity));
            }
        }
        catch (Exception e)
        {
            System.out.println(e.getMessage());
        }
    }
}
$(function() {
    var params = {
        // Request parameters
        "verbose": "{boolean}",
        "cultureinfo": "{string}",
        "location": "{string}",
        "locationtype": "{string}",
    };

    $.ajax({
            url: "https://earthnetworks.azure-api.net/data/observations/v1/current?&" + $.param(params),
            beforeSend: function(xhrObj) {
                // Request headers
                xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key", "{subscription key}");
            },
            type: "GET",
            // Request body
            data: "{body}",
        })
        .done(function(data) {
            alert("success");
        })
        .fail(function() {
            alert("error");
        });
});
#import 

int main(int argc, const char * argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    
    NSString* path = @"https://earthnetworks.azure-api.net/data/observations/v1/current?";
    NSArray* array = @[
                         // Request parameters
                         @"entities=true",
                         @"verbose={boolean}",
                         @"cultureinfo={string}",
                         @"location={string}",
                         @"locationtype={string}",
                      ];
    
    NSString* string = [array componentsJoinedByString:@"&"];
    path = [path stringByAppendingFormat:@"?%@", string];

    NSLog(@"%@", path);

    NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:path]];
    [_request setHTTPMethod:@"GET"];
    // Request headers
    [_request setValue:@"{subscription key}" forHTTPHeaderField:@"Ocp-Apim-Subscription-Key"];
    // Request body
    [_request setHTTPBody:[@"{body}" dataUsingEncoding:NSUTF8StringEncoding]];
    
    NSURLResponse *response = nil;
    NSError *error = nil;
    NSData* _connectionData = [NSURLConnection sendSynchronousRequest:_request returningResponse:&response error:&error];

    if (nil != error)
    {
        NSLog(@"Error: %@", error);
    }
    else
    {
        NSError* error = nil;
        NSMutableDictionary* json = nil;
        NSString* dataString = [[NSString alloc] initWithData:_connectionData encoding:NSUTF8StringEncoding];
        NSLog(@"%@", dataString);
        
        if (nil != _connectionData)
        {
            json = [NSJSONSerialization JSONObjectWithData:_connectionData options:NSJSONReadingMutableContainers error:&error];
        }
        
        if (error || !json)
        {
            NSLog(@"Could not parse loaded json with error:%@", error);
        }
        
        NSLog(@"%@", json);
        _connectionData = nil;
    }
    
    [pool drain];

    return 0;
}
// This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
require_once 'HTTP/Request2.php';

$request = new Http_Request2('https://earthnetworks.azure-api.net/data/observations/v1/current?');
$url = $request->getUrl();

$headers = array(
    // Request headers
    'Ocp-Apim-Subscription-Key' => '{subscription key}',
);

$request->setHeader($headers);

$parameters = array(
    // Request parameters
    'verbose' => '{boolean}',
    'cultureinfo' => '{string}',
    'location' => '{string}',
    'locationtype' => '{string}',
);

$url->setQueryVariables($parameters);

$request->setMethod(HTTP_Request2::METHOD_GET);

// Request body
$request->setBody("{body}");

try
{
    $response = $request->send();
    echo $response->getBody();
}
catch (HttpException $ex)
{
    echo $ex;
}
########### Python 2.7 #############
import httplib, urllib, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.urlencode({
    # Request parameters
    'verbose': '{boolean}',
    'cultureinfo': '{string}',
    'location': '{string}',
    'locationtype': '{string}',
})

try:
    conn = httplib.HTTPSConnection('earthnetworks.azure-api.net')
    conn.request("GET", "/data/observations/v1/current?&%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################

########### Python 3.2 #############
import http.client, urllib.request, urllib.parse, urllib.error, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.parse.urlencode({
    # Request parameters
    'verbose': '{boolean}',
    'cultureinfo': '{string}',
    'location': '{string}',
    'locationtype': '{string}',
})

try:
    conn = http.client.HTTPSConnection('earthnetworks.azure-api.net')
    conn.request("GET", "/data/observations/v1/current?&%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################
require 'net/http'

uri = URI('https://earthnetworks.azure-api.net/data/observations/v1/current?')

query = URI.encode_www_form({
    # Request parameters
    'verbose' => '{boolean}',
    'cultureinfo' => '{string}',
    'location' => '{string}',
    'locationtype' => '{string}'
})

if uri.query && uri.query.length > 0
    uri.query += '&' + query
else
    uri.query = query
end

request = Net::HTTP::Get.new(uri.request_uri)
# Request headers
request['Ocp-Apim-Subscription-Key'] = '{subscription key}'
# Request body
request.body = "{body}"

response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
    http.request(request)
end

puts response.body

Real Time Weather Observations V1

https://earthnetworks.azure-api.net/data/observations/v1/current?[&cultureinfo][&locationtype][&location][&units][&r uledetails][&verbose][&metadata][&includeqcflags]
Headers
Ocp-Apim-Subscription-Key

Query parameters
locationtype

location

providerid

Optional parameters
verbose

Units

Metadata

Cultureinfo

Ruledetails

Includeqcflags

 

Search Weather Station

Description:

The stations call provides access to the station list and allows for the entry of optional parameters to make a bounding box to get a list of stations within that area.

Request URL:

https://earthnetworks.azure-api.net/getStationList/data/locations/v3/stationlist?latitude=39.1833&longitude=-77.2667&verbose=true&subscription-key=<Your subscription key>

Request parameters:

latitude string  
longitude string  
location string „CityId“ from Search Location

Optional parameters:

verbose boolean true, false

Request headers:

Ocp-Apim-Subscription-Key string Subscription key which provides access to this API. Found in your Profile.

 

Test request
 

Expected response

{
    "id": "f80c02a3-f71f-4654-8025-b65ce0393f77",
    "code": 200,
    "errorMessage": null,
    "result":
    {
        "Stations": [
        {
            "StationId": "CLRCH",
            "ProviderId": 3,
            "ProviderName": "Earth Networks Inc",
            "StationName": "Clarksburg Area HS",
            "Latitude": 39.2263888888889,
            "Longitude": -77.2636111111111,
            "ElevationAboveSeaLevel": null,
            "DisplayFlag": null
        },
        {
            "StationId": "PPIVA",
            "ProviderId": 3,
            "ProviderName": "Earth Networks Inc",
            "StationName": "Prototype Productions Inc PPI",
            "Latitude": 39.0208333333333,
            "Longitude": -77.4566666666667,
            "ElevationAboveSeaLevel": null,
            "DisplayFlag": null
        },
        {
            "StationId": "STRLI",
            "ProviderId": 3,
            "ProviderName": "Earth Networks Inc",
            "StationName": "NOVA Loudoun Campus",
            "Latitude": 39.0208333333333,
            "Longitude": -77.3838888888889,
            "ElevationAboveSeaLevel": null,
            "DisplayFlag": null
        }]
    }
}
@ECHO OFF

curl -v -X GET "https://earthnetworks.azure-api.net/getStationList/data/locations/v3/stationlist"
-H "Ocp-Apim-Subscription-Key: {subscription key}"

--data-ascii "{body}" 
using System;
using System.Net.Http.Headers;
using System.Text;
using System.Net.Http;
using System.Web;

namespace CSHttpClientSample
{
    static class Program
    {
        static void Main()
        {
            MakeRequest();
            Console.WriteLine("Hit ENTER to exit...");
            Console.ReadLine();
        }
        
        static async void MakeRequest()
        {
            var client = new HttpClient();
            var queryString = HttpUtility.ParseQueryString(string.Empty);

            // Request headers
            client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{subscription key}");

            var uri = "https://earthnetworks.azure-api.net/getStationList/data/locations/v3/stationlist?" + queryString;

            var response = await client.GetAsync(uri);
        }
    }
}	
// // This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class JavaSample 
{
    public static void main(String[] args) 
    {
        HttpClient httpclient = HttpClients.createDefault();

        try
        {
            URIBuilder builder = new URIBuilder("https://earthnetworks.azure-api.net/getStationList/data/locations/v3/stationlist");


            URI uri = builder.build();
            HttpGet request = new HttpGet(uri);
            request.setHeader("Ocp-Apim-Subscription-Key", "{subscription key}");


            // Request body
            StringEntity reqEntity = new StringEntity("{body}");
            request.setEntity(reqEntity);

            HttpResponse response = httpclient.execute(request);
            HttpEntity entity = response.getEntity();

            if (entity != null) 
            {
                System.out.println(EntityUtils.toString(entity));
            }
        }
        catch (Exception e)
        {
            System.out.println(e.getMessage());
        }
    }
}
$(function() {
    var params = {
        // Request parameters
    };

    $.ajax({
            url: "https://earthnetworks.azure-api.net/getStationList/data/locations/v3/stationlist?" + $.param(params),
            beforeSend: function(xhrObj) {
                // Request headers
                xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key", "{subscription key}");
            },
            type: "GET",
            // Request body
            data: "{body}",
        })
        .done(function(data) {
            alert("success");
        })
        .fail(function() {
            alert("error");
        });
});
#import 

int main(int argc, const char * argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    
    NSString* path = @"https://earthnetworks.azure-api.net/getStationList/data/locations/v3/stationlist";
    NSArray* array = @[
                         // Request parameters
                         @"entities=true",
                      ];
    
    NSString* string = [array componentsJoinedByString:@"&"];
    path = [path stringByAppendingFormat:@"?%@", string];

    NSLog(@"%@", path);

    NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:path]];
    [_request setHTTPMethod:@"GET"];
    // Request headers
    [_request setValue:@"{subscription key}" forHTTPHeaderField:@"Ocp-Apim-Subscription-Key"];
    // Request body
    [_request setHTTPBody:[@"{body}" dataUsingEncoding:NSUTF8StringEncoding]];
    
    NSURLResponse *response = nil;
    NSError *error = nil;
    NSData* _connectionData = [NSURLConnection sendSynchronousRequest:_request returningResponse:&response error:&error];

    if (nil != error)
    {
        NSLog(@"Error: %@", error);
    }
    else
    {
        NSError* error = nil;
        NSMutableDictionary* json = nil;
        NSString* dataString = [[NSString alloc] initWithData:_connectionData encoding:NSUTF8StringEncoding];
        NSLog(@"%@", dataString);
        
        if (nil != _connectionData)
        {
            json = [NSJSONSerialization JSONObjectWithData:_connectionData options:NSJSONReadingMutableContainers error:&error];
        }
        
        if (error || !json)
        {
            NSLog(@"Could not parse loaded json with error:%@", error);
        }
        
        NSLog(@"%@", json);
        _connectionData = nil;
    }
    
    [pool drain];

    return 0;
}
// This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
require_once 'HTTP/Request2.php';

$request = new Http_Request2('https://earthnetworks.azure-api.net/getStationList/data/locations/v3/stationlist');
$url = $request->getUrl();

$headers = array(
    // Request headers
    'Ocp-Apim-Subscription-Key' => '{subscription key}',
);

$request->setHeader($headers);

$parameters = array(
    // Request parameters
);

$url->setQueryVariables($parameters);

$request->setMethod(HTTP_Request2::METHOD_GET);

// Request body
$request->setBody("{body}");

try
{
    $response = $request->send();
    echo $response->getBody();
}
catch (HttpException $ex)
{
    echo $ex;
}
########### Python 2.7 #############
import httplib, urllib, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.urlencode({
})

try:
    conn = httplib.HTTPSConnection('earthnetworks.azure-api.net')
    conn.request("GET", "/getStationList/data/locations/v3/stationlist?%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################

########### Python 3.2 #############
import http.client, urllib.request, urllib.parse, urllib.error, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.parse.urlencode({
})

try:
    conn = http.client.HTTPSConnection('earthnetworks.azure-api.net')
    conn.request("GET", "/getStationList/data/locations/v3/stationlist?%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################
require 'net/http'

uri = URI('https://earthnetworks.azure-api.net/getStationList/data/locations/v3/stationlist')

request = Net::HTTP::Get.new(uri.request_uri)
# Request headers
request['Ocp-Apim-Subscription-Key'] = '{subscription key}'
# Request body
request.body = "{body}"

response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
    http.request(request)
end

puts response.body

Search Weather Station

https://earthnetworks.azure-api.net/getStationList/data/locations/v3/stationlist?locationtype={locationtype}&location={location}
Headers
Ocp-Apim-Subscription-Key

Query parameters
locationtype

location

Optional parameters
verbose

 

Sky Conditions Icon V1

Description:

This call returns a complete set of icons listed in order of icon code (for either lunar or forecast, by request). When providing Icons for depicting sky cover for current conditions the response shall check the local sunrise/sunset time in order to determine whether to return a day or night conditions icon value.

Request URL:

https://earthnetworks.azure-api.net/getSkyConditionIcons/resources/v1/icons?iconSet={iconSet}

Request parameters:

iconSet string choice of whether to view lunar icons or forecast icons lunar: returns lunar icons forecast: returns forecast icons

Request headers:

Ocp-Apim-Subscription-Key string Subscription key which provides access to this API. Found in your Profile.

 

Test request
 

Expected response

{
    Width: 52,
    Height: 40,
    Icons: [
        {
            Url: "https://s3.amazonaws.com/qa.data.earthnetworks.com/ods/icons/v1/forecast/50x42/cond000.png?AWSAccessKeyId=AKIAIGAWJIEJU4VSJEPA&Expires=1371687087&
Signature=MzL5LxJJuqTIXxiKEjGj9bwIBCw%3D", 
            IconCode: 000
        },
        {
            Url: "https://s3.amazonaws.com/qa.data.earthnetworks.com/ods/icons/v1/forecast/50x42/cond001.png?AWSAccessKeyId=AKIAIGAWJIEJU4VSJEPA&Expires=1371687087&Signature=c5jxI7dkebN5xw9E%2FRpWhVl%2F21M%3D", 
            IconCode: 001
        },
        {
            Url: "https://s3.amazonaws.com/qa.data.earthnetworks.com/ods/icons/v1/forecast/50x42/cond002.png?AWSAccessKeyId=AKIAIGAWJIEJU4VSJEPA&Expires=1371687087&Signature=y2QgpBQIBO14lwDMu1IF9et3GM4%3D", 
            IconCode: 002 
        },
        ],
    ZipUrl: "https://s3.amazonaws.com/qa.data.earthnetworks.com/ods/icons/v1/forecast/50x42_zip/forecast_50x42.zip?AWSAccessKeyId=AKIAIGAWJIEJU4VSJEPA&Expires=1371687087&Signature=vFCfshjgLXU8hTizLLtTeA1tWEU%3D", 
    LastUpdatedDateTimeUtc:"2013-05-22T10:11:30.0000000Z"
}
@ECHO OFF

curl -v -X GET "https://earthnetworks.azure-api.net/getSkyConditionIcons/resources/v1/icons?iconSet={iconSet}"
-H "Ocp-Apim-Subscription-Key: {subscription key}"

--data-ascii "{body}" 
using System;
using System.Net.Http.Headers;
using System.Text;
using System.Net.Http;
using System.Web;

namespace CSHttpClientSample
{
    static class Program
    {
        static void Main()
        {
            MakeRequest();
            Console.WriteLine("Hit ENTER to exit...");
            Console.ReadLine();
        }
        
        static async void MakeRequest()
        {
            var client = new HttpClient();
            var queryString = HttpUtility.ParseQueryString(string.Empty);

            // Request headers
            client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{subscription key}");

            var uri = "https://earthnetworks.azure-api.net/getSkyConditionIcons/resources/v1/icons?iconSet={iconSet}&" + queryString;

            var response = await client.GetAsync(uri);
        }
    }
}	
// // This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class JavaSample 
{
    public static void main(String[] args) 
    {
        HttpClient httpclient = HttpClients.createDefault();

        try
        {
            URIBuilder builder = new URIBuilder("https://earthnetworks.azure-api.net/getSkyConditionIcons/resources/v1/icons?iconSet={iconSet}");


            URI uri = builder.build();
            HttpGet request = new HttpGet(uri);
            request.setHeader("Ocp-Apim-Subscription-Key", "{subscription key}");


            // Request body
            StringEntity reqEntity = new StringEntity("{body}");
            request.setEntity(reqEntity);

            HttpResponse response = httpclient.execute(request);
            HttpEntity entity = response.getEntity();

            if (entity != null) 
            {
                System.out.println(EntityUtils.toString(entity));
            }
        }
        catch (Exception e)
        {
            System.out.println(e.getMessage());
        }
    }
}
$(function() {
    var params = {
        // Request parameters
    };

    $.ajax({
            url: "https://earthnetworks.azure-api.net/getSkyConditionIcons/resources/v1/icons?iconSet={iconSet}&" + $.param(params),
            beforeSend: function(xhrObj) {
                // Request headers
                xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key", "{subscription key}");
            },
            type: "GET",
            // Request body
            data: "{body}",
        })
        .done(function(data) {
            alert("success");
        })
        .fail(function() {
            alert("error");
        });
});
#import 

int main(int argc, const char * argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    
    NSString* path = @"https://earthnetworks.azure-api.net/getSkyConditionIcons/resources/v1/icons?iconSet={iconSet}";
    NSArray* array = @[
                         // Request parameters
                         @"entities=true",
                      ];
    
    NSString* string = [array componentsJoinedByString:@"&"];
    path = [path stringByAppendingFormat:@"?%@", string];

    NSLog(@"%@", path);

    NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:path]];
    [_request setHTTPMethod:@"GET"];
    // Request headers
    [_request setValue:@"{subscription key}" forHTTPHeaderField:@"Ocp-Apim-Subscription-Key"];
    // Request body
    [_request setHTTPBody:[@"{body}" dataUsingEncoding:NSUTF8StringEncoding]];
    
    NSURLResponse *response = nil;
    NSError *error = nil;
    NSData* _connectionData = [NSURLConnection sendSynchronousRequest:_request returningResponse:&response error:&error];

    if (nil != error)
    {
        NSLog(@"Error: %@", error);
    }
    else
    {
        NSError* error = nil;
        NSMutableDictionary* json = nil;
        NSString* dataString = [[NSString alloc] initWithData:_connectionData encoding:NSUTF8StringEncoding];
        NSLog(@"%@", dataString);
        
        if (nil != _connectionData)
        {
            json = [NSJSONSerialization JSONObjectWithData:_connectionData options:NSJSONReadingMutableContainers error:&error];
        }
        
        if (error || !json)
        {
            NSLog(@"Could not parse loaded json with error:%@", error);
        }
        
        NSLog(@"%@", json);
        _connectionData = nil;
    }
    
    [pool drain];

    return 0;
}
// This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
require_once 'HTTP/Request2.php';

$request = new Http_Request2('https://earthnetworks.azure-api.net/getSkyConditionIcons/resources/v1/icons?iconSet={iconSet}');
$url = $request->getUrl();

$headers = array(
    // Request headers
    'Ocp-Apim-Subscription-Key' => '{subscription key}',
);

$request->setHeader($headers);

$parameters = array(
    // Request parameters
);

$url->setQueryVariables($parameters);

$request->setMethod(HTTP_Request2::METHOD_GET);

// Request body
$request->setBody("{body}");

try
{
    $response = $request->send();
    echo $response->getBody();
}
catch (HttpException $ex)
{
    echo $ex;
}
########### Python 2.7 #############
import httplib, urllib, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.urlencode({
})

try:
    conn = httplib.HTTPSConnection('earthnetworks.azure-api.net')
    conn.request("GET", "/getSkyConditionIcons/resources/v1/icons?iconSet={iconSet}&%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################

########### Python 3.2 #############
import http.client, urllib.request, urllib.parse, urllib.error, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.parse.urlencode({
})

try:
    conn = http.client.HTTPSConnection('earthnetworks.azure-api.net')
    conn.request("GET", "/getSkyConditionIcons/resources/v1/icons?iconSet={iconSet}&%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################
require 'net/http'

uri = URI('https://earthnetworks.azure-api.net/getSkyConditionIcons/resources/v1/icons?iconSet={iconSet}')

request = Net::HTTP::Get.new(uri.request_uri)
# Request headers
request['Ocp-Apim-Subscription-Key'] = '{subscription key}'
# Request body
request.body = "{body}"

response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
    http.request(request)
end

puts response.body

Sky Conditions Icon V1

https://earthnetworks.azure-api.net/getSkyConditionIcons/resources/v1/icons?iconSet={iconSet}
Headers
Ocp-Apim-Subscription-Key

Query parameters
iconSet

 

Sky Conditions Icon V3

Description:

This call returns a complete set of icons listed in order of icon code (for either lunar or forecast, by request). When providing Earth Networks icons for depicting sky cover for current conditions the response shall check the local sunrise/sunset time in order to determine whether to return a day or night conditions icon value.

Request URL:

https://earthnetworks.azure-api.net/getSkyConditionIcons/resources/v3/icons?iconSet={iconSet}&iconSize={iconsize}

Request parameters:

iconSet string choice of whether to view lunar icons or forecast icons lunar: returns lunar icons forecast: returns forecast icons
iconsize string choice of icon size
forecast returns 52×40, lunar returns 160×160

Request headers:

Ocp-Apim-Subscription-Key string Subscription key which provides access to this API. Found in your Profile.

 

Test request
 

Expected response

{
	Width:160,
	Height:160,
	Icons:[
		{
			Url:"https://s3.amazonaws.com/qa.data.earthnetworks.com/ods/icons/v1/lunar/160x160/mphase01.png?AWSAccessKeyId=AKIAIGAWJIEJU4VSJEPA&Expires=1371688660&Signature=AFTRcOJ7kYHM9I5tOWOo7IzN7%2BI%3D",
			IconCode:01
		},
		{
			Url:"https://s3.amazonaws.com/qa.data.earthnetworks.com/ods/icons/v1/lunar/160x160/mphase02.png?AWSAccessKeyId=AKIAIGAWJIEJU4VSJEPA&Expires=1371688660&Signature=2kxRVQ%2BatKxzK%2BRFuUcQAsQ0%2F%2B0%3D",
			IconCode:02
		},
		{
			Url:"https://s3.amazonaws.com/qa.data.earthnetworks.com/ods/icons/v1/lunar/160x160/mphase03.png?AWSAccessKeyId=AKIAIGAWJIEJU4VSJEPA&Expires=1371688660&Signature=NHex1VVS7Kj5EgBci%2F4D5iZC6Zk%3D",
			IconCode:03
		}
	],
	ZipUrl:"https://s3.amazonaws.com/qa.data.earthnetworks.com/ods/icons/v1/lunar/160x160_zip/lunar.zip?AWSAccessKeyId=AKIAIGAWJIEJU4VSJEPA&Expires=1371688659&Signature=75katCPKtIinj%2FyYWK33SLiy0l4%3D",
	LastUpdatedDateTimeUtc:"2013-05-22T10:12:48.0000000Z"
}
@ECHO OFF

curl -v -X GET "https://earthnetworks.azure-api.net/getSkyConditionIcons/resources/v3/icons?iconSet={iconSet}&iconSize={iconsize}"
-H "Ocp-Apim-Subscription-Key: {subscription key}"

--data-ascii "{body}" 
using System;
using System.Net.Http.Headers;
using System.Text;
using System.Net.Http;
using System.Web;

namespace CSHttpClientSample
{
    static class Program
    {
        static void Main()
        {
            MakeRequest();
            Console.WriteLine("Hit ENTER to exit...");
            Console.ReadLine();
        }
        
        static async void MakeRequest()
        {
            var client = new HttpClient();
            var queryString = HttpUtility.ParseQueryString(string.Empty);

            // Request headers
            client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{subscription key}");

            var uri = "https://earthnetworks.azure-api.net/getSkyConditionIcons/resources/v3/icons?iconSet={iconSet}&iconSize={iconsize}&" + queryString;

            var response = await client.GetAsync(uri);
        }
    }
}	
// // This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class JavaSample 
{
    public static void main(String[] args) 
    {
        HttpClient httpclient = HttpClients.createDefault();

        try
        {
            URIBuilder builder = new URIBuilder("https://earthnetworks.azure-api.net/getSkyConditionIcons/resources/v3/icons?iconSet={iconSet}&iconSize={iconsize}");


            URI uri = builder.build();
            HttpGet request = new HttpGet(uri);
            request.setHeader("Ocp-Apim-Subscription-Key", "{subscription key}");


            // Request body
            StringEntity reqEntity = new StringEntity("{body}");
            request.setEntity(reqEntity);

            HttpResponse response = httpclient.execute(request);
            HttpEntity entity = response.getEntity();

            if (entity != null) 
            {
                System.out.println(EntityUtils.toString(entity));
            }
        }
        catch (Exception e)
        {
            System.out.println(e.getMessage());
        }
    }
}
$(function() {
    var params = {
        // Request parameters
    };

    $.ajax({
            url: "https://earthnetworks.azure-api.net/getSkyConditionIcons/resources/v3/icons?iconSet={iconSet}&iconSize={iconsize}&" + $.param(params),
            beforeSend: function(xhrObj) {
                // Request headers
                xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key", "{subscription key}");
            },
            type: "GET",
            // Request body
            data: "{body}",
        })
        .done(function(data) {
            alert("success");
        })
        .fail(function() {
            alert("error");
        });
});
#import 

int main(int argc, const char * argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    
    NSString* path = @"https://earthnetworks.azure-api.net/getSkyConditionIcons/resources/v3/icons?iconSet={iconSet}&iconSize={iconsize}";
    NSArray* array = @[
                         // Request parameters
                         @"entities=true",
                      ];
    
    NSString* string = [array componentsJoinedByString:@"&"];
    path = [path stringByAppendingFormat:@"?%@", string];

    NSLog(@"%@", path);

    NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:path]];
    [_request setHTTPMethod:@"GET"];
    // Request headers
    [_request setValue:@"{subscription key}" forHTTPHeaderField:@"Ocp-Apim-Subscription-Key"];
    // Request body
    [_request setHTTPBody:[@"{body}" dataUsingEncoding:NSUTF8StringEncoding]];
    
    NSURLResponse *response = nil;
    NSError *error = nil;
    NSData* _connectionData = [NSURLConnection sendSynchronousRequest:_request returningResponse:&response error:&error];

    if (nil != error)
    {
        NSLog(@"Error: %@", error);
    }
    else
    {
        NSError* error = nil;
        NSMutableDictionary* json = nil;
        NSString* dataString = [[NSString alloc] initWithData:_connectionData encoding:NSUTF8StringEncoding];
        NSLog(@"%@", dataString);
        
        if (nil != _connectionData)
        {
            json = [NSJSONSerialization JSONObjectWithData:_connectionData options:NSJSONReadingMutableContainers error:&error];
        }
        
        if (error || !json)
        {
            NSLog(@"Could not parse loaded json with error:%@", error);
        }
        
        NSLog(@"%@", json);
        _connectionData = nil;
    }
    
    [pool drain];

    return 0;
}
// This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
require_once 'HTTP/Request2.php';

$request = new Http_Request2('https://earthnetworks.azure-api.net/getSkyConditionIcons/resources/v3/icons?iconSet={iconSet}&iconSize={iconsize}');
$url = $request->getUrl();

$headers = array(
    // Request headers
    'Ocp-Apim-Subscription-Key' => '{subscription key}',
);

$request->setHeader($headers);

$parameters = array(
    // Request parameters
);

$url->setQueryVariables($parameters);

$request->setMethod(HTTP_Request2::METHOD_GET);

// Request body
$request->setBody("{body}");

try
{
    $response = $request->send();
    echo $response->getBody();
}
catch (HttpException $ex)
{
    echo $ex;
}
########### Python 2.7 #############
import httplib, urllib, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.urlencode({
})

try:
    conn = httplib.HTTPSConnection('earthnetworks.azure-api.net')
    conn.request("GET", "/getSkyConditionIcons/resources/v3/icons?iconSet={iconSet}&iconSize={iconsize}&%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################

########### Python 3.2 #############
import http.client, urllib.request, urllib.parse, urllib.error, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.parse.urlencode({
})

try:
    conn = http.client.HTTPSConnection('earthnetworks.azure-api.net')
    conn.request("GET", "/getSkyConditionIcons/resources/v3/icons?iconSet={iconSet}&iconSize={iconsize}&%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################
require 'net/http'

uri = URI('https://earthnetworks.azure-api.net/getSkyConditionIcons/resources/v3/icons?iconSet={iconSet}&iconSize={iconsize}')

request = Net::HTTP::Get.new(uri.request_uri)
# Request headers
request['Ocp-Apim-Subscription-Key'] = '{subscription key}'
# Request body
request.body = "{body}"

response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
    http.request(request)
end

puts response.body

Sky Conditions Icon V3

https://earthnetworks.azure-api.net/getSkyConditionIcons/resources/v3/icons?iconSet={iconSet}&iconSize={iconsize}
Headers
Ocp-Apim-Subscription-Key

Query parameters
iconSet

Optional parameters
iconsize

 

Station List

Desciption:

The stations call provides access to the entire station list. You should only use stations with a provider ID of 3, 4, 10 or 17. Adds optional display flag to allow manual setting to determine whether or not to use the station data.

3 = Earth Networks
4 = METAR
10 = CMAN
17 = SYNOP

Request URL:

https://earthnetworks.azure-api.net/data/locations/v2/stationlist

Request headers:

Ocp-Apim-Subscription-Key string Subscription key which provides access to this API. Found in your Profile.

 

Test request
 

Expected response

{
    "Stations": [
    {
        "StationId": "14439",
        "ProviderId": 10,
        "ProviderName": "NMS - SYNOP ",
        "StationName ":"SVEGA",
        "Latitude ":62.03333333,
        "Longitude ":14.4,""
        "ElevationAboveSeaLevelMeters":null,
        "DisplayFlag ":null
    },
    {
        "StationId": "CWIL",
        "ProviderId ": 4,
        "Provi derName": "NMS - METAR",
        "StationName": "HAT ISLAND",
        "Latitude": 68.31666667,
        "Longitude ": -100.0666667,
        "ElevationAboveSeaLevelMeters": null,
        "DisplayFlag": null
    },
    {
        "StationId": "KF24",
        "ProviderId": 4,
        "ProviderName": "NMS - METAR",
        "StationName": "MINDEN",
        "Latitude": 32.65,
        "Longitude": -93.3,
        "ElevationAboveSeaLevelMeters": null,
        "DisplayFlag": null
    },
    {
        "StationId": "KBKF",
        "ProviderId": 4,
        "ProviderName": "NMS - METAR",
        "StationName": "BUCKLEY ANGB/DEN",
        "Latitude": 39.71666667,
        "Longitude": -104.75,
        "ElevationAboveSeaLevelMeters": null,
        "DisplayFlag": null
    },
    {
        "StationId ":"ZHCC ","
        ProviderId ":4,
        "ProviderName ":
        "NMS - METAR ",
        "StationName ":"ZHENGZHOU ",
        "Latitude ":34.71666667,
        "Longitude ":113.65,
        "ElevationAboveSeaLevelMeters": null,
        "DisplayFlag": null
    },
    {
        "Station Id": "PRTRN",
        "ProviderId": 3,
        "ProviderName": "Earth Networks Inc",
        "StationName": "Sugar Mill ES",
        "Latitude": 29.1461111111111,
        "Longitude": -81.0008333333333,
        "ElevationAboveSeaLevelMeters": null,
        "DisplayFlag": null
    }]
}

Plus many more stations…
@ECHO OFF

curl -v -X GET "https://earthnetworks.azure-api.net/data/locations/v2/stationlist"
-H "Ocp-Apim-Subscription-Key: {subscription key}"

--data-ascii "{body}" 
using System;
using System.Net.Http.Headers;
using System.Text;
using System.Net.Http;
using System.Web;

namespace CSHttpClientSample
{
    static class Program
    {
        static void Main()
        {
            MakeRequest();
            Console.WriteLine("Hit ENTER to exit...");
            Console.ReadLine();
        }
        
        static async void MakeRequest()
        {
            var client = new HttpClient();
            var queryString = HttpUtility.ParseQueryString(string.Empty);

            // Request headers
            client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{subscription key}");

            var uri = "https://earthnetworks.azure-api.net/data/locations/v2/stationlist?" + queryString;

            var response = await client.GetAsync(uri);
        }
    }
}	
// // This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class JavaSample 
{
    public static void main(String[] args) 
    {
        HttpClient httpclient = HttpClients.createDefault();

        try
        {
            URIBuilder builder = new URIBuilder("https://earthnetworks.azure-api.net/data/locations/v2/stationlist");


            URI uri = builder.build();
            HttpGet request = new HttpGet(uri);
            request.setHeader("Ocp-Apim-Subscription-Key", "{subscription key}");


            // Request body
            StringEntity reqEntity = new StringEntity("{body}");
            request.setEntity(reqEntity);

            HttpResponse response = httpclient.execute(request);
            HttpEntity entity = response.getEntity();

            if (entity != null) 
            {
                System.out.println(EntityUtils.toString(entity));
            }
        }
        catch (Exception e)
        {
            System.out.println(e.getMessage());
        }
    }
}
$(function() {
    var params = {
        // Request parameters
    };

    $.ajax({
            url: "https://earthnetworks.azure-api.net/data/locations/v2/stationlist?" + $.param(params),
            beforeSend: function(xhrObj) {
                // Request headers
                xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key", "{subscription key}");
            },
            type: "GET",
            // Request body
            data: "{body}",
        })
        .done(function(data) {
            alert("success");
        })
        .fail(function() {
            alert("error");
        });
});
#import 

int main(int argc, const char * argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    
    NSString* path = @"https://earthnetworks.azure-api.net/data/locations/v2/stationlist";
    NSArray* array = @[
                         // Request parameters
                         @"entities=true",
                      ];
    
    NSString* string = [array componentsJoinedByString:@"&"];
    path = [path stringByAppendingFormat:@"?%@", string];

    NSLog(@"%@", path);

    NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:path]];
    [_request setHTTPMethod:@"GET"];
    // Request headers
    [_request setValue:@"{subscription key}" forHTTPHeaderField:@"Ocp-Apim-Subscription-Key"];
    // Request body
    [_request setHTTPBody:[@"{body}" dataUsingEncoding:NSUTF8StringEncoding]];
    
    NSURLResponse *response = nil;
    NSError *error = nil;
    NSData* _connectionData = [NSURLConnection sendSynchronousRequest:_request returningResponse:&response error:&error];

    if (nil != error)
    {
        NSLog(@"Error: %@", error);
    }
    else
    {
        NSError* error = nil;
        NSMutableDictionary* json = nil;
        NSString* dataString = [[NSString alloc] initWithData:_connectionData encoding:NSUTF8StringEncoding];
        NSLog(@"%@", dataString);
        
        if (nil != _connectionData)
        {
            json = [NSJSONSerialization JSONObjectWithData:_connectionData options:NSJSONReadingMutableContainers error:&error];
        }
        
        if (error || !json)
        {
            NSLog(@"Could not parse loaded json with error:%@", error);
        }
        
        NSLog(@"%@", json);
        _connectionData = nil;
    }
    
    [pool drain];

    return 0;
}
// This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
require_once 'HTTP/Request2.php';

$request = new Http_Request2('https://earthnetworks.azure-api.net/data/locations/v2/stationlist');
$url = $request->getUrl();

$headers = array(
    // Request headers
    'Ocp-Apim-Subscription-Key' => '{subscription key}',
);

$request->setHeader($headers);

$parameters = array(
    // Request parameters
);

$url->setQueryVariables($parameters);

$request->setMethod(HTTP_Request2::METHOD_GET);

// Request body
$request->setBody("{body}");

try
{
    $response = $request->send();
    echo $response->getBody();
}
catch (HttpException $ex)
{
    echo $ex;
}
########### Python 2.7 #############
import httplib, urllib, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.urlencode({
})

try:
    conn = httplib.HTTPSConnection('earthnetworks.azure-api.net')
    conn.request("GET", "/data/locations/v2/stationlist?%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################

########### Python 3.2 #############
import http.client, urllib.request, urllib.parse, urllib.error, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.parse.urlencode({
})

try:
    conn = http.client.HTTPSConnection('earthnetworks.azure-api.net')
    conn.request("GET", "/data/locations/v2/stationlist?%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################
require 'net/http'

uri = URI('https://earthnetworks.azure-api.net/data/locations/v2/stationlist')

request = Net::HTTP::Get.new(uri.request_uri)
# Request headers
request['Ocp-Apim-Subscription-Key'] = '{subscription key}'
# Request body
request.body = "{body}"

response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
    http.request(request)
end

puts response.body

Station List

https://earthnetworks.azure-api.net/data/locations/v2/stationlist
Headers
Ocp-Apim-Subscription-Key

 

Sunrise and Sunset Times

Description:

Sunrise and Sunset provides accurate sunrise and sunset times based on latitude and longitude. Default behavior when optional parameters NumDays, ShowSunrise and ShowSunset are omitted is to display both sunrise and sunset data for seven days beginning with the current day.

Request URL:

https://earthnetworks.azure-api.net/getAlmanacData/data/almanac/v1?locationtype=latitudelongitude&location=39,-77&verbose=true&days=2

Request parameters:

locationtype string „city“ or “latitudelongitude”
location string „CityId“ from Search Location or Longitude,Latitude

Optional parameters:

days number number of days you want data for. The default is 1 meaning only the current day. The number of days includes the current day and any subsequent days in local time (max:10)
verbose (optional) boolean true, false
cultureInfo (optional) string en-us, es-es

Request headers:

Ocp-Apim-Subscription-Key string Subscription key which provides access to this API. Found in your Profile.

Limitations:

Days must be < = 10

Test request
 

Expected response

{
    "solar": [
    {
        "sunriseDateTimeLocalS": "2013-06-20T05:42:14",
        "sunsetDateTimeLocalStr": "2013-06-20T20:36:47"
    },
    {
        "sunriseDateTimeLocalS": "2013-06-21T05:42:25",
        "sunsetDateTimeLocalStr": "2013-06-21T20:37:00"
    }],
    "lunar": [
        {
            "phaseIdentifier": -86,
            "phaseName": "Waxing Gibbous",
            "phaseIconCode": 12
        },
        {
            "phaseIdentifier": -92,
            "phaseName": "Waxing Gibbous",
            "phaseIconCode": 13
        }

    ]
}
@ECHO OFF

curl -v -X GET "https://earthnetworks.azure-api.net/getAlmanacData/data/almanac/v1?locationtype={locationtype}&location={location}?days=1&verbose={boolean}&cultureInfo=en-us"
-H "Ocp-Apim-Subscription-Key: {subscription key}"

--data-ascii "{body}" 
using System;
using System.Net.Http.Headers;
using System.Text;
using System.Net.Http;
using System.Web;

namespace CSHttpClientSample
{
    static class Program
    {
        static void Main()
        {
            MakeRequest();
            Console.WriteLine("Hit ENTER to exit...");
            Console.ReadLine();
        }
        
        static async void MakeRequest()
        {
            var client = new HttpClient();
            var queryString = HttpUtility.ParseQueryString(string.Empty);

            // Request headers
            client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{subscription key}");

            // Request parameters
            queryString["days"] = "1";
            queryString["verbose"] = "{boolean}";
            queryString["cultureInfo"] = "en-us";
            var uri = "https://earthnetworks.azure-api.net/getAlmanacData/data/almanac/v1?locationtype={locationtype}&location={location}&" + queryString;

            var response = await client.GetAsync(uri);
        }
    }
}	
// // This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class JavaSample 
{
    public static void main(String[] args) 
    {
        HttpClient httpclient = HttpClients.createDefault();

        try
        {
            URIBuilder builder = new URIBuilder("https://earthnetworks.azure-api.net/getAlmanacData/data/almanac/v1?locationtype={locationtype}&location={location}");

            builder.setParameter("days", "1");
            builder.setParameter("verbose", "{boolean}");
            builder.setParameter("cultureInfo", "en-us");

            URI uri = builder.build();
            HttpGet request = new HttpGet(uri);
            request.setHeader("Ocp-Apim-Subscription-Key", "{subscription key}");


            // Request body
            StringEntity reqEntity = new StringEntity("{body}");
            request.setEntity(reqEntity);

            HttpResponse response = httpclient.execute(request);
            HttpEntity entity = response.getEntity();

            if (entity != null) 
            {
                System.out.println(EntityUtils.toString(entity));
            }
        }
        catch (Exception e)
        {
            System.out.println(e.getMessage());
        }
    }
}
$(function() {
    var params = {
        // Request parameters
        "days": "1",
        "verbose": "{boolean}",
        "cultureInfo": "en-us",
    };

    $.ajax({
            url: "https://earthnetworks.azure-api.net/getAlmanacData/data/almanac/v1?locationtype={locationtype}&location={location}&" + $.param(params),
            beforeSend: function(xhrObj) {
                // Request headers
                xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key", "{subscription key}");
            },
            type: "GET",
            // Request body
            data: "{body}",
        })
        .done(function(data) {
            alert("success");
        })
        .fail(function() {
            alert("error");
        });
});
#import 

int main(int argc, const char * argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    
    NSString* path = @"https://earthnetworks.azure-api.net/getAlmanacData/data/almanac/v1?locationtype={locationtype}&location={location}";
    NSArray* array = @[
                         // Request parameters
                         @"entities=true",
                         @"days=1",
                         @"verbose={boolean}",
                         @"cultureInfo=en-us",
                      ];
    
    NSString* string = [array componentsJoinedByString:@"&"];
    path = [path stringByAppendingFormat:@"?%@", string];

    NSLog(@"%@", path);

    NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:path]];
    [_request setHTTPMethod:@"GET"];
    // Request headers
    [_request setValue:@"{subscription key}" forHTTPHeaderField:@"Ocp-Apim-Subscription-Key"];
    // Request body
    [_request setHTTPBody:[@"{body}" dataUsingEncoding:NSUTF8StringEncoding]];
    
    NSURLResponse *response = nil;
    NSError *error = nil;
    NSData* _connectionData = [NSURLConnection sendSynchronousRequest:_request returningResponse:&response error:&error];

    if (nil != error)
    {
        NSLog(@"Error: %@", error);
    }
    else
    {
        NSError* error = nil;
        NSMutableDictionary* json = nil;
        NSString* dataString = [[NSString alloc] initWithData:_connectionData encoding:NSUTF8StringEncoding];
        NSLog(@"%@", dataString);
        
        if (nil != _connectionData)
        {
            json = [NSJSONSerialization JSONObjectWithData:_connectionData options:NSJSONReadingMutableContainers error:&error];
        }
        
        if (error || !json)
        {
            NSLog(@"Could not parse loaded json with error:%@", error);
        }
        
        NSLog(@"%@", json);
        _connectionData = nil;
    }
    
    [pool drain];

    return 0;
}
// This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
require_once 'HTTP/Request2.php';

$request = new Http_Request2('https://earthnetworks.azure-api.net/getAlmanacData/data/almanac/v1?locationtype={locationtype}&location={location}');
$url = $request->getUrl();

$headers = array(
    // Request headers
    'Ocp-Apim-Subscription-Key' => '{subscription key}',
);

$request->setHeader($headers);

$parameters = array(
    // Request parameters
    'days' => '1',
    'verbose' => '{boolean}',
    'cultureInfo' => 'en-us',
);

$url->setQueryVariables($parameters);

$request->setMethod(HTTP_Request2::METHOD_GET);

// Request body
$request->setBody("{body}");

try
{
    $response = $request->send();
    echo $response->getBody();
}
catch (HttpException $ex)
{
    echo $ex;
}
########### Python 2.7 #############
import httplib, urllib, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.urlencode({
    # Request parameters
    'days': '1',
    'verbose': '{boolean}',
    'cultureInfo': 'en-us',
})

try:
    conn = httplib.HTTPSConnection('earthnetworks.azure-api.net')
    conn.request("GET", "/getAlmanacData/data/almanac/v1?locationtype={locationtype}&location={location}&%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################

########### Python 3.2 #############
import http.client, urllib.request, urllib.parse, urllib.error, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.parse.urlencode({
    # Request parameters
    'days': '1',
    'verbose': '{boolean}',
    'cultureInfo': 'en-us',
})

try:
    conn = http.client.HTTPSConnection('earthnetworks.azure-api.net')
    conn.request("GET", "/getAlmanacData/data/almanac/v1?locationtype={locationtype}&location={location}&%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################
require 'net/http'

uri = URI('https://earthnetworks.azure-api.net/getAlmanacData/data/almanac/v1?locationtype={locationtype}&location={location}')

query = URI.encode_www_form({
    # Request parameters
    'days' => '1',
    'verbose' => '{boolean}',
    'cultureInfo' => 'en-us'
})

if uri.query && uri.query.length > 0
    uri.query += '&' + query
else
    uri.query = query
end

request = Net::HTTP::Get.new(uri.request_uri)
# Request headers
request['Ocp-Apim-Subscription-Key'] = '{subscription key}'
# Request body
request.body = "{body}"

response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
    http.request(request)
end

puts response.body

Sunrise and Sunset Times

https://earthnetworks.azure-api.net/getAlmanacData/data/almanac/v1
Headers
Ocp-Apim-Subscription-Key

Query parameters
locationtype

location

Optional parameters
days

verbose

cultureInfo

 

Ultraviolet Index

Description:

The UV feed provides UV Index data for a lat/long

Request URL:

https://earthnetworks.azure-api.net/getUltraviolet/data/uv/v1

Request parameters:

locationtype string „city“ or “latitudelongitude”
location string a valid EN „CityId“ from Search Location, or Longitude,Latitude

Optional parameters:

verbose (optional) boolean true, false

Request headers:

Ocp-Apim-Subscription-Key string Subscription key which provides access to this API. Found in your Profile.

 

Test request
 

Expected response

{
    UvPeriods: [
    {
        DateUtcString: "2013-07-26T00:00:00Z",
        UvIndex: 9
    }]
}
@ECHO OFF

curl -v -X GET "https://earthnetworks.azure-api.net/getUltraviolet/data/uv/v1"
-H "Ocp-Apim-Subscription-Key: {subscription key}"

--data-ascii "{body}" 
using System;
using System.Net.Http.Headers;
using System.Text;
using System.Net.Http;
using System.Web;

namespace CSHttpClientSample
{
    static class Program
    {
        static void Main()
        {
            MakeRequest();
            Console.WriteLine("Hit ENTER to exit...");
            Console.ReadLine();
        }
        
        static async void MakeRequest()
        {
            var client = new HttpClient();
            var queryString = HttpUtility.ParseQueryString(string.Empty);

            // Request headers
            client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{subscription key}");

            var uri = "https://earthnetworks.azure-api.net/getUltraviolet/data/uv/v1?" + queryString;

            var response = await client.GetAsync(uri);
        }
    }
}	
// // This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class JavaSample 
{
    public static void main(String[] args) 
    {
        HttpClient httpclient = HttpClients.createDefault();

        try
        {
            URIBuilder builder = new URIBuilder("https://earthnetworks.azure-api.net/getUltraviolet/data/uv/v1");


            URI uri = builder.build();
            HttpGet request = new HttpGet(uri);
            request.setHeader("Ocp-Apim-Subscription-Key", "{subscription key}");


            // Request body
            StringEntity reqEntity = new StringEntity("{body}");
            request.setEntity(reqEntity);

            HttpResponse response = httpclient.execute(request);
            HttpEntity entity = response.getEntity();

            if (entity != null) 
            {
                System.out.println(EntityUtils.toString(entity));
            }
        }
        catch (Exception e)
        {
            System.out.println(e.getMessage());
        }
    }
}
$(function() {
    var params = {
        // Request parameters
    };

    $.ajax({
            url: "https://earthnetworks.azure-api.net/getUltraviolet/data/uv/v1?" + $.param(params),
            beforeSend: function(xhrObj) {
                // Request headers
                xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key", "{subscription key}");
            },
            type: "GET",
            // Request body
            data: "{body}",
        })
        .done(function(data) {
            alert("success");
        })
        .fail(function() {
            alert("error");
        });
});
$(function() {
    var params = {
        // Request parameters
    };

    $.ajax({
            url: "https://earthnetworks.azure-api.net/getUltraviolet/data/uv/v1?" + $.param(params),
            beforeSend: function(xhrObj) {
                // Request headers
                xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key", "{subscription key}");
            },
            type: "GET",
            // Request body
            data: "{body}",
        })
        .done(function(data) {
            alert("success");
        })
        .fail(function() {
            alert("error");
        });
});
// This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
require_once 'HTTP/Request2.php';

$request = new Http_Request2('https://earthnetworks.azure-api.net/getUltraviolet/data/uv/v1');
$url = $request->getUrl();

$headers = array(
    // Request headers
    'Ocp-Apim-Subscription-Key' => '{subscription key}',
);

$request->setHeader($headers);

$parameters = array(
    // Request parameters
);

$url->setQueryVariables($parameters);

$request->setMethod(HTTP_Request2::METHOD_GET);

// Request body
$request->setBody("{body}");

try
{
    $response = $request->send();
    echo $response->getBody();
}
catch (HttpException $ex)
{
    echo $ex;
}
// This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
require_once 'HTTP/Request2.php';

$request = new Http_Request2('https://earthnetworks.azure-api.net/getUltraviolet/data/uv/v1');
$url = $request->getUrl();

$headers = array(
    // Request headers
    'Ocp-Apim-Subscription-Key' => '{subscription key}',
);

$request->setHeader($headers);

$parameters = array(
    // Request parameters
);

$url->setQueryVariables($parameters);

$request->setMethod(HTTP_Request2::METHOD_GET);

// Request body
$request->setBody("{body}");

try
{
    $response = $request->send();
    echo $response->getBody();
}
catch (HttpException $ex)
{
    echo $ex;
}
// This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
require_once 'HTTP/Request2.php';

$request = new Http_Request2('https://earthnetworks.azure-api.net/getUltraviolet/data/uv/v1');
$url = $request->getUrl();

$headers = array(
    // Request headers
    'Ocp-Apim-Subscription-Key' => '{subscription key}',
);

$request->setHeader($headers);

$parameters = array(
    // Request parameters
);

$url->setQueryVariables($parameters);

$request->setMethod(HTTP_Request2::METHOD_GET);

// Request body
$request->setBody("{body}");

try
{
    $response = $request->send();
    echo $response->getBody();
}
catch (HttpException $ex)
{
    echo $ex;
}

Ultraviolet Index (UV)

https://earthnetworks.azure-api.net/getUltraviolet/data/uv/v1
Headers
Ocp-Apim-Subscription-Key

Query parameters
Location Type

Location

Optional parameters
verbose

 

US Alerts

Description:

The Alerts request provides up-to-the-minute NWS US weather alerts. Only currently active alerts are returned based on the LatLong entered.

Dangerous Thunderstorm Alert is a part of US Alert API and it is a proprietary and more granular alert than the National Weather Service.

Request URL:

https://earthnetworks.azure-api.net/getPublishedAlerts/data/alerts/v1/alerts?locationtype={locationtype}&location={location}[&cultureInfo][&verbose]

Request parameters:

locationtype string „city“ or “latitudelongitude”
location string a valid EN „CityId“ from Search Location, or Longitude,Latitude

Optional parameters:

cultureInfo string choice of language: en-us, es-es
verbose (optional) boolean true, false

Request headers:

Ocp-Apim-Subscription-Key string Subscription key which provides access to this API. Found in your Profile.

 

Test request
 

Expected response

{
  "alertList": [
    {
      "AlertId": "EarthNetworks:DTA-CAR201709041038001~1504536180",
      "AlertPrimaryId": "EarthNetworks:DTA-CAR201709041038001",
      "AlertProviderId": "EarthNetworks",
      "AlertSecondaryId": "1504536180",
      "AlertType": "DTA",
      "AlertTypeName": "Dangerous Thunderstorm Alert",
      "ExpiredDateTimeLocalString": "2017-09-04T06:28:00",
      "ExpiredDateTimeUtcString": "2017-09-04T11:28:00",
      "IssuedDateTimeLocalString": "2017-09-04T05:43:00",
      "IssuedDateTimeUtcString": "2017-09-04T10:43:00",
      "Message": "An Earth Networks Dangerous Thunderstorm Alert is in effect until 9/4/2017 6:28 AM ESTnnEvent Start: 9/4/2017 5:43 AM EST nEvent End: 9/4/2017 6:28 AM ESTnnEarth Networks Dangerous Thunderstorm Alert nEarth Networks Headquarters Germantown, MDnn* Until  6:28 AM ESTnn* At 5:43 AM EST...The Earth Networks Total Lightning Network is indicating a thunderstorm with a significant rate of lightning occurring in your area and moving in your direction. This storm has an increased potential to produce severe weather such as very frequent lightning, heavy rain, hail and/or damaging winds and should be considered dangerous. (For more information on this Earth Networks product visit www.earthnetworks.com) nn* Storm is located near Latitude: 9.901, Longitude: -80.65nn* Repeating, this storm contains frequent lightning and has an increased potential to produce severe weather and should be considered dangerous. Take appropriate measures to ensure safety to life and property immediately.  nnThis alert is being issued in an advisory capacity by Earth Networks Headquarters due to the detection of frequent lightning by The Earth Networks Total Lightning Network. It is not associated in any way with the country’s official meteorological services nor to any official alert linked to this storm. Active advisories or warnings issued by the official meteorological services should be followed in precedence to this alert.nnStay tuned to www.earthnetworks.com, other Earth Networks applications or local media outlets for the latest severe weather information. ",
      "Polygon": "POLYGON ((-80.7109444846005 10.0124962767474, -80.8391921955307 9.71594736273189, -80.5904831829586 9.64299443939266, -80.5382217452149 9.9618321346038, -80.7109444846005 10.0124962767474))",
      "RawText": "CAR201709041038001cap-alert-feed@earthnetworks.com2017-09-04T10:43:00+00:00ActualAlertEarth NetworksPublicMetEarth Networks Dangerous Thunderstorm AlertExecuteExpectedSevereLikely2017-09-04T10:43:00+00:002017-09-04T11:28:00+00:00Earth Networks Headquarters, Germantown, MDEarth Networks Level 3 Lightning Polygon until 2017-09-04T11:28:00.0000000+00:00An Earth Networks Dangerous Thunderstorm Alert is in effect until 9/4/2017 6:28 AM ESTrnrnEvent Start: 9/4/2017 5:43 AM EST rnEvent End: 9/4/2017 6:28 AM ESTrnrnEarth Networks Dangerous Thunderstorm Alert rnEarth Networks Headquarters Germantown, MDrnrn* Until  6:28 AM ESTrnrn* At 5:43 AM EST...The Earth Networks Total Lightning Network is indicating a thunderstorm with a significant rate of lightning occurring in your area and moving in your direction. This storm has an increased potential to produce severe weather such as very frequent lightning, heavy rain, hail and/or damaging winds and should be considered dangerous. (For more information on this Earth Networks product visit www.earthnetworks.com) rnrn* Storm is located near Latitude: 9.901, Longitude: -80.65rnrn* Repeating, this storm contains frequent lightning and has an increased potential to produce severe weather and should be considered dangerous. Take appropriate measures to ensure safety to life and property immediately.  rnrnThis alert is being issued in an advisory capacity by Earth Networks Headquarters due to the detection of frequent lightning by The Earth Networks Total Lightning Network. It is not associated in any way with the country’s official meteorological services nor to any official alert linked to this storm. Active advisories or warnings issued by the official meteorological services should be followed in precedence to this alert.rnrnStay tuned to www.earthnetworks.com, other Earth Networks applications or local media outlets for the latest severe weather information. This storm contains frequent lightning and has an increased potential to produce severe weather and should be considered dangerous. Take appropriate measures to ensure safety to life and property immediately.https://support.earthnetworks.com/ContactSupportLIGHTNING_SEVERITYHighCELL_POLYGONPOLYGON ((9.78461366531798 -80.7287357777323, 9.76564652964267 -80.7203332805648, 9.77528076824829 -80.6603332805648, 9.78002199196911 -80.6403332805648, 9.78461366531798 -80.6354568015522, 9.82409565118245 -80.6003332805648, 9.82461366531798 -80.5999390554967, 9.96461366531798 -80.5723774123394, 9.98461366531798 -80.5703558712896, 10.004613665318 -80.5909213936392, 10.0133421669984 -80.6003332805648, 10.015370538465 -80.6203332805648, 9.9964517912622 -80.6803332805648, 9.98461366531798 -80.6905669977134, 9.94461366531798 -80.7112654240193, 9.92461366531798 -80.7213985906504, 9.86461366531798 -80.7293778604257, 9.80461366531798 -80.7301452186362, 9.78461366531798 -80.7287357777323))DIRECTION16SPEED13 mphLatitude: 9.901, Longitude: -80.6510.0124962767474 -80.7109444846005, 9.71594736273189 -80.8391921955307, 9.64299443939266 -80.5904831829586, 9.9618321346038 -80.5382217452149, 10.0124962767474 -80.7109444846005",
      "PVtec": null
    }
  ],
  "location": "9.85521608608867,-80.70281982421876",
  "locationType": "latitudelongitude"
}
@ECHO OFF

curl -v -X GET "https://earthnetworks.azure-api.net/getPublishedAlerts/data/alerts/v1/alerts?locationtype={locationtype}&location={location}?cultureInfo={string}&verbose={string}"
-H "Ocp-Apim-Subscription-Key: {subscription key}"

--data-ascii "{body}" 
using System;
using System.Net.Http.Headers;
using System.Text;
using System.Net.Http;
using System.Web;

namespace CSHttpClientSample
{
    static class Program
    {
        static void Main()
        {
            MakeRequest();
            Console.WriteLine("Hit ENTER to exit...");
            Console.ReadLine();
        }
        
        static async void MakeRequest()
        {
            var client = new HttpClient();
            var queryString = HttpUtility.ParseQueryString(string.Empty);

            // Request headers
            client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{subscription key}");

            // Request parameters
            queryString["cultureInfo"] = "{string}";
            queryString["verbose"] = "{string}";
            var uri = "https://earthnetworks.azure-api.net/getPublishedAlerts/data/alerts/v1/alerts?locationtype={locationtype}&location={location}&" + queryString;

            var response = await client.GetAsync(uri);
        }
    }
}	
// // This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class JavaSample 
{
    public static void main(String[] args) 
    {
        HttpClient httpclient = HttpClients.createDefault();

        try
        {
            URIBuilder builder = new URIBuilder("https://earthnetworks.azure-api.net/getPublishedAlerts/data/alerts/v1/alerts?locationtype={locationtype}&location={location}");

            builder.setParameter("cultureInfo", "{string}");
            builder.setParameter("verbose", "{string}");

            URI uri = builder.build();
            HttpGet request = new HttpGet(uri);
            request.setHeader("Ocp-Apim-Subscription-Key", "{subscription key}");


            // Request body
            StringEntity reqEntity = new StringEntity("{body}");
            request.setEntity(reqEntity);

            HttpResponse response = httpclient.execute(request);
            HttpEntity entity = response.getEntity();

            if (entity != null) 
            {
                System.out.println(EntityUtils.toString(entity));
            }
        }
        catch (Exception e)
        {
            System.out.println(e.getMessage());
        }
    }
}
$(function() {
    var params = {
        // Request parameters
        "cultureInfo": "{string}",
        "verbose": "{string}",
    };

    $.ajax({
            url: "https://earthnetworks.azure-api.net/getPublishedAlerts/data/alerts/v1/alerts?locationtype={locationtype}&location={location}&" + $.param(params),
            beforeSend: function(xhrObj) {
                // Request headers
                xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key", "{subscription key}");
            },
            type: "GET",
            // Request body
            data: "{body}",
        })
        .done(function(data) {
            alert("success");
        })
        .fail(function() {
            alert("error");
        });
});
#import 

int main(int argc, const char * argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    
    NSString* path = @"https://earthnetworks.azure-api.net/getPublishedAlerts/data/alerts/v1/alerts?locationtype={locationtype}&location={location}";
    NSArray* array = @[
                         // Request parameters
                         @"entities=true",
                         @"cultureInfo={string}",
                         @"verbose={string}",
                      ];
    
    NSString* string = [array componentsJoinedByString:@"&"];
    path = [path stringByAppendingFormat:@"?%@", string];

    NSLog(@"%@", path);

    NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:path]];
    [_request setHTTPMethod:@"GET"];
    // Request headers
    [_request setValue:@"{subscription key}" forHTTPHeaderField:@"Ocp-Apim-Subscription-Key"];
    // Request body
    [_request setHTTPBody:[@"{body}" dataUsingEncoding:NSUTF8StringEncoding]];
    
    NSURLResponse *response = nil;
    NSError *error = nil;
    NSData* _connectionData = [NSURLConnection sendSynchronousRequest:_request returningResponse:&response error:&error];

    if (nil != error)
    {
        NSLog(@"Error: %@", error);
    }
    else
    {
        NSError* error = nil;
        NSMutableDictionary* json = nil;
        NSString* dataString = [[NSString alloc] initWithData:_connectionData encoding:NSUTF8StringEncoding];
        NSLog(@"%@", dataString);
        
        if (nil != _connectionData)
        {
            json = [NSJSONSerialization JSONObjectWithData:_connectionData options:NSJSONReadingMutableContainers error:&error];
        }
        
        if (error || !json)
        {
            NSLog(@"Could not parse loaded json with error:%@", error);
        }
        
        NSLog(@"%@", json);
        _connectionData = nil;
    }
    
    [pool drain];

    return 0;
}
// This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
require_once 'HTTP/Request2.php';

$request = new Http_Request2('https://earthnetworks.azure-api.net/getPublishedAlerts/data/alerts/v1/alerts?locationtype={locationtype}&location={location}');
$url = $request->getUrl();

$headers = array(
    // Request headers
    'Ocp-Apim-Subscription-Key' => '{subscription key}',
);

$request->setHeader($headers);

$parameters = array(
    // Request parameters
    'cultureInfo' => '{string}',
    'verbose' => '{string}',
);

$url->setQueryVariables($parameters);

$request->setMethod(HTTP_Request2::METHOD_GET);

// Request body
$request->setBody("{body}");

try
{
    $response = $request->send();
    echo $response->getBody();
}
catch (HttpException $ex)
{
    echo $ex;
}
########### Python 2.7 #############
import httplib, urllib, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.urlencode({
    # Request parameters
    'cultureInfo': '{string}',
    'verbose': '{string}',
})

try:
    conn = httplib.HTTPSConnection('earthnetworks.azure-api.net')
    conn.request("GET", "/getPublishedAlerts/data/alerts/v1/alerts?locationtype={locationtype}&location={location}&%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################

########### Python 3.2 #############
import http.client, urllib.request, urllib.parse, urllib.error, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.parse.urlencode({
    # Request parameters
    'cultureInfo': '{string}',
    'verbose': '{string}',
})

try:
    conn = http.client.HTTPSConnection('earthnetworks.azure-api.net')
    conn.request("GET", "/getPublishedAlerts/data/alerts/v1/alerts?locationtype={locationtype}&location={location}&%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################
require 'net/http'

uri = URI('https://earthnetworks.azure-api.net/getPublishedAlerts/data/alerts/v1/alerts?locationtype={locationtype}&location={location}')

query = URI.encode_www_form({
    # Request parameters
    'cultureInfo' => '{string}',
    'verbose' => '{string}'
})

if uri.query && uri.query.length > 0
    uri.query += '&' + query
else
    uri.query = query
end

request = Net::HTTP::Get.new(uri.request_uri)
# Request headers
request['Ocp-Apim-Subscription-Key'] = '{subscription key}'
# Request body
request.body = "{body}"

response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
    http.request(request)
end

puts response.body

US Alerts

https://earthnetworks.azure-api.net/getPublishedAlerts/data/alerts/v1/alerts
Headers
Ocp-Apim-Subscription-Key

Query parameters
Location Type

Location

Optional parameters
verbose