Places Postal Codes

Places Postal Codes

URL Path
https://data.api.xweather.com/places/postalcodes/
Data Coverage
US, Canada
Update Interval
N/A
Time Range
N/A

The places/postal codes endpoint provides information on US ZIP codes and Canadian Postal Codes. US 5-digit ZIP codes and Canadian 6-character postal codes are supported.

Requests

Every request to the endpoint must include one of the supported actions in the url.

https://data.api.xweather.com/places/postalcodes/{action}?client_id={client_id}&client_secret={client_secret}&{params}

Supported Actions

The following actions are supported with the /places/postalcodes endpoint:

ActionDescription
:idType: stringTypically used for passing a geographical location name or identifier such as city name, lat/long, or even US and Canadian postal codes. Learn more.
closestType: stringBased on a location search, the results will be returned in order from closest to farthest. Learn more.
withinType: stringUses a circle or polygon, define an area to search for results. Learn more.
searchType: stringA generalized action that is determined with the endpoints query parameters. Learn more.

Response

The following is an example of what each object in the response will consist of. Depending on your requested action, the response may contain multiple instances of this object within an array.

Properties

id (string)

The postal/zip code.

loc (object)

The location of the record.

loc.lat (number)

The latitude coordinate of the record.

loc.long (number)

The place or nearest place to the record.

place (object)

Object containing information about the place or nearest place to the record.

place.name (string)

The place or nearest place to the record.

place.state (string)

The state abbreviation in which the response is located. This may be null or an empty string depending on the country.

place.countryFull (string)

The full name of the country in which the response is located.

place.region (string)

The region for the location (primarily for US-based locations).

place.regionFull (string)

The full name of the region for the location (primarily for US-based locations).

place.continent (string)

The continent abbreviation the location belongs to.

place.continentFull (string)

The full name of the continent the location belongs to.

profile (object)

Object containing information about the location or event.

profile.elevM (number)

The elevation of the location in meters. Null if not available.

profile.elevFT (number)

The elevation of the location in feet. Null if not available.

profile.pop (number)

The estimates population of the location. Null if not available.

profile.tz (string)

Timezone name of the location, such as America/New_York.

profile.tzname (string)

The timezone abbreviation for the location, such as EST.

profile.tzoffset (number)

The timezone offset for the location in seconds.

profile.isDST (boolean)

True if the location is currently observing Daylight Savings Time (DST), otherwise false.

profile.wxzone (array)

Array of weather zones for the location. Null or empty if unavailable.

profile.firezone (array)

Array of NOAA fire zones for the location. Null or empty if unavailable.

profile.fips (array)

Array of FIPS codes for the location. US Only. Null or empty if unavailable.

profile.countyid (array)

Array of NOAA county IDs for the location. US Only. Null or empty if unavailable.

profile.code (string)

Location code, based on GeoNames place codes. Null if not available.

{
  "id": "55415",
  "loc": {
    "lat": 44.979183,
    "long": -93.261094
  },
  "place": {
    "name": "Minneapolis",
    "state": "MN",
    "stateFull": "Minnesota",
    "country": "US",
    "countryFull": "United States",
    "region": "usnc",
    "regionFull": "North Central",
    "continent": "na",
    "continentFull": "North America"
  },
  "profile": {
    "elevM": null,
    "elevFT": null,
    "pop": null,
    "tz": "America/Chicago",
    "tzname": "CST",
    "tzoffset": -21600,
    "isDST": false,
    "wxzone": [
      "MNZ060"
    ],
    "firezone": [
      "MNZ060"
    ],
    "fips": [
      "27053"
    ],
    "countyid": [
      "MNC053"
    ],
    "code": null,
    "active": true
  }
}