Marine Weather API - Ocean & Coastal Weather Data
Get accurate marine weather data for any location, coordinates, or IP with APIFreaks’ Marine Weather API. The API provides real-time ocean and wind conditions - including wave height, wind speed and direction, swell, and other marine parameters - and offers daily, hourly, or minutely forecast precision for up to 16 days ahead.
By default, the API returns current marine conditions, and when a date range is specified, it switches to forecast mode with flexible precision to meet your application needs.
Ideal for marine navigation, offshore operations, fishing applications, and wave monitoring tools, the Marine Weather API delivers reliable and up-to-date marine intelligence through a simple REST endpoint.
Features
Comprehensive Marine Conditions
Retrieve global ocean and wave data, including height, direction, swell, and sea-surface parameters - ideal for marine research and coastal monitoring.
Real-Time & Forecast Precision
Choose between real-time readings or forecast data up to 16 days ahead, with full daily, hourly, and minutely granularity.
Flexible Input Methods
Query by location, coordinates, or IP address. If no parameters are given, the API automatically detects and returns data for the requesting device’s IP location.
Detailed Location Context
Each response includes complete geographic context with continent, country, state/province, district, city, locality, postal code, precise coordinates, elevation data, and timezone information.
API Endpoint
How to Guides
Get Real-Time Marine Conditions by Location, Coordinates, or IP
To fetch the current marine weather data, simply call the endpoint with a location name, coordinates, or IP address.
Example using Location
Use the location parameter to look up Marine Weather by any location - city name, address etc.
curl -X 'GET' 'https://api.apifreaks.com/v1.0/weather/marine?location=Lisbon,Portugal&apiKey=API-KEY'
# Response
{
"location": {
"location_string": "Lisbon,Portugal",
"country_name": "Portugal",
"state_prov": "",
"city": "Lisbon",
"locality": "",
"latitude": "38.70775",
"longitude": "-9.13659",
"elevation": "7",
"timezone": "Europe/Lisbon",
"timezone_abbreviation": "GMT"
},
"current": {
"timestamp": "2025-11-10T16:30",
"wave_height": 3.28,
"wave_direction": 293,
"wave_period": 13.4,
"wind_wave_peak_period": 1.5,
"wind_wave_height": 0.02,
"wind_wave_direction": 237,
"wind_wave_period": 0.3,
"swell_wave_height": 3.28,
"swell_wave_direction": 293,
"swell_wave_period": 11.2,
"swell_wave_peak_period": 1.5,
"sea_level_height_msl": 0.26,
"sea_surface_temperature": 17.9,
"ocean_current_velocity": 0.5,
"ocean_current_direction": 90
Example using Coordinates
Use the lat and long parameters to retrieve Marine Weather for any point on Earth.
curl -X 'GET' 'https://api.apifreaks.com/v1.0/weather/marine?lat=36.7783&long=-119.4179&apiKey=API-KEY'
# Response
{
"location": {
"latitude": "36.77830",
"longitude": "-119.41790",
"country_name": "",
"state_prov": "California",
"city": "Gravesboro",
"locality": "",
"elevation": "147",
"timezone": "America/Los_Angeles",
"timezone_abbreviation": "GMT-8"
},
"current": {
"timestamp": "2025-11-10T08:30",
"wave_height": null,
"wave_direction": null,
"wave_period": null,
"wind_wave_peak_period": null,
"wind_wave_height": null,
"wind_wave_direction": null,
"wind_wave_period": null,
"swell_wave_height": null,
"swell_wave_direction": null,
"swell_wave_period": null,
"swell_wave_peak_period": null,
"sea_level_height_msl": null,
"sea_surface_temperature": null,
"ocean_current_velocity": null,
"ocean_current_direction": null
}
Example using IP
Use the ip parameter to display Marine Weather information at specific network locations.
curl -X 'GET' https://api.apifreaks.com/v1.0/weather/marine?ip=8.8.8.8&apiKey=API-KEY'
# Response
{
"location": {
"continent_code": "NA",
"continent_name": "North America",
"country_code2": "US",
"country_code3": "USA",
"country_name": "United States",
"country_name_official": "United States of America",
"is_eu": false,
"state_prov": "California",
"state_code": "US-CA",
"district": "Santa Clara",
"city": "Mountain View",
"zipcode": "94043-1351",
"latitude": "37.42240",
"longitude": "-122.08421",
"locality": "Charleston Terrace",
"elevation": "3",
"timezone": "America/Los_Angeles",
"timezone_abbreviation": "GMT-8"
},
"current": {
"timestamp": "2025-11-10T08:30",
"wave_height": null,
"wave_direction": null,
"wave_period": null,
"wind_wave_peak_period": null,
"wind_wave_height": null,
"wind_wave_direction": null,
"wind_wave_period": null,
Auto-detect requesting users' IP address
If no location parameters are provided, the API defaults to return real-time marine weather data for the user’s detected IP.
curl -X 'GET' 'https://api.apifreaks.com/v1.0/weather/marine?apiKey=API-KEY'
# Response
{
"location": {
"continent_code": "AS",
"continent_name": "Asia",
"country_code2": "PK",
"country_code3": "PAK",
"country_name": "Pakistan",
"country_name_official": "Islamic Republic of Pakistan",
"is_eu": false,
"state_prov": "Punjab",
"state_code": "PK-PB",
"district": "Lahore",
"city": "Lahore",
"zipcode": "54000",
"latitude": "31.52037",
"longitude": "74.35875",
"locality": "Gulberg",
"elevation": "",
"timezone": "Asia/Karachi",
"timezone_abbreviation": "GMT+5"
},
"current": {
"timestamp": "2025-11-10T21:30",
"wave_height": null,
"wave_direction": null,
"wave_period": null,
"wind_wave_peak_period": null,
"wind_wave_height": null,
"wind_wave_direction": null,
"wind_wave_period": null,
Fetch Marine Forecast Data by Date Range
To access forecast marine data, include startDate and endDate in your request. The API supports marine weather forecasts for a maximum range of 16 days.
To get marine forecasts for a specific area, include the location, startDate, and endDate in your request.
curl -s -X GET "https://api.apifreaks.com/v1.0/weather/marine?location=Tokyo,Japan&startDate=2025-11-10&endDate=2025-11-11&apiKey=API-KEY"'
# Response
{
"location": {
"location_string": "Tokyo,Japan",
"country_name": "Japan",
"state_prov": "",
"city": "Tokyo",
"locality": "",
"latitude": "35.68219",
"longitude": "139.76222",
"elevation": "0",
"timezone": "Asia/Tokyo",
"timezone_abbreviation": "GMT+9"
},
"forecast": {
"2025-11-10": {
"daily": {
"timestamp": "2025-11-10",
"wave_height_max": 0.58,
"wave_direction_dominant": 204,
"wave_period_max": 7.95,
"wind_wave_height_max": 0.4,
"wind_wave_direction_dominant": 350,
"wind_wave_period_max": 2.4,
"wind_wave_peak_period_max": null,
"swell_wave_height_max": 0.58,
"swell_wave_direction_dominant": 185,
"swell_wave_period_max": 6.65,
"swell_wave_peak_period_max": null
}
},
Auto-detect requesting users' IP address
If no location parameters are provided, the marine forecast data would be retrieved corresponding to the user’s detected IP.
curl -X 'GET' 'https://api.apifreaks.com/v1.0/weather/marine?startDate=2025-11-10&endDate=2025-11-11&apiKey=API-KEY'
# Response
{
"location": {
"continent_code": "AS",
"continent_name": "Asia",
"country_code2": "PK",
"country_code3": "PAK",
"country_name": "Pakistan",
"country_name_official": "Islamic Republic of Pakistan",
"is_eu": false,
"state_prov": "Punjab",
"state_code": "PK-PB",
"district": "Lahore",
"city": "Lahore",
"zipcode": "54000",
"latitude": "31.52037",
"longitude": "74.35875",
"locality": "Gulberg",
"elevation": "",
"timezone": "Asia/Karachi",
"timezone_abbreviation": "GMT+5"
},
"forecast": {
"2025-11-10": {
"daily": {
"timestamp": "2025-11-10",
"wave_height_max": null,
"wave_direction_dominant": null,
"wave_period_max": null,
"wind_wave_height_max": null,
"wind_wave_direction_dominant": null,
Control Forecast Data Precision
Control the granularity of marine forecast data using the precision parameter.
- Precision = daily: gives broader patterns (ideal for planning).
- Precision = hourly: helps track short-term shifts.
- Precision = minutely: offers ultra-fine resolution for operational forecasting.
Example of "daily" Forecast
curl -s -X GET "https://api.apifreaks.com/v1.0/weather/marine?location=Miami,USA&startDate=2025-11-10&endDate=2025-11-12&precision=daily&apiKey=API-KEY"'
# Response
{
"location": {
"location_string": "Miami,USA",
"country_name": "United States",
"state_prov": "Florida",
"city": "North Miami Beach",
"locality": "",
"latitude": "25.92697",
"longitude": "-80.18083",
"elevation": "1",
"timezone": "America/New_York",
"timezone_abbreviation": "GMT-5"
},
"forecast": {
"2025-11-10": {
"daily": {
"timestamp": "2025-11-10",
"wave_height_max": 0.7,
"wave_direction_dominant": 9,
"wave_period_max": 5.45,
"wind_wave_height_max": 0.54,
"wind_wave_direction_dominant": 330,
"wind_wave_period_max": 2.9,
"wind_wave_peak_period_max": null,
"swell_wave_height_max": 0.46,
"swell_wave_direction_dominant": 32,
"swell_wave_period_max": 5.5,
"swell_wave_peak_period_max": null
}
},
Example of "hourly" Forecast
curl -s -X GET "https://api.apifreaks.com/v1.0/weather/marine?location=MiamiUSA&startDate=2025-11-10&endDate=2025-11-11&precision=hourly&apiKey=API-KEY"
# Response
{
"location": {
"location_string": "MiamiUSA",
"country_name": "Japan",
"state_prov": "Oita Prefecture",
"city": "Usa",
"locality": "Minamiusa",
"latitude": "33.52617",
"longitude": "131.37018",
"elevation": "",
"timezone": "Asia/Tokyo",
"timezone_abbreviation": "GMT+9"
},
"forecast": {
"2025-11-10": {
"hourly": [
{
"timestamp": "2025-11-10T00:00",
"wave_height": 0.52,
"wave_direction": 320,
"wave_period": 2.95,
"wind_wave_height": 0.48,
"wind_wave_peak_period": null,
"wind_wave_direction": 320,
"wind_wave_period": 2.6,
"swell_wave_height": 0.12,
"swell_wave_direction": 284,
"swell_wave_period": 3.05,
"swell_wave_peak_period": null,
"sea_surface_temperature": 19.5,
Example of "minutely" Forecast
curl -s -X GET "https://api.apifreaks.com/v1.0/weather/marine?location=Miami,USA&startDate=2025-11-10&endDate=2025-11-12&precision=minutely&apiKey=API-KEY"
# Response
{
"location": {
"location_string": "Miami,USA",
"country_name": "United States",
"state_prov": "Florida",
"city": "North Miami Beach",
"locality": "",
"latitude": "25.92697",
"longitude": "-80.18083",
"elevation": "1",
"timezone": "America/New_York",
"timezone_abbreviation": "GMT-5"
},
"forecast": {
"2025-11-10": {
"minutely": [
{
"timestamp": "2025-11-10T00:00",
"ocean_current_velocity": 1.1,
"ocean_current_direction": 0,
"sea_level_height_msl": 0.07
},
{
"timestamp": "2025-11-10T00:15",
"ocean_current_velocity": 1.1,
"ocean_current_direction": 0,
"sea_level_height_msl": 0.05
},
{
"timestamp": "2025-11-10T00:30",
Pricing
To use the Marine Weather, API credits are required. Charges apply only for successful queries, defined by a 2xx status code. If a request results in a 4xx or 5xx status code, no credits will be deducted, and any credits already charged will be refunded.
For each successful request, 2 credit will be charged. Utilize the Credits Usage API to efficiently monitor your recent consumption of both one-off and subscription credits. This API provides a streamlined way to track and manage your credit usage, ensuring you stay informed about your remaining balance and can optimize your resource allocation effectively.