{"openapi":"3.1.0","info":{"title":"Baron Begier Agent API","version":"1.0.0","description":"Read-only query API over Baron Begier's public photo-location timeline (favorites or captioned photos only — a curated subset). local_date fields and all date filters are America/Los_Angeles calendar days even for photos taken abroad; taken_at/timestamp_ms are true UTC instants. place is a reverse-geocoded City, REGION string and may be null. Human docs: https://api.baronbegier.com/llms.txt"},"servers":[{"url":"https://api.baronbegier.com"}],"security":[{"bearerAuth":[]},{"apiKeyHeader":[]},{"apiKeyQuery":[]}],"tags":[{"name":"aggregates","description":"Where was Baron on which dates"},{"name":"photos","description":"Individual photos"},{"name":"discovery","description":"Public, unauthenticated"}],"paths":{"/stats":{"get":{"operationId":"getStats","tags":["aggregates"],"summary":"Dataset totals and span — call this first","responses":{"200":{"description":"Overview","content":{"application/json":{"example":{"ok":true,"data":{"total_photos":9421,"favorites":1234,"with_gps":8410,"with_place":8250,"no_place":1171,"distinct_places":214,"distinct_days":1876,"first":{"local_date":"2014-06-01","taken_at":"2014-06-01T18:04:11.000Z"},"last":{"local_date":"2026-07-30","taken_at":"2026-07-31T02:15:40.000Z"},"by_year":[{"year":2026,"photo_count":812,"day_count":141}],"top_places":[{"place":"San Francisco, CA","photo_count":3120}],"generated_at":"2026-08-02T17:00:00.000Z"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/days":{"get":{"operationId":"listDays","tags":["aggregates"],"summary":"Per-day summaries (core endpoint)","parameters":[{"name":"from","in":"query","schema":{"type":"string","format":"date"},"description":"Inclusive start local_date (America/Los_Angeles). Family: from/to."},{"name":"to","in":"query","schema":{"type":"string","format":"date"},"description":"Inclusive end local_date. Family: from/to."},{"name":"month","in":"query","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"description":"Local month YYYY-MM. Family: month."},{"name":"year","in":"query","schema":{"type":"integer","minimum":1900,"maximum":2100},"description":"Local year. Family: year. Use at most one date family per request."},{"name":"place","in":"query","schema":{"type":"string","maxLength":100},"description":"Case-insensitive substring match on place."},{"name":"q","in":"query","schema":{"type":"string","maxLength":200},"description":"Case-insensitive substring across caption OR place."},{"name":"favorite","in":"query","schema":{"type":"boolean"},"description":"Filter on the favorite flag."},{"name":"has_gps","in":"query","schema":{"type":"boolean"},"description":"true: both coordinates present; false: either missing."},{"name":"sort","in":"query","schema":{"type":"string","enum":["newest","oldest"],"default":"newest"},"description":"Date order."},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":1000,"default":100},"description":"Days per page."},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Opaque cursor from meta.next_cursor. Do not construct."}],"responses":{"200":{"description":"Day summaries","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/DaySummary"}},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["ok","data","meta"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/days/{date}":{"get":{"operationId":"getDay","tags":["aggregates"],"summary":"One day: summary + all photos (chronological)","parameters":[{"name":"date","in":"path","required":true,"schema":{"type":"string","format":"date"}},{"name":"fields","in":"query","schema":{"type":"string"},"description":"Comma-separated subset of sha256,taken_at,timestamp_ms,local_date,place,latitude,longitude,caption,favorite,image,page_url. sha256 is always included."}],"responses":{"200":{"description":"Day detail","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"type":"object","properties":{"summary":{"$ref":"#/components/schemas/DaySummary"},"photos":{"type":"array","items":{"$ref":"#/components/schemas/Photo"}}}}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/trips":{"get":{"operationId":"listTrips","tags":["aggregates"],"summary":"Consecutive-day runs by dominant place","parameters":[{"name":"from","in":"query","schema":{"type":"string","format":"date"},"description":"Inclusive start local_date (America/Los_Angeles). Family: from/to."},{"name":"to","in":"query","schema":{"type":"string","format":"date"},"description":"Inclusive end local_date. Family: from/to."},{"name":"month","in":"query","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"description":"Local month YYYY-MM. Family: month."},{"name":"year","in":"query","schema":{"type":"integer","minimum":1900,"maximum":2100},"description":"Local year. Family: year. Use at most one date family per request."},{"name":"max_gap_days","in":"query","schema":{"type":"integer","minimum":0,"maximum":7,"default":1},"description":"Photo-less calendar days allowed inside a run."},{"name":"min_days","in":"query","schema":{"type":"integer","minimum":1,"maximum":365,"default":1},"description":"Drop runs whose calendar span is shorter."},{"name":"sort","in":"query","schema":{"type":"string","enum":["newest","oldest"],"default":"newest"},"description":"By start_date."},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":500,"default":50},"description":"Max runs returned."}],"responses":{"200":{"description":"Trips","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/Trip"}},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["ok","data","meta"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/photos":{"get":{"operationId":"listPhotos","tags":["photos"],"summary":"Search photos with rich filters","parameters":[{"name":"date","in":"query","schema":{"type":"string","format":"date"},"description":"Exact local_date. Family: date."},{"name":"from","in":"query","schema":{"type":"string","format":"date"},"description":"Inclusive start local_date (America/Los_Angeles). Family: from/to."},{"name":"to","in":"query","schema":{"type":"string","format":"date"},"description":"Inclusive end local_date. Family: from/to."},{"name":"month","in":"query","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"description":"Local month YYYY-MM. Family: month."},{"name":"year","in":"query","schema":{"type":"integer","minimum":1900,"maximum":2100},"description":"Local year. Family: year. Use at most one date family per request."},{"name":"place","in":"query","schema":{"type":"string","maxLength":100},"description":"Case-insensitive substring match on place."},{"name":"q","in":"query","schema":{"type":"string","maxLength":200},"description":"Case-insensitive substring across caption OR place."},{"name":"favorite","in":"query","schema":{"type":"boolean"},"description":"Filter on the favorite flag."},{"name":"has_gps","in":"query","schema":{"type":"boolean"},"description":"true: both coordinates present; false: either missing."},{"name":"near","in":"query","schema":{"type":"string"},"description":"lat,lng — adds distance_km per photo; meta.total is not computed."},{"name":"radius_km","in":"query","schema":{"type":"number","minimum":0.05,"maximum":1000,"default":25},"description":"Only with near."},{"name":"sort","in":"query","schema":{"type":"string","enum":["newest","oldest","distance"],"default":"newest"},"description":"distance requires near and is not paginated."},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"description":"Photos per page."},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Opaque cursor from meta.next_cursor. Do not construct."},{"name":"fields","in":"query","schema":{"type":"string"},"description":"Comma-separated subset of sha256,taken_at,timestamp_ms,local_date,place,latitude,longitude,caption,favorite,image,page_url. sha256 is always included."},{"name":"format","in":"query","schema":{"type":"string","enum":["json","geojson"],"default":"json"},"description":"geojson: FeatureCollection of GPS photos; meta carries excluded_no_gps."}],"responses":{"200":{"description":"Photos","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/Photo"}},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["ok","data","meta"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/photos/{sha256}":{"get":{"operationId":"getPhoto","tags":["photos"],"summary":"One photo","parameters":[{"name":"sha256","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Photo id; doubles as the Cloudflare Images id."}},{"name":"fields","in":"query","schema":{"type":"string"},"description":"Comma-separated subset of sha256,taken_at,timestamp_ms,local_date,place,latitude,longitude,caption,favorite,image,page_url. sha256 is always included."}],"responses":{"200":{"description":"Photo","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/Photo"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/places":{"get":{"operationId":"listPlaces","tags":["aggregates"],"summary":"Per-place aggregates","parameters":[{"name":"q","in":"query","schema":{"type":"string","maxLength":100},"description":"Substring filter on place names."},{"name":"from","in":"query","schema":{"type":"string","format":"date"},"description":"Inclusive start local_date (America/Los_Angeles). Family: from/to."},{"name":"to","in":"query","schema":{"type":"string","format":"date"},"description":"Inclusive end local_date. Family: from/to."},{"name":"month","in":"query","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"description":"Local month YYYY-MM. Family: month."},{"name":"year","in":"query","schema":{"type":"integer","minimum":1900,"maximum":2100},"description":"Local year. Family: year. Use at most one date family per request."},{"name":"sort","in":"query","schema":{"type":"string","enum":["photos","recent","first","name"],"default":"photos"},"description":"Order."},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":500,"default":100},"description":"Places per page."},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"maximum":10000,"default":0},"description":"Offset paging (no cursor here)."},{"name":"format","in":"query","schema":{"type":"string","enum":["json","geojson"],"default":"json"},"description":"geojson: Point features at centroids."}],"responses":{"200":{"description":"Places","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/Place"}},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["ok","data","meta"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/calendar":{"get":{"operationId":"getCalendar","tags":["aggregates"],"summary":"Photo density per month or day","parameters":[{"name":"granularity","in":"query","schema":{"type":"string","enum":["month","day"],"default":"month"},"description":"day requires year, month, or from+to spanning <=366 days."},{"name":"from","in":"query","schema":{"type":"string","format":"date"},"description":"Inclusive start local_date (America/Los_Angeles). Family: from/to."},{"name":"to","in":"query","schema":{"type":"string","format":"date"},"description":"Inclusive end local_date. Family: from/to."},{"name":"month","in":"query","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"description":"Local month YYYY-MM. Family: month."},{"name":"year","in":"query","schema":{"type":"integer","minimum":1900,"maximum":2100},"description":"Local year. Family: year. Use at most one date family per request."}],"responses":{"200":{"description":"Buckets, newest first; absent bucket = zero photos.","content":{"application/json":{"example":{"ok":true,"data":[{"month":"2025-11","photo_count":213,"day_count":19}],"meta":{"count":1,"total":1,"next_cursor":null,"filters":{"granularity":"month"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/":{"get":{"operationId":"getIndex","tags":["discovery"],"summary":"Self-describing API index (public)","security":[],"responses":{"200":{"description":"Index"}}}},"/health":{"get":{"operationId":"getHealth","tags":["discovery"],"summary":"Health check (public, no DB)","security":[],"responses":{"200":{"description":"OK"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"},"apiKeyHeader":{"type":"apiKey","in":"header","name":"X-API-Key"},"apiKeyQuery":{"type":"apiKey","in":"query","name":"key"}},"schemas":{"Photo":{"type":"object","description":"A public photo. local_date is the America/Los_Angeles calendar day; taken_at/timestamp_ms are the true UTC instant. Fields may be pruned by ?fields=.","properties":{"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Photo id; doubles as the Cloudflare Images id."},"taken_at":{"type":"string","format":"date-time"},"timestamp_ms":{"type":"integer"},"local_date":{"type":"string","format":"date"},"place":{"type":["string","null"],"description":"Reverse-geocoded \"City, REGION\"; null when unknown."},"latitude":{"type":["number","null"]},"longitude":{"type":["number","null"]},"caption":{"type":["string","null"]},"favorite":{"type":"boolean"},"image":{"type":"object","properties":{"thumb":{"type":"string"},"medium":{"type":"string"},"large":{"type":"string"}},"description":"Cloudflare Images URLs (https://imagedelivery.net/TgyYfXLmYx-JJG3tKWEdbw/<sha256>/<variant>). Flexible sizing: /w=<px>."},"page_url":{"type":"string"},"distance_km":{"type":"number","description":"Present only on near= queries."}},"required":["sha256"]},"DaySummary":{"type":"object","properties":{"date":{"type":"string","format":"date"},"photo_count":{"type":"integer"},"favorite_count":{"type":"integer"},"gps_photo_count":{"type":"integer"},"places":{"type":"array","items":{"type":"string"},"description":"Distinct places that day, most-photographed first."},"primary_place":{"type":["string","null"]},"first_photo_at":{"type":"string","format":"date-time"},"last_photo_at":{"type":"string","format":"date-time"},"centroid":{"type":["object","null"],"properties":{"latitude":{"type":"number"},"longitude":{"type":"number"}},"description":"Mean position of the GPS photos in this group; null when none have GPS."},"cover_sha256":{"type":["string","null"]}}},"Place":{"type":"object","properties":{"place":{"type":"string"},"photo_count":{"type":"integer"},"day_count":{"type":"integer"},"first_seen":{"type":"string","format":"date"},"last_seen":{"type":"string","format":"date"},"centroid":{"type":["object","null"],"properties":{"latitude":{"type":"number"},"longitude":{"type":"number"}},"description":"Mean position of the GPS photos in this group; null when none have GPS."},"cover_sha256":{"type":["string","null"]}}},"Trip":{"type":"object","description":"A maximal run of consecutive photo-days sharing one dominant place. Null-place days inherit the run's place; multi-city trips appear as adjacent runs.","properties":{"place":{"type":["string","null"]},"start_date":{"type":"string","format":"date"},"end_date":{"type":"string","format":"date"},"days":{"type":"integer","description":"Calendar span, inclusive."},"photo_days":{"type":"integer","description":"Days in the span with at least one photo."},"photo_count":{"type":"integer"},"other_places":{"type":"array","items":{"type":"string"}},"centroid":{"type":["object","null"],"properties":{"latitude":{"type":"number"},"longitude":{"type":"number"}},"description":"Mean position of the GPS photos in this group; null when none have GPS."},"cover_sha256":{"type":["string","null"]}}},"Meta":{"type":"object","description":"List metadata. next_cursor is opaque; null means the list is exhausted.","properties":{"count":{"type":"integer"},"total":{"type":["integer","null"],"description":"Total matching items ignoring pagination; null for near queries."},"limit":{"type":"integer"},"sort":{"type":"string"},"next_cursor":{"type":["string","null"]},"filters":{"type":"object"},"warnings":{"type":"array","items":{"type":"string"}}}},"Error":{"type":"object","properties":{"ok":{"const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_param","invalid_cursor","unauthorized","not_found","method_not_allowed","internal"]},"message":{"type":"string"},"param":{"type":"string"},"docs":{"type":"string"}},"required":["code","message"]}},"required":["ok","error"]}},"responses":{"BadRequest":{"description":"Malformed parameter or cursor (error.code: invalid_param | invalid_cursor).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"Missing or invalid API key. Accepted: Authorization: Bearer, X-API-Key header, ?key= query.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"No such resource (or it is not publicly visible).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Internal":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}