Real weather for 50 San Francisco neighborhoods. Free API. No key required.
π Live API: microclimates.solofounders.com
Example website: view weather in all regions of San Francisco
Use with Claude Code, Clawdbot, or build into your apps.
Built by Solo Founders.
SF has the most dramatic microclimates of any US city.
Weather apps say "San Francisco: 58Β°F" β but that's useless. It can be 52Β°F and foggy in the Outer Sunset while it's 65Β°F and sunny in the Mission, just 3 miles apart.
This API aggregates 150+ outdoor sensors and groups them by neighborhood, so you get actual local temperatures β not some airport reading from SFO.
curl https://microclimates.solofounders.com/sf-weather/mission{
"neighborhood": "mission",
"name": "Mission District",
"temp_f": 58,
"humidity": 52,
"pm2_5": 12.1,
"aqi": 50,
"aqi_category": "Good",
"sensor_count": 8
}No API key. No signup. Just use it.
Copy and paste this into your skills folder:
# Create a new skill: sf-microclimates/SKILL.md
# SF Microclimates Skill
Get real-time SF neighborhood weather.
## Triggers
- "weather in [neighborhood]"
- "sf weather mission vs sunset"
- "is it foggy in the richmond?"
## Usage
curl https://microclimates.solofounders.com/sf-weather/marina
## Neighborhoods
mission, castro, marina, soma, haight, noe_valley,
outer_sunset, inner_sunset, outer_richmond, presidio,
north_beach, pacific_heights, potrero, twin_peaks...- AI agents β Give your agent real local weather context
- Home automation β Trigger based on your actual neighborhood temp
- Slack/Discord bots β Settle "is it foggy?" arguments
- Travel apps β Show tourists what to actually expect
- Personal dashboards β Finally, weather that matches your window
| Endpoint | Description |
|---|---|
GET /sf-weather |
All 50 neighborhoods |
GET /sf-weather/:neighborhood |
Single neighborhood |
GET /neighborhoods |
List all available |
From Marina to Noe Valley, Presidio to Twin Peaks β every SF neighborhood mapped.
curl https://microclimates.solofounders.com/neighborhoodsIncludes: mission, castro, marina, soma, haight, noe_valley, outer_sunset, inner_richmond, north_beach, pacific_heights, potrero, dogpatch, bayview, twin_peaks, presidio, tenderloin, chinatown, japantown, cole_valley, glen_park, and 30 more.
{
"updated": "2026-01-25T23:00:00.000Z",
"neighborhood": "outer_sunset",
"name": "Outer Sunset",
"temp_f": 52,
"humidity": 78,
"pm2_5": 8.3,
"aqi": 35,
"aqi_category": "Good",
"sensor_count": 15
}{
"updated": "2026-01-25T23:00:00.000Z",
"neighborhoods": {
"mission": { "temp_f": 58, "humidity": 52, "pm2_5": 12.1, "aqi": 50, "aqi_category": "Good", "sensor_count": 8 },
"outer_sunset": { "temp_f": 52, "humidity": 78, "pm2_5": 8.3, "aqi": 35, "aqi_category": "Good", "sensor_count": 15 },
"marina": { "temp_f": 55, "humidity": 65, "pm2_5": 18.5, "aqi": 64, "aqi_category": "Moderate", "sensor_count": 6 }
}
}Each response includes real-time air quality data from PurpleAir sensors.
| Field | Description |
|---|---|
pm2_5 |
PM2.5 concentration in Β΅g/mΒ³ (10-minute rolling average) |
aqi |
Air Quality Index (0-500 scale) |
aqi_category |
Human-readable AQI category |
| AQI Range | Category | Description |
|---|---|---|
| 0β50 | Good | Air quality is satisfactory |
| 51β100 | Moderate | Acceptable; moderate health concern for sensitive individuals |
| 101β150 | Unhealthy for Sensitive Groups | Sensitive groups may experience health effects |
| 151β200 | Unhealthy | Everyone may begin to experience health effects |
| 201β300 | Very Unhealthy | Health alert; everyone may experience serious effects |
| 301+ | Hazardous | Health emergency; entire population affected |
AQI is calculated from PM2.5 using the US EPA formula:
- The
pm2.5_10minutefield (10-minute rolling average) is used for real-time responsiveness - PM2.5 concentration is mapped to AQI breakpoints per EPA standards
- Linear interpolation determines the final AQI value
This gives you accurate, hyperlocal air quality β not a city-wide average from a distant monitoring station.
Want to run your own instance?
git clone https://github.com/solo-founders/sf-microclimates.git
cd sf-microclimates
npm installThis API uses PurpleAir sensors. Sign up at develop.purpleair.com β free for personal use.
wrangler kv:namespace create "CACHE"Add the output to wrangler.toml:
[[kv_namespaces]]
binding = "CACHE"
id = "your-kv-namespace-id"wrangler secret put PURPLEAIR_API_KEYwrangler deployecho "PURPLEAIR_API_KEY=your-key" > .dev.vars
wrangler dev| Variable | Default | Description |
|---|---|---|
CACHE_TTL_SECONDS |
3600 |
Cache duration (1 hour) |
RATE_LIMIT_PER_MINUTE |
60 |
Max requests per IP |
- Request comes in β rate limit check
- Check Cloudflare KV cache β return if fresh
- Cache miss β fetch outdoor sensors from PurpleAir (
location_type=0) - Group sensors by neighborhood GPS bounding boxes
- Calculate averages, cache for 1 hour
- Return JSON with CORS headers
LA, Seattle, NYC, Chicago, Austin β every city has microclimates.
The neighborhood bounding boxes are in src/index.ts. To adapt:
- Update
SF_NEIGHBORHOODSwith your city's areas + GPS coordinates - Change the PurpleAir bounding box to your city
- Update branding
- Deploy
PRs welcome! We'd love to see la-microclimates, nyc-microclimates, etc.
- Sensor data: PurpleAir
- Infrastructure: Cloudflare Workers
- Built by: Solo Founders
MIT β use it however you want.