Swackett Weather API :: Introduction and Reference

What The Swackett Weather API Provides
  • Current weather conditions for any location on Earth
  • Minute-by-minute forecasts for the next hour
  • Hour-by-hour forecasts for the next 48 hours
  • Day-by-day forecasts for the next 7 days
  • Severe weather alerts in the US, Canada, and select European countries

Popular uses for this type of data include Weather Information Billboard Displays for college campuses and hotels — and as a data source for web sites and mobile apps.

Swackett Weather API Call Types

Weather forecast data is available via a simple API request called with a private, authorized API Key.

Response Format

At this time the Swackett Weather API responds to API calls in these formats:

  • JSON
  • Encrypted, Compressed Swackett IO

You can parse the response directly, or interact with our API in the programming language of your choice.

Weather Data Elements Included

Swackett Weather API offers a profile of meteorological conditions for any location:

  • Apparent (feels-like) temperature
  • Atmospheric pressure
  • Cloud cover
  • Dew point
  • Forecast Icons (icon names)
  • Forecast People Symbol (Peep) images (image and edition names)
  • Humidity
  • Liquid precipitation rate
  • Moon phase
  • Ozone
  • Precipitation type
  • Snowfall
  • Sun rise/set
  • Temperature
  • Text summaries in narrative form
  • UV index
  • Wind gust
  • Wind speed
  • Wind direction
Swackett Weather API Request Example
Example Request
https://data.gateway.swackett.net/app/api/io?key=[api_key]&lat=[lat]&lon=[lon]

The API returns current weather conditions, a minute-by-minute forecast for the next hour (where available), an hour-by-hour forecast for the next 48 hours, and a day-by-day forecast for the next week.

Example Response
{
    "result": "200 OK ",
    "latitudeParameter": "37.8199",
    "longitudeParameter": "-122.4783",
    "unitsParameter": "imperial",
    "languageParameter": "en",
    "format": "swackett",
    "version": "2.1",
    "latitude": 37.8,
    "longitude": -122.5,
    "units": "auto",
    "language": "en",
    "timezone": "America/Los_Angeles",
    "timezoneOffset": -25200,
    "dataRecordID": "0b74280fb8d3",
    "dataRecordTimestamp": 1601594209,
    "currentLocalTimestampUTC": 1601594209,
    "currentLocalTimestamp": 1601569009,
    "currently": {
        "time": 1601594209,
        "summary": "Clear",
        "icon": "clear-day",
        "peep": "•",
        "peepEdition": "•",
        "temperature": 77.34,
        "apparentTemperature": 77.34,
        "precipIntensity": 0,
        "precipProbability": 0,
        "dewPoint": 55.84,
        "pressure": 1013.6,
        "humidity": 0.47,
        "windSpeed": 6.48,
        "windGust": 8.33,
        "windBearing": 234,
        "cloudCover": 0.09,
        "uvIndex": 2,
        "visibility": 10,
        "ozone": 273.2,
        "nearestStormDistance": "",
        "nearestStormBearing": ""
    },
    "minutely": {
        "summary": "Clear for the hour.",
        "icon": "clear-day",
        "peep": "•",
        "peepEdition": "•",
        "data": [
            {
                "time": 1601594160,
                "precipIntensity": 0,
                "precipProbability": 0
            },
            ...
        ]
    },
    "hourly": {
        "summary": "Clear throughout the day.",
        "icon": "clear-day",
        "peep": "•",
        "peepEdition": "•",
        "data": [
            {
                "time": 1601593200,
                "summary": "Clear",
                "icon": "clear-day",
                "peep": "•",
                "peepEdition": "•",
                "temperature": 77.6,
                "apparentTemperature": 77.6,
                "precipIntensity": 0,
                "precipProbability": 0,
                "precipType": "",
                "dewPoint": 55.84,
                "humidity": 0.47,
                "pressure": 1013.7,
                "windSpeed": 6.18,
                "windGust": 7.82,
                "windBearing": 227,
                "cloudCover": 0.09,
                "uvIndex": 3,
                "visibility": 10,
                "ozone": 273.3
            },
            ...
        ]
    },
    "daily": {
        "summary": "No precipitation throughout the week.",
        "icon": "clear-day",
        "peep": "•",
        "peepEdition": "•",
        "data": [
            {
                "time": 1601535600,
                "summary": "Clear throughout the day.",
                "icon": "clear-day",
                "peep": "•",
                "peepEdition": "•",
                "temperatureMinTime": 1601622000,
                "temperatureMax": 79.94,
                "temperatureMaxTime": 1601582820,
                "temperatureHigh": 79.94,
                "temperatureHighTime": 1601582820,
                "temperatureLow": 60.65,
                "temperatureLowTime": 1601648160,
                "apparentTemperatureMin": 64.65,
                "apparentTemperatureMinTime": 1601622000,
                "apparentTemperatureMax": 79.44,
                "apparentTemperatureMaxTime": 1601582820,
                "precipIntensity": 0.0004,
                "precipIntensityMax": 0.0018,
                "precipIntensityMaxTime": 1601621880,
                "precipProbability": 0.04,
                "precipType": "rain",
                "sunriseTime": 1601561220,
                "sunsetTime": 1601603640,
                "moonPhase": 0.51,
                "dewPoint": 55.37,
                "humidity": 0.6,
                "pressure": 1014.9,
                "windSpeed": 4.35,
                "windGust": 9.5,
                "windGustTime": 1601597940,
                "windBearing": 252,
                "uvIndex": 6,
                "uvIndexTime": 1601582400,
                "cloudCover": 0.06,
                "visibility": 10,
                "ozone": 277.1
            },
            …
        ]
    },
    "alerts": {
        "active": 0
    },
    "flags": {
        "units": "auto"
    },
    "offset": -7
}
        
Swackett Weather API Request Parameters
ParameterRequiredDetails
keyrequiredYour Private API Key.
latrequiredThe latitude of a location (in decimal degrees). Positive is north, negative is south.
lonrequiredThe longitude of a location (in decimal degrees). Positive is east, negative is west.
unitsSwackett Weather API :: Units Parameter
langSwackett Weather API :: Language Parameter
API Response Data Elements

data element object contains various properties, each representing the average (unless otherwise specified) of a particular weather phenomenon occurring during a period of time: an instant in the case of currently, a minute for minutely, an hour for hourly, and a day for daily. These properties are listed below.

Migrating from the Dark Sky API?

The Swackett Weather API has been re-architected to match the Dark Sky API, with a few important differences.

Data ElementRequiredDetails
apparentTemperatureThe apparent (or “feels like”) temperature in degrees Fahrenheit.
apparentTemperatureHighThe daytime high apparent temperature.
apparentTemperatureHighTimeThe UNIX time representing when the daytime high apparent temperature occurs.
apparentTemperatureLowThe overnight low apparent temperature.
  • apparentTemperature optional, only on hourly and currentlyThe apparent (or “feels like”) temperature in degrees Fahrenheit.
  • apparentTemperatureHigh optional, only on dailyThe daytime high apparent temperature.
  • apparentTemperatureHighTime optional, only on dailyThe UNIX time representing when the daytime high apparent temperature occurs.
  • apparentTemperatureLow optional, only on dailyThe overnight low apparent temperature.
  • apparentTemperatureLowTime optional, only on dailyThe UNIX time representing when the overnight low apparent temperature occurs.
  • apparentTemperatureMax optional, only on dailyThe maximum apparent temperature during a given date.
  • apparentTemperatureMaxTime optional, only on dailyThe UNIX time representing when the maximum apparent temperature during a given date occurs.
  • apparentTemperatureMin optional, only on dailyThe minimum apparent temperature during a given date.
  • apparentTemperatureMinTime optional, only on dailyThe UNIX time representing when the minimum apparent temperature during a given date occurs.
  • cloudCover optionalThe percentage of sky occluded by clouds, between 0 and 1, inclusive.
  • dewPoint optionalThe dew point in degrees Fahrenheit.
  • humidity optionalThe relative humidity, between 0 and 1, inclusive.
  • icon optionalA machine-readable text summary of this data point, suitable for selecting an icon for display. If defined, this property will have one of the following values: clear-dayclear-nightrainsnowsleetwindfogcloudypartly-cloudy-day, or partly-cloudy-night. (Developers should ensure that a sensible default is defined, as additional values, such as hailthunderstorm, or tornado, may be defined in the future.)
  • moonPhase optional, only on dailyThe fractional part of the lunation number during the given day: a value of 0 corresponds to a new moon, 0.25 to a first quarter moon, 0.5 to a full moon, and 0.75 to a last quarter moon. (The ranges in between these represent waxing crescent, waxing gibbous, waning gibbous, and waning crescent moons, respectively.)
  • nearestStormBearing optional, only on currentlyThe approximate direction of the nearest storm in degrees, with true north at 0° and progressing clockwise. (If nearestStormDistance is zero, then this value will not be defined.)
  • nearestStormDistance optional, only on currentlyThe approximate distance to the nearest storm in miles. (A storm distance of 0 doesn’t necessarily refer to a storm at the requested location, but rather a storm in the vicinity of that location.)
  • ozone optionalThe columnar density of total atmospheric ozone at the given time in Dobson units.
  • precipAccumulation optional, only on hourly,currently and dailyThe amount of snowfall accumulation expected to occur (over the hour or day, respectively), in inches. (If no snowfall is expected, this property will not be defined.)
  • precipIntensity optionalThe intensity (in inches of liquid water per hour) of precipitation occurring at the given time. This value is conditional on probability (that is, assuming any precipitation occurs at all).
  • precipIntensityError optionalThe standard deviation of the distribution of precipIntensity. (We only return this property when the full distribution, and not merely the expected mean, can be estimated with accuracy.)
  • precipIntensityMax optional, only on dailyThe maximum value of precipIntensity during a given day.
  • precipIntensityMaxTime optional, only on dailyThe UNIX time of when precipIntensityMax occurs during a given day.
  • precipProbability optionalThe probability of precipitation occurring, between 0 and 1, inclusive.
  • precipType optionalThe type of precipitation occurring at the given time. If defined, this property will have one of the following values: "rain""snow", or "sleet" (which refers to each of freezing rain, ice pellets, and “wintery mix”). (If precipIntensity is zero, then this property will not be defined. Additionally, due to the lack of data in our sources, historical precipType information is usually estimated, rather than observed.)
  • pressure optionalThe sea-level air pressure in millibars.
  • summary optionalA human-readable text summary of this data point. (This property has millions of possible values, so don’t use it for automated purposes: use the icon property, instead!)
  • sunriseTime optional, only on dailyThe UNIX time of when the sun will rise during a given day.
  • sunsetTime optional, only on dailyThe UNIX time of when the sun will set during a given day.
  • temperature optional, only on hourly and currentlyThe air temperature in degrees Fahrenheit.
  • temperatureHigh optional, only on dailyThe daytime high temperature.
  • temperatureHighTime optional, only on dailyThe UNIX time representing when the daytime high temperature occurs.
  • temperatureLow optional, only on dailyThe overnight low temperature.
  • temperatureLowTime optional, only on dailyThe UNIX time representing when the overnight low temperature occurs.
  • temperatureMax optional, only on dailyThe maximum temperature during a given date.
  • temperatureMaxTime optional, only on dailyThe UNIX time representing when the maximum temperature during a given date occurs.
  • temperatureMin optional, only on dailyThe minimum temperature during a given date.
  • temperatureMinTime optional, only on dailyThe UNIX time representing when the minimum temperature during a given date occurs.
  • time requiredThe UNIX time at which this data point begins. minutely data point are always aligned to the top of the minute, hourly data point objects to the top of the hour, daily data point objects to midnight of the day, and currently data point object to the point of time provided all according to the local time zone.
  • uvIndex optionalThe UV index.
  • uvIndexTime optional, only on dailyThe UNIX time of when the maximum uvIndex occurs during a given day.
  • visibility optionalThe average visibility in miles, capped at 10 miles.
  • windBearing optionalThe direction that the wind is coming from in degrees, with true north at 0° and progressing clockwise. (If windSpeed is zero, then this value will not be defined.)
  • windGust optionalThe wind gust speed in miles per hour.
  • windGustTime optional, only on dailyThe time at which the maximum wind gust speed occurs during the day.
  • windSpeed optionalThe wind speed in miles per hour.

Data Block Object

data block object represents the various weather phenomena occurring over a period of time. Such objects contain the following properties:

  • data requiredAn array of data points, ordered by time, which together describe the weather conditions at the requested location over time.
  • summary optionalA human-readable summary of this data block.
  • icon optionalA machine-readable text summary of this data block. (May take on the same values as the iconproperty of data points.)

Alerts Array

The alerts array contains objects representing the severe weather warnings issued for the requested location by a governmental authority (please see our data sources page for a list of sources). Objects in the alerts array contain the following properties:

  • description requiredA detailed description of the alert.
  • expires requiredThe UNIX time at which the alert will expire.
  • regions requiredAn array of strings representing the names of the regions covered by this weather alert.
  • severity requiredThe severity of the weather alert. Will take one of the following values: "advisory" (an individual should be aware of potentially severe weather), "watch" (an individual should prepare for potentially severe weather), or "warning" (an individual should take immediate action to protect themselves and others from potentially severe weather).
  • time requiredThe UNIX time at which the alert was issued.
  • title requiredA brief description of the alert.
  • uri requiredAn HTTP(S) URI that one may refer to for detailed information about the alert.