openapi-directory
Version:
Building & bundling https://github.com/APIs-guru/openapi-directory for easy use from JS
1 lines • 5.56 kB
JSON
{"openapi":"3.0.0","info":{"contact":{"x-twitter":"faretrotter"},"description":"Multimodal travel API to return modes of transportation between cities and points of interest.","title":"Faretrotter Travel API","version":"2.0","x-apisguru-categories":["transport"],"x-logo":{"url":"https://twitter.com/faretrotter/profile_image?size=original"},"x-origin":[{"format":"swagger","url":"https://raw.githubusercontent.com/Faretrotter/api/master/docs/oas20.yaml","version":"2.0"}],"x-providerName":"faretrotter.com"},"paths":{"/places":{"get":{"operationId":"GET_places","responses":{"200":{"description":"Everything worked as expected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaceResponse"}}}},"400":{"description":"Parameters did not match the endpoint requirements. Check that all required fields are present and spelt correctly."},"401":{"description":"Authentication Failed."},"402":{"description":"All parameters are correct but the request failed."},"403":{"description":"Request IP does not match IP address registered with key."},"404":{"description":"The endpoint doesn't exist."},"429":{"description":"Too many requests hit the API too quickly."},"501":{"description":"Server error"},"502":{"description":"Server error"}},"summary":"Returns possible modes of transportation between two cities."}},"/routes":{"get":{"operationId":"GET_routes","parameters":[{"in":"query","name":"origin_lat","required":true,"schema":{"type":"number"}},{"in":"query","name":"origin_lng","required":true,"schema":{"type":"number"}},{"in":"query","name":"destination_lat","required":true,"schema":{"type":"number"}},{"in":"query","name":"destination_lng","required":true,"schema":{"type":"number"}}],"responses":{"200":{"description":"Everything worked as expected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoutesResponse"}}}},"400":{"description":"Parameters did not match the endpoint requirements. Check that all required fields are present and spelt correctly."},"401":{"description":"Authentication Failed."},"402":{"description":"All parameters are correct but the request failed."},"403":{"description":"Request IP does not match IP address registered with key."},"404":{"description":"The endpoint doesn't exist."},"429":{"description":"Too many requests hit the API too quickly."},"501":{"description":"Server error"},"502":{"description":"Server error"}}}}},"servers":[{"url":"https://api.faretrotter.com/v2.0/{apikey}","variables":{"apikey":{"default":"unknown"}}}],"components":{"securitySchemes":{"ApiKeyAuth":{"in":"header","name":"ApiKeyAuth","type":"apiKey"}},"schemas":{"PlaceResponse":{"properties":{"city":{"type":"string"},"country":{"type":"string"},"geoname_id":{"type":"string"},"id":{"type":"string"},"lat":{"type":"number"},"lng":{"type":"number"},"name":{"type":"string"},"name_long":{"type":"string"},"region":{"type":"string"},"slug":{"type":"string"},"type":{"type":"string"}},"required":["id","name","name_long","city","region","country","type","slug","lat","lng","geoname_id"],"title":"Place response","type":"object"},"PlacesResponse":{"properties":{"places":{"items":{"$ref":"#/components/schemas/PlaceResponse"},"type":"array"},"request":{"properties":{"distance_miles":{"type":"number"},"endpoint":{"type":"string"},"environment":{"type":"string"},"fields":{"properties":{"destination_lat":{"type":"number"},"destination_lng":{"type":"number"},"origin_lat":{"type":"number"},"origin_lng":{"type":"number"}},"required":["origin_lat","origin_lng","destination_lat","destination_lng"],"type":"object"},"version":{"type":"string"}},"required":["environment","version","endpoint","fields","distance_miles"],"type":"object"},"status":{"properties":{"code":{"type":"number"},"message":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["status","request","places"],"title":"Places response","type":"object"},"RoutesResponse":{"properties":{"data":{"properties":{"operators":{"items":{"properties":{"attributes":{"items":{"type":"string"},"type":"array"},"code":{"type":"string"},"id":{"type":"string"},"logo_img":{"type":"string"},"mode":{"type":"string"},"name":{"type":"string"}},"required":["id","name","logo_img","mode","code","attributes"],"type":"object"},"type":"array"},"places":{"items":{"$ref":"#/components/schemas/PlaceResponse"},"type":"array"},"routes":{"items":{"properties":{"co2":{"type":"number"},"destination_id":{"type":"string"},"duration":{"type":"number"},"fare":{"type":"number"},"mode":{"type":"string"},"origin_id":{"type":"string"}},"required":["origin_id","destination_id","mode","fare","duration","co2"],"type":"object"},"type":"array"}},"required":["routes","places","operators"],"type":"object"},"request":{"properties":{"distance_miles":{"type":"number"},"endpoint":{"type":"string"},"environment":{"type":"string"},"fields":{"properties":{"destination_lat":{"type":"number"},"destination_lng":{"type":"number"},"origin_lat":{"type":"number"},"origin_lng":{"type":"number"}},"required":["origin_lat","origin_lng","destination_lat","destination_lng"],"type":"object"},"version":{"type":"string"}},"required":["environment","version","endpoint","fields","distance_miles"],"type":"object"},"response":{"properties":{"time":{"type":"number"},"url":{"type":"string"}},"required":["url","time"],"type":"object"},"status":{"properties":{"code":{"type":"number"},"message":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["status","request","data","response"],"title":"Routes response","type":"object"}}}}