{"openapi":"3.1.0","info":{"title":"PoliMI Rooms API","description":"Classroom schedules and room details from Politecnico di Milano. No account or API key required. Availability reflects published schedules, not live occupancy. This is an independent API, not an official PoliMI service. Each IP address may make 30 requests per minute.","version":"1.0.0"},"servers":[{"url":"https://api.daani.dev"}],"paths":{"/v1/rooms":{"get":{"tags":["Rooms"],"summary":"List room schedules for a campus and date","description":"Omit both `from` and `to` to get the full published schedule for the campus\nand date. Supply both to return only the rooms that are free for the entire\ninterval. Times use the campus local clock, not UTC, and must fall between\n08:00 and 21:00 with `to` later than `from`.","operationId":"listRooms","parameters":[{"name":"campus","in":"query","description":"Campus code.","required":true,"schema":{"type":"string","description":"MIA: Milano Città Studi, MIB: Milano Bovisa, MIF: Milano Tortona, COE: Como, CRG: Cremona, GEM: Genova, LCF: Lecco, MNI: Mantova, PCL: Piacenza, MID: Sesto Ulteriano","enum":["MIA","MIB","MIF","COE","CRG","GEM","LCF","MNI","PCL","MID"]}},{"name":"date","in":"query","description":"Calendar date in YYYY-MM-DD format.","required":true,"schema":{"type":"string","format":"date"},"example":"2026-10-14"},{"name":"from","in":"query","description":"Start time, at or after 08:00. Must be sent together with `to`.","required":false,"schema":{"type":"string","examples":["10:00"],"pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$"}},{"name":"to","in":"query","description":"End time, at or before 21:00 and later than `from`. Must be sent\ntogether with `from`.","required":false,"schema":{"type":"string","examples":["10:00"],"pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$"}}],"responses":{"200":{"description":"Rooms for the campus and date. An empty array is a successful result, not an error.","headers":{"Cache-Control":{"schema":{"type":"string"},"description":"Successful responses are cacheable for 30 seconds."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoomList"}}}},"400":{"description":"Invalid campus, date, time range, room ID, or language.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"The rate limit for the client IP address was reached.","headers":{"Retry-After":{"schema":{"type":"integer","format":"int64","minimum":0},"description":"Seconds to wait before retrying. Browsers cannot read this header across origins, so wait 60 seconds."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"The server could not retrieve or process the data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v1/rooms/{id}":{"get":{"tags":["Rooms"],"summary":"Get the details of one room","description":"Use the numeric string `id` from a room schedule, not the room name. A\nnumeric ID is syntactically valid but not guaranteed to exist.","operationId":"getRoomDetails","parameters":[{"name":"id","in":"path","description":"Room ID from a room schedule.","required":true,"schema":{"type":"string","pattern":"^[0-9]+$"},"example":"34"},{"name":"language","in":"query","required":false,"schema":{"type":"string","default":"it","enum":["it","en"]}}],"responses":{"200":{"description":"Room details.","headers":{"Cache-Control":{"schema":{"type":"string"},"description":"Successful responses are cacheable for 30 seconds."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Details"}}}},"400":{"description":"Invalid campus, date, time range, room ID, or language.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"The rate limit for the client IP address was reached.","headers":{"Retry-After":{"schema":{"type":"integer","format":"int64","minimum":0},"description":"Seconds to wait before retrying. Browsers cannot read this header across origins, so wait 60 seconds."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"The server could not retrieve or process the data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}}},"components":{"schemas":{"Details":{"type":"object","description":"Labels and values depend on the upstream content and language; do not\nassume fixed field names. Arrays and dictionaries can be empty.","required":["name","fields","access","directions","equipment","software"],"properties":{"access":{"type":"array","items":{"$ref":"#/components/schemas/Information"}},"directions":{"type":"array","items":{"$ref":"#/components/schemas/Information"}},"equipment":{"type":"array","items":{"type":"string"}},"fields":{"type":"object","description":"Source-provided labels and values.","additionalProperties":{"type":"string"},"propertyNames":{"type":"string"}},"imageUrl":{"type":"string","description":"Omitted when unavailable."},"mapUrl":{"type":"string","description":"Omitted when unavailable."},"name":{"type":"string","example":"2.1.1"},"software":{"type":"array","items":{"type":"string"}}}},"ErrorBody":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}},"Information":{"type":"object","required":["label","value"],"properties":{"label":{"type":"string"},"value":{"type":"string"}}},"Interval":{"type":"object","description":"A booked interval. The end is exclusive: a booking ending at 10:00 does not\nconflict with a search starting at 10:00.","required":["from","to"],"properties":{"from":{"$ref":"#/components/schemas/Time"},"to":{"$ref":"#/components/schemas/Time"}}},"Room":{"type":"object","required":["building","name","occupied"],"properties":{"building":{"type":"string","description":"Source-provided building name.","example":"Building 2"},"id":{"type":"string","description":"Room ID for the details endpoint. If absent, room details cannot be requested.","example":"34","pattern":"^[0-9]+$"},"name":{"type":"string","description":"Source-provided room name.","example":"2.1.1"},"occupied":{"type":"array","items":{"$ref":"#/components/schemas/Interval"},"description":"Booked intervals for the whole day, even when the search filters by time."}}},"RoomList":{"type":"object","required":["rooms"],"properties":{"rooms":{"type":"array","items":{"$ref":"#/components/schemas/Room"}}}},"Time":{"type":"string","examples":["10:00"],"pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$"}}},"security":[{}],"tags":[{"name":"Rooms","description":"Room schedules and details."}]}