{"openapi":"3.1.0","info":{"title":"Berghain Klubnacht Database API","version":"1.0.0","description":"Complete database of DJ performances at Berlin's Berghain and Panorama Bar since 2009. Most endpoints are free. Bulk exports require x402 micropayment (USDC on Solana).","contact":{"url":"https://berghain.ravers.workers.dev"},"license":{"name":"x402 Paid Access","url":"https://x402.org"},"x-x402-discovery":"https://berghain.ravers.workers.dev/.well-known/x402"},"servers":[{"url":"https://berghain.ravers.workers.dev","description":"Production"}],"paths":{"/api/stats":{"get":{"summary":"Overall database statistics (free)","tags":["Statistics"],"responses":{"200":{"description":"Database statistics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Stats"}}}}}}},"/api/stats/monthly":{"get":{"summary":"Monthly performance statistics (free)","tags":["Statistics"],"responses":{"200":{"description":"Monthly statistics array","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MonthlyStats"}}}}}}}},"/api/artists":{"get":{"summary":"Search and list artists (free)","tags":["Artists"],"parameters":[{"name":"search","in":"query","schema":{"type":"string"},"description":"Search artists by name"},{"name":"page","in":"query","schema":{"type":"integer","default":1}},{"name":"limit","in":"query","schema":{"type":"integer","default":20}}],"responses":{"200":{"description":"List of artists","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Artist"}}}}}}}},"/api/artists/{artistId}":{"get":{"summary":"Get artist by ID (free)","tags":["Artists"],"parameters":[{"name":"artistId","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Artist details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Artist"}}}},"404":{"description":"Artist not found"}}}},"/api/artists/{artistId}/stats":{"get":{"summary":"Artist statistics (free)","tags":["Artists"],"parameters":[{"name":"artistId","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Artist statistics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArtistStats"}}}},"404":{"description":"Artist not found"}}}},"/api/artists/{artistId}/performances":{"get":{"summary":"Full artist performance history (free)","tags":["Artists"],"parameters":[{"name":"artistId","in":"path","required":true,"schema":{"type":"integer"}},{"name":"limit","in":"query","schema":{"type":"integer"}}],"responses":{"200":{"description":"Performance list","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Performance"}}}}}}}},"/api/artists/ranking":{"get":{"summary":"All-time artist rankings (free)","tags":["Rankings"],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer"}},{"name":"offset","in":"query","schema":{"type":"integer","default":0}},{"name":"venue","in":"query","schema":{"type":"string","enum":["berghain","panorama"]}}],"responses":{"200":{"description":"Ranked artist list","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Artist"}}}}}}}},"/api/artists/ranking/year/{year}":{"get":{"summary":"Yearly artist rankings (free)","tags":["Rankings"],"parameters":[{"name":"year","in":"path","required":true,"schema":{"type":"integer"}},{"name":"limit","in":"query","schema":{"type":"integer","default":50}},{"name":"offset","in":"query","schema":{"type":"integer","default":0}},{"name":"venue","in":"query","schema":{"type":"string","enum":["berghain","panorama"]}}],"responses":{"200":{"description":"Yearly ranked artist list","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Artist"}}}}}}}},"/api/shows":{"get":{"summary":"List events with filters (free)","tags":["Events"],"parameters":[{"name":"year","in":"query","schema":{"type":"integer"}},{"name":"month","in":"query","schema":{"type":"integer"}},{"name":"limit","in":"query","schema":{"type":"integer"}},{"name":"offset","in":"query","schema":{"type":"integer","default":0}}],"responses":{"200":{"description":"Event list","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Event"}}}}}}}},"/api/residents/current":{"get":{"summary":"Current resident DJs (free)","tags":["Residents"],"responses":{"200":{"description":"Current residents","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Resident"}}}}}}}},"/api/years":{"get":{"summary":"Available years in the database (free)","tags":["Metadata"],"responses":{"200":{"description":"Array of years","content":{"application/json":{"schema":{"type":"array","items":{"type":"integer"}}}}}}}},"/api/period":{"get":{"summary":"Database date range (free)","tags":["Metadata"],"responses":{"200":{"description":"Start and end dates","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Period"}}}}}}},"/api/export/artists":{"get":{"summary":"Bulk export all artists","tags":["Export"],"x-x402-price":"$0.10","x-x402-currency":"USDC","x-x402-network":"solana:mainnet","x-x402-description":"Bulk artist export","parameters":[{"name":"format","in":"query","schema":{"type":"string","enum":["json","csv"],"default":"json"},"description":"Response format (json or csv)"}],"responses":{"200":{"description":"All artists","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"artists":{"type":"array","items":{"$ref":"#/components/schemas/Artist"}}}}},"text/csv":{"schema":{"type":"string"}}}},"402":{"$ref":"#/components/responses/PaymentRequired"}}}},"/api/export/events":{"get":{"summary":"Bulk export all events","tags":["Export"],"x-x402-price":"$0.10","x-x402-currency":"USDC","x-x402-network":"solana:mainnet","x-x402-description":"Bulk event export","parameters":[{"name":"format","in":"query","schema":{"type":"string","enum":["json","csv"],"default":"json"},"description":"Response format (json or csv)"}],"responses":{"200":{"description":"All events","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"events":{"type":"array","items":{"$ref":"#/components/schemas/Event"}}}}},"text/csv":{"schema":{"type":"string"}}}},"402":{"$ref":"#/components/responses/PaymentRequired"}}}},"/api/export/performances":{"get":{"summary":"Bulk export all performances","tags":["Export"],"x-x402-price":"$0.10","x-x402-currency":"USDC","x-x402-network":"solana:mainnet","x-x402-description":"Bulk performance export","parameters":[{"name":"format","in":"query","schema":{"type":"string","enum":["json","csv"],"default":"json"},"description":"Response format (json or csv)"}],"responses":{"200":{"description":"All performances","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"performances":{"type":"array","items":{"$ref":"#/components/schemas/Performance"}}}}},"text/csv":{"schema":{"type":"string"}}}},"402":{"$ref":"#/components/responses/PaymentRequired"}}}},"/flyers/{filename}":{"get":{"summary":"Historical Berghain event flyer (PDF)","tags":["Flyers"],"x-x402-price":"$0.01","x-x402-currency":"USDC","x-x402-network":"solana:mainnet","x-x402-description":"Historical event flyer PDF","parameters":[{"name":"filename","in":"path","required":true,"schema":{"type":"string"},"description":"Flyer filename (e.g. berghain-flyer-2009-04.pdf)"}],"responses":{"200":{"description":"PDF file","content":{"application/pdf":{}}},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"description":"Flyer not found"}}}},"/api/public/crawl-summary":{"get":{"summary":"AI crawler statistics (free, public)","tags":["Transparency"],"parameters":[{"name":"days","in":"query","schema":{"type":"integer","default":30,"maximum":90}}],"responses":{"200":{"description":"Crawl statistics summary","content":{"application/json":{}}}}}}},"components":{"schemas":{"Artist":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"total_performances":{"type":"integer"},"berghain_performances":{"type":"integer"},"panorama_performances":{"type":"integer"}}},"ArtistStats":{"type":"object","properties":{"name":{"type":"string"},"total_performances":{"type":"integer"},"berghain_performances":{"type":"integer"},"panorama_performances":{"type":"integer"},"first_performance":{"type":"string","format":"date"},"last_performance":{"type":"string","format":"date"},"active_years":{"type":"integer"},"recent_performances_2years":{"type":"integer"}}},"Event":{"type":"object","properties":{"id":{"type":"integer"},"event_id":{"type":"string"},"title":{"type":"string"},"date":{"type":"string"},"iso_date":{"type":"string","format":"date"},"year":{"type":"integer"},"month":{"type":"integer"},"total_artists":{"type":"integer"}}},"Performance":{"type":"object","properties":{"event_id":{"type":"string"},"title":{"type":"string"},"date":{"type":"string"},"iso_date":{"type":"string","format":"date"},"venue":{"type":"string","enum":["Berghain","Panorama Bar"]},"artist_name":{"type":"string"}}},"Stats":{"type":"object","properties":{"total_artists":{"type":"integer"},"total_events":{"type":"integer"},"total_performances":{"type":"integer"},"venue_breakdown":{"type":"array","items":{"type":"object","properties":{"venue":{"type":"string"},"count":{"type":"integer"}}}}}},"MonthlyStats":{"type":"object","properties":{"month":{"type":"integer"},"event_count":{"type":"integer"},"total_artists":{"type":"integer"},"avg_artists_per_event":{"type":"number"}}},"Period":{"type":"object","properties":{"start_date":{"type":"string","format":"date"},"end_date":{"type":"string","format":"date"}}},"Resident":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"total_performances_3y":{"type":"integer"},"recent_performances_1y":{"type":"integer"},"last_performance":{"type":"string","format":"date"},"total_performances":{"type":"integer"},"berghain_performances":{"type":"integer"},"panorama_performances":{"type":"integer"}}}},"responses":{"PaymentRequired":{"description":"Payment required via x402 protocol. The response includes payment instructions in the body and Accept-Payment headers.","headers":{"Accept-Payment":{"schema":{"type":"string"},"description":"Payment protocol identifier (x402)"},"X-Payment-Price":{"schema":{"type":"string"},"description":"Price for this endpoint"},"X-Payment-Currency":{"schema":{"type":"string"},"description":"Payment currency (USDC)"},"X-Payment-Network":{"schema":{"type":"string"},"description":"Blockchain network (solana:mainnet)"},"X-Payment-Info":{"schema":{"type":"string"},"description":"URL for payment discovery"}}}}}}