This application organizes data from Surfline using the pysurfline API to create a display compatible with TRMNL's framework. The app retrieves real-time surf and tide data and displays it according to the TRMNL markup specifications.
- Spot ID: To retrieve surf data, you need the unique
spotIdfor each Surfline location.
To get the spotId for a specific surf spot, follow these steps:
-
Navigate to the Surfline page for your desired spot. For example, Anchor Point: https://www.surfline.com/surf-report/anchor-point/5842041f4e65fad6a7708cfd
-
After the page loads, the URL might change, displaying additional parameters (e.g., camera ID or view mode):
- Locate the unique 24-character alphanumeric code (in this case,
5842041f4e65fad6a7708cfd), which is thespotIdfor Anchor Point.
Once you have the spotId, you can poll the Surfline API with a request like this:
https://pollingserver.com/api/surf?spotId=5842041f4e65fad6a7708cfd
The app retrieves and organizes data, displaying it using the HTML markup found in trmnl_markup.html. This markup is structured to align with the TRMNL design system and provides a clean, accessible format for surf reports.
Refer to trmnl_markup.html for the display structure, which includes:
- Tides: Current high and low tides with timestamps and height.
- Surf Report: Human-readable wave heights, wind conditions, and temperature.
To use ScrapingBee for API requests, you must set the SCRAPING_BEE_API_KEY environment variable on your server:
SCRAPING_BEE_API_KEY=your_api_key_here
ScrapingBee offers a free tier with 1,000 requests per month. This script uses 6 credits per poll request.
- pysurfline: For interacting with the Surfline API and retrieving surf data.
This app may expand to include additional features, such as automated spot selection or multiple spot comparisons.
This project is licensed under the MIT License.