Skip to main content

Beach Day API — Python Client

PyPI version Python License: MIT

Python client for the Beach Day API — water quality, weather, tides, ocean conditions, beach rules, amenities, and composite scoring in a single call. Covers 36,000+ beaches across 110 countries including the US, UK, Spain, Italy, France, Croatia, Greece, Malta, Cyprus, Turkey, Portugal, Japan, Philippines, South Korea, Mexico, Costa Rica, Cuba, Dominican Republic, Puerto Rico, Jamaica, Bahamas, Panama, India, Indonesia, Norway, Sweden, Denmark, Ireland, Iceland, Albania, Montenegro, Malaysia, Sri Lanka, Taiwan, Australia, South Africa, French Polynesia, New Caledonia, Fiji, New Zealand, Cambodia, Thailand, Vietnam, China, Samoa, Tonga, Cook Islands, American Samoa, Tuvalu, Niue, Wallis and Futuna, Tokelau, Brazil, Colombia, Uruguay, Ecuador, Chile, Peru, Barbados, Maldives, all 36 African countries, and more.

pip install beachdayapi

Quick Start

from beachdayapi import BeachDayAPI

client = BeachDayAPI("bda_your_api_key")

# Search beaches by state (supports offset/limit pagination)
beaches = client.beaches.list(state="CA")
# Pagination: client.beaches.list(state="CA", offset=100, limit=50)
# Filter by country: client.beaches.list(country="Cambodia")
for b in beaches["data"]:
    print(b["name"], b["state"])

# Search beaches by name
malibu = client.beaches.list(search="Malibu")
print(f"Found {malibu['count']} beaches matching 'Malibu'")

# Get full detail for a beach
beach = client.beaches.get(372)
print(beach["data"]["name"], beach["data"]["beach_day_score"])

# Get current conditions (supports offset/limit)
conditions = client.beaches.conditions(372)
# Pagination: client.beaches.conditions(372, offset=30, limit=15)
print(conditions["data"]["water_quality_grade"])

# Get top-scored beaches (supports offset/limit)
scored = client.beaches.scored(min_score=70, limit=10)
# Pagination: client.beaches.scored(offset=50, limit=25)
for b in scored["data"]:
    print(f"{b['name']}: {b['beach_day_score']}")

# Discover available countries
countries = client.beaches.countries()
for c in countries["results"]:
    print(f"{c['country']}: {c['beach_count']} beaches")

# Health check (no API key needed)
health = client.health()
print(health)

API Key

Sign up at beachdayapi.com to get your free API key (50 free credits, no credit card). Your key starts with bda_.

You can also set the BEACHDAY_API_KEY environment variable:

import os
from beachdayapi import BeachDayAPI

client = BeachDayAPI(os.environ["BEACHDAY_API_KEY"])

Endpoints

Method Endpoint Cost Description
client.health() GET /v1/health Free API health check
client.beaches.list() GET /v1/beaches 1 credit Search beaches
client.beaches.get(id) GET /v1/beaches/{id} 5 credits Beach detail
client.beaches.conditions(id) GET /v1/beaches/{id}/conditions 3 credits Current conditions
client.beaches.scored() GET /v1/beaches/scored 10 credits Scored beaches
client.beaches.countries() GET /v1/countries 1 credit List countries with counts

Error Handling

from beachdayapi import (
    BeachDayAPI,
    AuthenticationError,
    InsufficientCreditsError,
    NotFoundError,
    RateLimitError,
    ServerError,
)

client = BeachDayAPI("bda_invalid_key")

try:
    client.beaches.list(state="CA")
except AuthenticationError:
    print("Check your API key")
except InsufficientCreditsError:
    print("Buy more credits at beachdayapi.com/credits/pricing/")
except RateLimitError:
    print("Slow down")

Requirements

  • Python 3.9+
  • Zero dependencies (stdlib only)

License

MIT — see the main Beach Day API repository.

Release files for beachdayapi 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for beachdayapi 0.1.5
File Size Uploaded
beachdayapi-0.1.5.tar.gz 5.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for beachdayapi 0.1.5
File Interpreter ABI Platform
beachdayapi-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 11.2 kB

Release files / beachdayapi-0.1.5.tar.gz

Download URL beachdayapi-0.1.5.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8a9b584d07d564a8aabbd2793682f3302e19e6ffc0acc24fcd0b1ea9c586905a
BLAKE2b-256 checksum
How to use checksums
5179288ed47469a73307e552ad33dadde131d465509cefef7084f38764bf18c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / beachdayapi-0.1.5-py3-none-any.whl

Download URL beachdayapi-0.1.5-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f86e0016f68c3023e7e6f663d6541708c5865bedda2daec5cbf1437b5099760d
BLAKE2b-256 checksum
How to use checksums
287d7342033cbdfc3ec4a016bbdb6514fb1e76a42e0f69e1dd2045b8c5e11024
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

1 release file

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page