Endpoint: tides

The normals endpoints provides access to the predicted tidal information for US locations.

https://api.aerisapi.com/tides/

Supported Actions

The following actions are supported with the tides endpoint:

:id Requesting data by using the :id action is used for returning data for a particular item that has an ID associated with it. This is the primary method for requesting general weather information for a single location (observations, forecasts, advisories, etc.) as the location's name or a zip code serves as the id. Other endpoints may expect a certain value for the ID, such as storm cells whose ID value is a combination of the radar site identifier and unique identifier assigned to every storm cell. Refer to an enpoint's detailed documentation for specific information regarding how to use the :id action.
closest The closest action will query the API for data that is closest to the requested place and return the results, if any, in order from closest to farthest. If no limit is provided in the request, then only the closest single result will be returned. If a radius is not provided, then the default of 20 miles will be used.

If your request does not return results, you may try setting or increasing the radius being used. Note, however, that a maximum of 250 results can be returned in a single request.
within The within action allows for returning data within a variety of different geometrical regions. Currently supported geometries include a circle (requires a center point and radius), square (requires two coordinate points defining the top-left and bottom-right corners) and polygon (requires at least three coordinate points). Unlike the closest action, the results will not be returned in any particular order based on distance.
search The search action is used as a more general query method and expects the query to be defined with the custom query for the request. Unlike the closest action, results will not be returned in any particular order.

Supported Parameters

The following parameters are options unless otherwise noted:

p p=:place Defines the location to query data for. Refer to the list of supported place value formats.
limit limit=:total The total number of results to return as an integer. Each endpoint may have a set maximum for this value depending on usage.

The default limit is 1 if not specified.
radius radius=:distance:unit When requesting the closest results within a circle, the radius determines how far from the specified location to search. A valid unit value must be included in your radius value, e.g., "5mi", "10km", "50miles". If no unit is provided, your value is assumed to be in meters by default.

The default radius is 25 miles if not specified.
filter filter=:string Predefined filters for limiting the results. The filter value can be a single, comma-delimited or a semicolon delimited string of filter names.
query query=:string Used to filter results based on certain fields in the data set. See Advanced Queries for more details.
sort sort=:string Used to sort results based on certain fields in the data set. See Sorting for more details.
skip skip=:number Used to skip over a specific number of results in the data set.
from from=:string Returns the results starting form the value specified.

Supports a UNIX timestamp a specific date string, or a string supported by the PHP strtotime() function.

Examples:
from=tomorrow
from=friday
from=1302883980
from=7/10/2011
from=2011/07/10
from=+2hours
to to=:string Returns the results between now* and the value specified. When used in conjunction with the from parameter, the value of to will be relative to the value of from, not relative to the current time.

Supports a UNIX timestamp a specific date string, or a string supported by the PHP strtotime() function.

Examples:
to=+6hours
to=+5days
to=1302883980
to=7/10/2011
to=2011/07/10
plimit plimit=:total Applied only on the periods property, the total number of periods to return as an integer. This parameter has a normal default of one (1).
psort psort=:string Applied only on the periods property, used to sort results based on certain fields contained within the periods.
pskip pskip=:number Applied only on the periods property, used to skip over a specific number of periods in the data set.
callback callback=:functionName Used with JSONP implementation.

Defines the callback function to use for the response. The response will be enclosed as C(response), where C is the callback function provided.

Supported Filters

The following filters can be passed to the filter parameter to reduce the results that are returned:

highlow (default) Returns only high and low tidal information.
high Returns only the high tide information.
low Returns only the low tide information.

Supported Query Properties

Use the following supported property keys when creating custom queries for your requests:

id Query tides for a specific tidal location.
state Query tides for a specific state using the 2-letter state abbreviation (lowercase).
country Query tides for a specific country using the 2-letter country abbreviation (lowercase).
type Query tides based on tide type.
height Query tides based on the tide height in feet.
heightM Query tides based on the tide height in meters.

Sortable Fields

You can use the following fields to sort the data returned in your response:

id Sort by the location ID.
name Sort by the location name.
state Sort by the 2-letter state abbreviation.
country Sort by the 2-letter country abbreviation.
dt Sort tides based on the date/time of the tide.
type Sort tides based on tide type.
height Sort tides based on the tide height.

Examples

Return today's predicted tides for the closest tide location to Miami, FL.
/tides/miami,fl

Return the next week of predicted tides for the closest tide location to Miami, FL.
/tides/miami,fl?to=+1week

Return the today's predicted tides for tide location with id '8723165'.
/tides/8723165

Return today's predicted tides for the 5 closest tide locations to Miami, Fl.
/tides/closest?p=miami,fl&limit=5

Return the next predicted tide today, for the 5 closest tide locations to Miami, Fl. Here, plimit=1 limits the tides in the periods section of each station object.
/tides/closest?p=miami,fl&limit=5&plimit=1

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.


{
  "id": "8723165",
  "loc": {
    "long": -80.185,
    "lat": 25.7783
  },
  "place": {
    "name": "miami miamarina, biscayne bay",
    "state": "fl",
    "country": "us"
  },
  "periods": [
    {
      "timestamp": 1333874820,
      "dateTimeISO": "2012-04-08T04:47:00-04:00",
      "type": "l",
      "heightFT": -0.3,
      "heightM": -0.09
    },
    {
      "timestamp": 1333896600,
      "dateTimeISO": "2012-04-08T10:50:00-04:00",
      "type": "h",
      "heightFT": 2.6,
      "heightM": 0.79
    },
    {
      "timestamp": 1333919280,
      "dateTimeISO": "2012-04-08T17:08:00-04:00",
      "type": "l",
      "heightFT": -0.7,
      "heightM": -0.21
    },
    {
      "timestamp": 1333942080,
      "dateTimeISO": "2012-04-08T23:28:00-04:00",
      "type": "h",
      "heightFT": 2.8,
      "heightM": 0.85
    }
  ],
  "profile": {
    "tz": "America/New_York"
  },
  "relative": {
    "lat": 25.77427,
    "long": -80.19366,
    "bearing": 63,
    "bearingENG": "ENE",
    "distanceKM": 0.976,
    "distanceMI": 0.606
  }
}
								

Response Properties

The following properties will be provided in every response object:

id (string) The station ID that the tides are based on.
periods (object) Array of objects that contain the tidal information, where each object is for a specific tidal period. (high, low etc)
periods[#].timestamp (number) UNIX timestamp for the tidal information.
periods[#].dateTimeISO (string) ISO 8601 date of the date/time of the event.
periods[#].type (string) The tide type:
- h = high
- l (lower case L) = low
periods[#].heightFT (number) The tide height in feet.
periods[#].heightM (number) The tide height in meters.
loc.long (number) The longitude coordinate of the record.
loc.lat (number) The latitude coordinate of the record.
place.name (string) The place or nearest place to the record.
place.state (string) The state abbreviation in which the record is located. This may be null depending on the country.
place.country (string) The country abbreviation in which the record is located.
profile.tz (string) The timezone name association with the record's location.
relativeTo.lat (number) Latitude coordinate of the location used for the request. This may be different than the record's loc.lat value if there was no record exactly at the request location.
relativeTo.long (number) Longitude coordinate of the location used for the request. This may be different than the record's loc.long value if there was no record exactly at the request location.
relativeTo.bearing (number) Bearing in degrees of the record's location relative to the location used for the request.
relativeTo.bearingEng (string) Cardinal direction of the record relative to the location used for the request.
relativeTo.distanceKM (number) Distance, in kilometers, from the requested location to the record's actual location.
relativeTo.distanceMI (number) Distance, in miles, from the requested location to the record's actual location.