Hyperlocal weather data - precipitation, temperature, wind, soil moisture and more
Read your credentials from ~/.gooseworks/credentials.json:
export GOOSEWORKS_API_KEY=$(python3 -c "import json;print(json.load(open('$HOME/.gooseworks/credentials.json'))['api_key'])")
export GOOSEWORKS_API_BASE=$(python3 -c "import json;print(json.load(open('$HOME/.gooseworks/credentials.json')).get('api_base','https://api.gooseworks.ai'))")
If ~/.gooseworks/credentials.json does not exist, tell the user to run: npx gooseworks login
All endpoints use Bearer auth: -H "Authorization: Bearer $GOOSEWORKS_API_KEY"
Access hyperlocal weather data including precipitation, temperature, wind, soil conditions, and more.
Total precipitation in the last 48 hours for the given location(s).
Parameters:
curl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"api":"precip","path":"/api/v1/last-48","query":{"latitude":"37.7749","longitude":"-122.4194"}}'
Hourly near-surface air temperature in Celsius (°C)
Parameters:
geojson, json or csvcurl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"api":"precip","path":"/api/v1/temperature-hourly","query":{"latitude":"37.7749","longitude":"-122.4194","start":"2024-01-01","end":"2024-01-02"}}'
Hourly soil moisture percentage relative to holding capacity at 0-10cm depth
Parameters:
curl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"api":"precip","path":"/api/v1/soil-moisture-hourly","query":{"latitude":"37.7749","longitude":"-122.4194","start":"2024-01-01","end":"2024-01-02"}}'
Hourly wind direction in compass degrees (0-360)
Parameters:
geojson, json or csvcurl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"api":"precip","path":"/api/v1/wind-direction-hourly","query":{"latitude":"37.7749","longitude":"-122.4194","start":"2024-01-01","end":"2024-01-02"}}'
Returns comprehensive daily precipitation data for the given time range and location(s). Each day includes precipitation amount, type (rain/snow/mixed), probability (for forecasts), and data source. Seamlessly combines historical observations with forecast data depending on the requested time range.
Parameters:
curl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"api":"precip","path":"/api/v1/daily","query":{"latitude":"37.7749","longitude":"-122.4194","start":"2024-01-01","end":"2024-01-31"}}'
Hourly wind gust speed in meters per second (m/s)
Parameters:
geojson, json or csvcurl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"api":"precip","path":"/api/v1/wind-speed-gust-hourly","query":{"latitude":"37.7749","longitude":"-122.4194","start":"2024-01-01","end":"2024-01-02"}}'
Returns detailed information about the most recent precipitation event for the given location(s), including total amounts, precipitation type (rain/snow), timing, and how long ago it occurred.
Parameters:
curl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"api":"precip","path":"/api/v1/recent-rain","query":{"latitude":"37.7749","longitude":"-122.4194"}}'
Map tiles compatible with most web mapping or GIS tools. Software such as Mapbox, Google Maps, ArcGIS, Leaflet, OpenLayers or QGIS will require an x/y/z url eg https://api.precip.ai/api/v1/map/last-48/ImageServer/tile/{z}/{y}/{x}. See the examples for more details.
Parameters:
curl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"api":"precip","path":"/api/v1/map/precipitation/ImageServer/tile/5/12/10"}'
Hourly near-surface wind speed in meters per second (m/s)
Parameters:
geojson, json or csvcurl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"api":"precip","path":"/api/v1/wind-speed-hourly","query":{"latitude":"37.7749","longitude":"-122.4194","start":"2024-01-01","end":"2024-01-02"}}'
Hourly cloud cover fraction (0-1, where 0 is clear and 1 is overcast)
Parameters:
geojson, json or csvcurl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"api":"precip","path":"/api/v1/cloud-cover-hourly","query":{"latitude":"37.7749","longitude":"-122.4194","start":"2024-01-01","end":"2024-01-02"}}'
Hourly soil temperature data at 0-10cm depth in Celsius (°C)
Parameters:
geojson, json or csvcurl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"api":"precip","path":"/api/v1/temp-0-10cm-hourly","query":{"latitude":"37.7749","longitude":"-122.4194","start":"2024-01-01","end":"2024-01-02"}}'
Hourly specific humidity (kg/kg)
Parameters:
curl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"api":"precip","path":"/api/v1/specific-humidity-hourly","query":{"latitude":"37.7749","longitude":"-122.4194","start":"2024-01-01","end":"2024-01-02"}}'
Returns comprehensive hourly precipitation data for the given time range and location(s). Each hour includes precipitation amount, type (rain/snow/mixed), probability (for forecasts), and data source.
Parameters:
curl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"api":"precip","path":"/api/v1/hourly","query":{"latitude":"37.7749","longitude":"-122.4194","start":"2024-01-01","end":"2024-01-07"}}'
Daily soil moisture percentage relative to holding capacity at 0-10cm depth
Parameters:
curl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"api":"precip","path":"/api/v1/soil-moisture-daily","query":{"latitude":"37.7749","longitude":"-122.4194","start":"2024-01-01","end":"2024-01-31"}}'
Returns a complete, HTML page displaying comprehensive weather data for a specific location. See the examples page for more details.
Authorization headers set automatically from query parameters on this endpoint.
Parameters:
Available options:
current, event, calendar, cumulative, total, precip, table, wind, temp, soiltemp, soilmoisture, snow
When not provided, shows all widgets.
curl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"api":"precip","path":"/embed/location","query":{"lat":"37.7749","lon":"-122.4194"}}'
Hourly downward short-wave radiation flux in watts per square meter (W/m²)
Parameters:
geojson, json or csvcurl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"api":"precip","path":"/api/v1/solar-radiation-hourly","query":{"latitude":"37.7749","longitude":"-122.4194","start":"2024-01-01","end":"2024-01-02"}}'
Hourly relative humidity as a percentage (0-100%)
Parameters:
geojson, json or csvcurl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"api":"precip","path":"/api/v1/relative-humidity-hourly","query":{"latitude":"37.7749","longitude":"-122.4194","start":"2024-01-01","end":"2024-01-02"}}'
For full endpoint details and parameters:
curl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/search \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt":"precip API endpoints"}' List all endpoints
curl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/details \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"api":"precip","path":"/api/v1/last-48"}' # Get endpoint details