UNPKG

@golemio/parkings

Version:
1,183 lines (1,179 loc) 112 kB
# prettier-ignore openapi: 3.0.3 info: title: 🅿️ Parking description: >- <p>💡 Parking, parking zones, tariffs, measurements.</p> version: 1.0.0 contact: name: Golemio Prague Data Platform email: golemio@operatorict.cz url: https://golemio.cz servers: - url: https://rabin.golemio.cz description: Test (development) server - url: https://api.golemio.cz description: Main (production) server tags: - name: 🅿️ Parking (v1) description: <img src="https://img.shields.io/badge/opendata-available-green" alt="golemioapi-opendata-badge" /> 💡 Parking Lots - name: 🅿️ Parking (v2) description: <img src="https://img.shields.io/badge/opendata-available-green" alt="golemioapi-opendata-badge" /> 💡 Parking spaces - name: 🅿️ Parking (v2) - internal description: 💡 parking details, measurements and tariffs - name: 🅿️ Parking (v3) description: <img src="https://img.shields.io/badge/opendata-available-green" alt="golemioapi-opendata-badge" /> 💡 Parking, occupancy, measurements, tariffs, machines. <em>Note that only a select subset of the data is published as open data.</em> paths: /v1/parkings: get: tags: - 🅿️ Parking (v1) summary: GET All Parking Lots within the region of interest parameters: - name: latlng in: query description: Sorting by location (Latitude and Longitude separated by comma, latitude first). schema: type: string example: 50.124935,14.457204 - name: range in: query description: Filter by distance from latlng in meters (range query). Depends on the latlng parameter. schema: type: number example: 5000 - name: districts in: query description: Filter by Prague city districts (slug) separated by comma. required: false example: ['praha-4'] schema: type: array items: {} - name: limit in: query description: Limits number of retrieved items. schema: type: number example: 10 - name: offset in: query description: Number of the first items that are skipped. schema: type: number example: 0 - name: updatedSince in: query description: Filters all results with older updated_at than this parameter required: false example: 2019-05-18T07:38:37.000Z schema: type: string responses: 200: description: OK headers: Cache-Control: description: Cache control directive for caching proxies schema: type: string example: public, s-maxage=300, stale-while-revalidate=5 content: application/json; charset=utf-8: schema: type: object properties: features: type: array items: $ref: '#/components/schemas/ParkingLotFeature' type: type: string example: FeatureCollection 401: $ref: "#/components/responses/UnauthorizedError" 404: description: Not found /v1/parkings/{id}: get: tags: - 🅿️ Parking (v1) summary: GET Parking Lot parameters: - name: id in: path description: Id of parking location. required: true schema: type: string example: "534015" responses: 200: description: OK headers: Cache-Control: description: Cache control directive for caching proxies schema: type: string example: public, s-maxage=300, stale-while-revalidate=5 content: application/json; charset=utf-8: schema: $ref: '#/components/schemas/ParkingLotFeature' 401: $ref: "#/components/responses/UnauthorizedError" 404: description: Not found /v1/parkings/history: get: tags: - 🅿️ Parking (v1) summary: GET Parking Lot History parameters: - name: limit in: query description: Limits number of retrieved items. schema: type: number example: 10 - name: offset in: query description: Number of the first items that are skipped. schema: type: number example: 0 - name: from in: query description: Date in ISO8601, limits data measured from this datetime required: false schema: type: string example: 2019-05-18T07:38:37.000Z - name: to in: query description: Date in ISO8601, limits data measured up to this datetime required: false schema: type: string example: 2019-05-19T07:38:37.000Z - name: sensorId in: query description: Limits data measured by sensor with this id (parameter `id` of the parking) schema: type: string example: tsk-143 responses: 200: description: OK headers: Cache-Control: description: Cache control directive for caching proxies schema: type: string example: public, s-maxage=300, stale-while-revalidate=5 content: application/json; charset=utf-8: schema: type: array items: $ref: '#/components/schemas/ParkingLotHistory' 401: $ref: "#/components/responses/UnauthorizedError" 404: description: Not found /v2/parking: get: tags: - 🅿️ Parking (v2) summary: GET All Parking Spaces within the region of interest parameters: - name: latlng in: query description: Sorting by location (Latitude and Longitude separated by comma, latitude first). schema: type: string example: 50.124935,14.457204 - name: range in: query description: Filter by distance from latlng in meters (range query). Depends on the latlng parameter. schema: type: number example: 5000 - name: source in: query description: Filter by data provider. schema: type: string example: korid - name: sourceId in: query description: Filter by parking group id. Unique per data provider. schema: type: string example: "1" - name: category in: query description: Filter by parking type. Use with square brackets `category[]` style: form explode: false schema: type: array items: type: string example: ['park_and_ride'] - name: limit in: query description: Limits number of retrieved items. schema: type: number example: 10 - name: offset in: query description: Number of the first items that are skipped. schema: type: number example: 0 - name: minutesBefore in: query schema: type: integer example: 10 description: 'Filter by time conditions based on last data update. By maximal minutes before last update.' - name: updatedSince in: query schema: type: string example: '2022-07-25T00:00:00.000Z' description: 'Filter by time conditions based on last data update. Date has to be in ISO8601 format. Cannot be used together with minutesBefore.' responses: 200: description: OK headers: Cache-Control: description: Cache control directive for caching proxies schema: type: string example: public, s-maxage=300, stale-while-revalidate=5 content: application/json; charset=utf-8: schema: type: object properties: features: type: array items: $ref: '#/components/schemas/ParkingSpaceFeature' type: type: string example: FeatureCollection 401: $ref: "#/components/responses/UnauthorizedError" 404: description: Not found /v2/parking/{id}: get: tags: - 🅿️ Parking (v2) summary: GET Parking Space parameters: - name: id in: path description: Id of parking location. required: true schema: type: string example: korid-20 responses: 200: description: OK headers: Cache-Control: description: Cache control directive for caching proxies schema: type: string example: public, s-maxage=300, stale-while-revalidate=5 content: application/json; charset=utf-8: schema: $ref: '#/components/schemas/ParkingSpaceFeature' 401: $ref: "#/components/responses/UnauthorizedError" 404: description: Not found /v2/parking/detail: get: tags: - 🅿️ Parking (v2) - internal summary: GET All Detailed Parking Spaces parameters: - name: latlng in: query description: Sorting by location (Latitude and Longitude separated by comma, latitude first). schema: type: string example: 50.124935,14.457204 - name: range in: query description: Filter by distance from latlng in meters (range query). Depends on the latlng parameter. schema: type: number example: 5000 - name: source in: query description: Filter by data provider. schema: type: string example: tsk - name: sourceId in: query description: Filter by parking group id. Unique per data provider. schema: type: string example: "1" - name: category in: query description: Filter by parking type. Use with square brackets `category[]` style: form explode: false schema: type: array items: type: string example: ['park_and_ride'] - name: limit in: query description: Limits number of retrieved items. schema: type: number example: 10 - name: offset in: query description: Number of the first items that are skipped. schema: type: number example: 0 - name: minutesBefore in: query schema: type: integer example: 10 description: 'Filter by time conditions based on last data update. By maximal minutes before last update.' - name: updatedSince in: query schema: type: string example: '2022-07-25T00:00:00.000Z' description: 'Filter by time conditions based on last data update. Date has to be in ISO8601 format. Cannot be used together with minutesBefore.' - name: zoneType in: query description: Filter by parking zone. Use with square brackets `zoneType[]`, multiple values can be passed forming an array. style: form explode: false schema: type: array items: type: string example: ['zone_mixed'] - name: parkingType in: query description: Filter by parking type. Use with square brackets `parkingType[]`, multiple values can be passed forming an array. style: form explode: false schema: type: array items: type: string example: ['on_street'] responses: 200: description: OK headers: Cache-Control: description: Cache control directive for caching proxies schema: type: string example: public, s-maxage=300, stale-while-revalidate=5 content: application/json; charset=utf-8: schema: type: object properties: features: type: array items: $ref: '#/components/schemas/ParkingSpaceFeature' type: type: string example: FeatureCollection 401: $ref: "#/components/responses/UnauthorizedError" 404: description: Not found /v2/parking/detail/{id}: get: tags: - 🅿️ Parking (v2) - internal summary: GET Detailed Parking Space parameters: - name: id in: path description: Id of parking location. required: true schema: type: string example: korid-20 responses: 200: description: OK headers: Cache-Control: description: Cache control directive for caching proxies schema: type: string example: public, s-maxage=300, stale-while-revalidate=5 content: application/json; charset=utf-8: schema: $ref: '#/components/schemas/ParkingSpaceFeature' 401: $ref: "#/components/responses/UnauthorizedError" 404: description: Not found /v2/parking/measurements: get: tags: - 🅿️ Parking (v2) - internal summary: GET All Parking Spaces Measurements parameters: - name: source in: query description: Filter by data provider. schema: type: string example: korid - name: sourceId in: query description: Filter by parking group id. Unique per data provider. schema: type: string example: "1" - name: latest in: query description: Show only the latest measurement. schema: type: boolean example: true default: false - name: from in: query description: Date in ISO8601, limits data measured from this datetime. schema: type: string example: "2021-02-26T12:01:00.000Z" - name: to in: query description: Date in ISO8601, limits data measured up until this datetime. schema: type: string example: "2021-02-26T12:03:00.000Z" - name: limit in: query description: Limits number of retrieved items. Max 10000. schema: type: number example: 10 - name: offset in: query description: Number of items that are skipped in result (like in sql). schema: type: number example: 0 - name: minutesBefore in: query schema: type: integer example: 10 description: 'Filter by time conditions based on last data update. By maximal minutes before last update.' - name: updatedSince in: query schema: type: string example: '2022-07-25T00:00:00.000Z' description: 'Filter by time conditions based on last data update. Date has to be in ISO8601 format. Cannot be used together with minutesBefore.' responses: 200: description: OK headers: Cache-Control: description: Cache control directive for caching proxies schema: type: string example: public, s-maxage=300, stale-while-revalidate=5 content: application/json; charset=utf-8: schema: type: array items: $ref: '#/components/schemas/ParkingMeasurement' 401: $ref: "#/components/responses/UnauthorizedError" 404: description: Not found 400: description: Bad request content: application/json; charset=utf-8: schema: type: object properties: error_message: type: string example: Bad request error_status: type: number example: 400 error_info: type: string example: '{"limit":{"location":"query","param":"limit","value":"-2","msg":"Invalid value"}}' /v2/parking/tariffs: get: tags: - 🅿️ Parking (v2) - internal summary: GET All Parking Spaces Tariffs parameters: - name: source in: query description: Filter by data provider. schema: type: string example: korid required: false responses: 200: description: OK headers: Cache-Control: description: Cache control directive for caching proxies schema: type: string example: public, s-maxage=43200, stale-while-revalidate=60 content: application/json; charset=utf-8: schema: type: array items: $ref: '#/components/schemas/ParkingSpaceTariff' 401: $ref: "#/components/responses/UnauthorizedError" 404: description: Not found /v2/parking/tariffs/{tariffId}: get: tags: - 🅿️ Parking (v2) - internal summary: GET Parking Space Tariff parameters: - name: tariffId in: path description: Id of parking tariff. required: true schema: type: string example: b184865e-5a5e-5465-abc1-4fab6bc56a77 responses: 200: description: OK headers: Cache-Control: description: Cache control directive for caching proxies schema: type: string example: public, s-maxage=43200, stale-while-revalidate=60 content: application/json; charset=utf-8: schema: $ref: '#/components/schemas/ParkingSpaceTariff' 401: $ref: "#/components/responses/UnauthorizedError" 404: description: Not found /v3/parking: get: tags: - 🅿️ Parking (v3) summary: 'Get a list of parking locations within the region of interest with filtering options' parameters: - name: primarySource in: query schema: type: array items: type: string example: tsk_v2 description: 'Filter by data source (note that `osm` is a secondary source, not a primary source). Use with square brackets `primarySource[]`. When no filter is used, all parking locations from all primary sources are included along with non-overlapping parking locations from all secondary sources (`osm`). Similarly, when a filter with both primary and secondary sources is used, all parking locations from the specified primary sources are included along with non-overlapping parking locations from the specified secondary sources. When a filter with only a single source is used, all parking locations from the specified source are included regardless of whether the source is primary or secondary.' - name: boundingBox in: query schema: type: string example: '50.123,14.243,50.017,14.573' description: 'Filter by bounding box in format "topLeft.lat,topLeft.lon,bottomRight.lat,bottomRight.lon", polygons that fit only partially to selected bounding box are included' - name: validFrom in: query schema: type: string format: date-time example: '2022-08-01T00:00:00Z' description: 'Filter by valid from date' - name: openingHoursValidFrom in: query schema: type: string format: date-time example: '2022-08-01T00:00:00Z' description: 'Filter opening hours by valid from date' - name: openingHoursValidTo in: query schema: type: string format: date-time example: '2022-08-01T00:00:00Z' description: 'Filter opening hours by valid to date' - name: accessDedicatedTo in: query schema: type: array items: type: string enum: - disabled - charging - parent - delivery - customer - resident - bus - designated - truck - motorcycle - RV description: 'Experimental: Filter by access combinations to specific spaces in parking. Return only strictly matched parking by access to parking spaces' - name: parkingPolicy in: query schema: type: array items: type: string enum: - commercial - customer_only - kiss_and_ride - park_and_ride - park_sharing - zone description: 'Filter by parking policy. For multiple values use with square brackets `parkingPolicy[]`' - name: minutesBefore in: query schema: type: integer example: 10 description: 'Filter by time conditions based on last data update. By maximal minutes before last update.' - name: updatedSince in: query schema: type: string example: '2022-07-25T00:00:00.000Z' description: 'Filter by time conditions based on last data update. Date has to be in ISO8601 format. Cannot be used together with minutesBefore.' - name: activeOnly in: query schema: type: boolean default: true example: true description: 'If true, filter out locations that did not appear in latest source data.' - name: limit in: query schema: type: integer default: 1000 maximum: 10000 minimum: 0 description: 'Number of results to return' - name: offset in: query schema: type: integer default: 0 minimum: 0 description: 'Number of results to skip for pagination' responses: '200': description: 'Successful response' headers: Cache-Control: description: Cache control directive for caching proxies schema: type: string example: public, s-maxage=300, stale-while-revalidate=5 content: application/json; charset=utf-8: schema: type: object properties: features: type: array items: $ref: '#/components/schemas/Parking' type: type: string example: FeatureCollection /v3/parking/{id}: get: tags: - 🅿️ Parking (v3) summary: 'Get detailed information about a parking location by ID' parameters: - name: id in: path required: true schema: type: string example: 'tsk2-P1-0586' description: 'The identifier of the parking location to retrieve' responses: '200': description: 'Successful response' headers: Cache-Control: description: Cache control directive for caching proxies schema: type: string example: public, s-maxage=300, stale-while-revalidate=5 content: application/json: schema: $ref: '#/components/schemas/Parking' /v3/parking/{id}/average-occupancy: get: tags: - 🅿️ Parking (v3) summary: 'Get detailed information about the average occupancy by ID' parameters: - name: id in: path required: true schema: type: string example: 'tsk2-P1-0586' description: 'The identifier of the parking space to retrieve' responses: 200: description: 'Successful response' headers: Cache-Control: description: Cache control directive for caching proxies schema: type: string example: public, s-maxage=28800, stale-while-revalidate=60 content: application/json: schema: $ref: '#/components/schemas/AverageOccupancyWeek' 401: $ref: "#/components/responses/UnauthorizedError" 404: description: Not found 400: description: Bad request content: application/json; charset=utf-8: schema: type: object properties: error_message: type: string example: Bad request error_status: type: number example: 400 error_info: type: string example: '{"limit":{"location":"query","param":"limit","value":"-2","msg":"Invalid value"}}' /v3/parking-measurements: get: tags: - 🅿️ Parking (v3) summary: 'Get a list of the latest (max 1h old) parking measurements with filtering options' parameters: - name: primarySource in: query schema: type: array items: type: string example: tsk_v2 description: 'Filter by primary source. Use with square brackets `primarySource[]`' - name: parkingId in: query schema: type: array items: type: string example: 'source-c66bb668-eab6-49da-bc84-002263e1dce0' description: 'Filter by primary parking ID. Use with square brackets `parkingId[]`' - name: limit in: query schema: type: integer default: 10000 maximum: 10000 minimum: 0 description: 'Number of results to return' - name: offset in: query schema: type: integer default: 0 minimum: 0 description: 'Number of results to skip for pagination' responses: 200: description: 'Successful response' headers: Cache-Control: description: Cache control directive for caching proxies schema: type: string example: public, s-maxage=60, stale-while-revalidate=5 content: application/json; charset=utf-8: schema: type: array items: $ref: '#/components/schemas/ParkingOccupancyMeasurement' 401: $ref: "#/components/responses/UnauthorizedError" 400: description: Bad request content: application/json; charset=utf-8: schema: type: object properties: error_message: type: string example: Bad request error_status: type: number example: 400 error_info: type: string example: '{"limit":{"location":"query","param":"limit","value":"-2","msg":"Invalid value"}}' /v3/parking-tariffs: get: tags: - 🅿️ Parking (v3) summary: 'Get a list of tariffs with filtering options' parameters: - name: primarySource in: query schema: type: array items: type: string example: tsk_v2 description: 'Filter by primary source. Use with square brackets `primarySource[]`' - name: validFrom in: query schema: type: string format: date-time example: '2022-08-01T00:00:00.000Z' description: 'Filter by valid from date of ChargeBand in Tariff (result show all tariffs that contains at least one valid ChargeBand and inside only ChargeBand objects that fit into that filter)' - name: validTo in: query schema: type: string format: date-time example: '2023-12-31T00:00:00.000Z' description: 'Filter by valid to date of ChargeBand in Tariff (result show all tariffs that contains at least one valid ChargeBand and inside only ChargeBand objects that fit into that filter)' - name: limit in: query schema: type: integer default: 1000 maximum: 10000 minimum: 0 description: 'Number of results to return' - name: offset in: query schema: type: integer default: 0 minimum: 0 description: 'Number of results to skip for pagination' responses: '200': description: 'Successful response' headers: Cache-Control: description: Cache control directive for caching proxies schema: type: string example: public, s-maxage=43200, stale-while-revalidate=60 content: application/json: schema: type: array items: $ref: '#/components/schemas/ParkingTariff' /v3/parking-tariffs/{id}: get: tags: - 🅿️ Parking (v3) summary: 'Get a tariff by ID' parameters: - name: id in: path required: true schema: type: string format: uuid example: '0639c53f-c555-49ac-b5e0-bb3d50acf588' description: 'UUID of the tariff to retrieve' responses: '200': description: 'Successful response' headers: Cache-Control: description: Cache control directive for caching proxies schema: type: string example: public, s-maxage=43200, stale-while-revalidate=60 content: application/json: schema: $ref: '#/components/schemas/ParkingTariff' /v3/parking-machines: get: tags: - 🅿️ Parking (v3) summary: 'Get a list of parking machines within the region of interest with filtering options. Results are sorted by id.' parameters: - name: primarySource in: query schema: type: array items: type: string example: tsk_v2 description: 'Filter by primary source. Use with square brackets `primarySource[]`' - name: type in: query schema: type: array items: type: string enum: - payment_machine - info_box example: type[]=payment_machine&type[]=info_box description: 'Filter by type' - name: boundingBox in: query schema: type: string example: '50.123,14.243,50.017,14.573' description: 'Filter by bounding box in format "topLeft.lat,topLeft.lon,bottomRight.lat,bottomRight.lon", polygons that fit only partially to selected bounding box are included' - name: codeMask in: query schema: type: string example: '%88' description: | Filter by code mask using substring match and "%" wildcard (partial match). (If used directly in postman or browser, "%" needs to be encoded as "%25". Examples: - `query` matches substring in codes - `start%` matches codes starting with "start" - `%end` matches codes ending with "end" - `%middle%` matches codes containing "middle" anywhere - name: validFrom in: query schema: type: string format: date-time example: '2023-08-01T00:00:00Z' description: 'Filter by valid from date' - name: activeOnly in: query schema: type: boolean default: true example: true description: 'If true, filter out parking machines that did not appear in latest source data.' - name: limit in: query schema: type: integer default: 1000 maximum: 10000 minimum: 0 description: 'Number of results to return' - name: offset in: query schema: type: integer default: 0 minimum: 0 description: 'Number of results to skip for pagination' responses: '200': description: 'Successful response' headers: Cache-Control: description: Cache control directive for caching proxies schema: type: string example: public, s-maxage=43200, stale-while-revalidate=60 content: application/json; charset=utf-8: schema: type: object properties: features: type: array items: $ref: '#/components/schemas/ParkingMachine' type: type: string example: FeatureCollection /v3/parking-machines/{id}: get: tags: - 🅿️ Parking (v3) summary: 'Get a parking machine by ID' parameters: - name: id in: path required: true schema: type: string example: 'tsk_v2-4521afac-66db-4680-abc5-0006837d977a' description: 'ID of the parking machine to retrieve' responses: '200': description: 'Successful response' headers: Cache-Control: description: Cache control directive for caching proxies schema: type: string example: public, s-maxage=43200, stale-while-revalidate=60 content: application/json: schema: $ref: '#/components/schemas/ParkingMachine' /v3/parking-sources: get: tags: - 🅿️ Parking (v3) summary: Available parking sources responses: '200': description: 'Successful response' headers: Cache-Control: description: Cache control directive for caching proxies schema: type: string example: public, s-maxage=43200, stale-while-revalidate=60 content: application/json: schema: type: array items: $ref: '#/components/schemas/ParkingSource' '401': $ref: "#/components/responses/UnauthorizedError" '404': description: Not found '500': description: Server error components: responses: UnauthorizedError: description: API key is missing or invalid headers: x-access-token: schema: type: string schemas: ParkingLotFeature: type: object properties: geometry: type: object description: GeoJson geometry properties: coordinates: oneOf: - type: array items: type: number example: [14.441252, 50.109318] description: Point - type: array items: type: array items: type: array items: type: number example: [[ [14.50823156003554, 50.10498927328214], [14.505782430390298, 50.1031042405622], [14.509701037821998, 50.1029471511537], [14.50823156003554, 50.10498927328214] ]] description: Polygon - type: array items: type: array items: type: array items: type: array items: type: number example: [ [[ [14.50823156003554, 50.10498927328214], [14.505782430390298, 50.1031042405622], [14.509701037821998, 50.1029471511537], [14.50823156003554, 50.10498927328214] ]], [[ [14.50823156003554, 50.10498927328214], [14.505782430390298, 50.1031042405622], [14.509701037821998, 50.1029471511537], [14.50823156003554, 50.10498927328214] ]] ] description: MultiPolygon type: type: string enum: - Point - Polygon - MultiPolygon properties: typ