Skip to main content

Python client for the Beach Day API — real-time beach and surf conditions

Project description

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 1,900+ beaches across the US and Australia.

pip install beachdayapi

Quick Start

from beachdayapi import BeachDayAPI

client = BeachDayAPI("bda_your_api_key")

# Search beaches in California
beaches = client.beaches.list(state="CA")
for b in beaches["data"]:
    print(b["name"], b["state"])

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

# Get current conditions
conditions = client.beaches.conditions(372)
print(conditions["data"]["water_quality_grade"])

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

# 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

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

beachdayapi-0.1.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

beachdayapi-0.1.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file beachdayapi-0.1.0.tar.gz.

File metadata

  • Download URL: beachdayapi-0.1.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for beachdayapi-0.1.0.tar.gz
Algorithm Hash digest
SHA256 53ec2f706c2161a0db69457ba40442ac8271b4bd6b63c52502bbdefa8abd7605
MD5 064cdf5bf5e3f8cd546b2b28c81564da
BLAKE2b-256 f8c44799d17a801cc97a03b3af959e50303c63a2392faab4f01484d14c0ef930

See more details on using hashes here.

File details

Details for the file beachdayapi-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: beachdayapi-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for beachdayapi-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 93e080af65228a719923303acf43cd754a011b2ff426370417c4cef1d3d2e21a
MD5 d14a0df08238668640cb24c7356da3e8
BLAKE2b-256 a39c2655da070998b040a05f1ab5c2a6e382f3578f721f62833edb36d1f827dd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page