{"id":20333046,"url":"https://github.com/jaebradley/skypicker-client","last_synced_at":"2025-04-11T21:33:09.153Z","repository":{"id":29456647,"uuid":"121580611","full_name":"jaebradley/skypicker-client","owner":"jaebradley","description":"✈️ NodeJS Client for the Skypicker API (https://skypickerpublicapi.docs.apiary.io)","archived":false,"fork":false,"pushed_at":"2022-12-04T19:04:55.000Z","size":1688,"stargazers_count":4,"open_issues_count":13,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T17:46:50.378Z","etag":null,"topics":["flights","flights-api","nodejs","skypicker"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/skypicker","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jaebradley.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-15T01:25:19.000Z","updated_at":"2023-03-04T05:45:07.000Z","dependencies_parsed_at":"2023-01-14T14:58:13.250Z","dependency_job_id":null,"html_url":"https://github.com/jaebradley/skypicker-client","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaebradley%2Fskypicker-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaebradley%2Fskypicker-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaebradley%2Fskypicker-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaebradley%2Fskypicker-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaebradley","download_url":"https://codeload.github.com/jaebradley/skypicker-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248483368,"owners_count":21111435,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flights","flights-api","nodejs","skypicker"],"created_at":"2024-11-14T20:29:07.503Z","updated_at":"2025-04-11T21:33:09.125Z","avatar_url":"https://github.com/jaebradley.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# skypicker-client\n\n![Skypicker Client](https://github.com/jaebradley/skypicker-client/workflows/Skypicker%20Client/badge.svg)\n[![npm](https://img.shields.io/npm/v/skypicker.svg)](https://www.npmjs.com/package/skypicker)\n[![npm](https://img.shields.io/npm/dt/skypicker.svg)](https://www.npmjs.com/package/skypicker)\n\n## Introduction\n\nThe [`skypicker` API](skypickerpublicapi.docs.apiary.io) is a nifty `REST` API for obtaining flight and airline data. `skypicker` is a thin `NodeJS` wrapper around the API.\n\n## Install\n\n```\nnpm install skypicker --save\n```\n\n## API\n\n* [`searchLocationsByTerm`](#searchlocationsbyterm)\n* [`searchLocationsByRadius`](#searchlocationsbyradius)\n* [`searchLocationsByBox`](#searchlocationsbybox)\n* [`getLocationById`](#getlocationbyid)\n* [`getLocationDump`](#getlocationdump)\n* [`getAirlines`](#getairlines)\n* [`getAirlineIcon`](#getairlineicon)\n* [`searchFlights`](#searchflights)\n\n### `searchLocationsByTerm`\n\n* `term: (required; string)` - The search parameter used to identify a airport, city, country, etc.\n* `locale: (optional; string)` - The returned output matches the `locale` specified. The default value is `en`.\n* `locationTypes: (optional; array)` - There are six types of locations: airports, autonomous territories, cities, countries, stations, and subdivisions. These location types are captured in the `LOCATION_TYPES` constant. The default behavior is to search all location types.\n* `limit: (optional; positive integer)` - This specifies the number of records returned by the API. The default value is `20`.\n* [`REST` API documentation](https://skypickerpublicapi.docs.apiary.io/#reference/locations/locations-collection/search-by-query)\n\n#### Example\n\n```javascript\nimport { searchLocationsByTerm, LOCATION_TYPES } from 'skypicker';\n\nconst tenAirportsThatMatchLoganWithSpanishOutput = await searchLocationsByTerm({\n  term: 'Logan',\n  locale: 'es-ES',\n  locationTypes: [LOCATION_TYPES.AIRPORT],\n  limit: 10,\n});\n```\n\n### `searchLocationsByRadius`\n\n* `coordinate: (required; object)` - An object with `latitude` and `longitude` properties that represents a point\n* `radius: (optional; non-negative integer)` - Represents the `kilometers` from the specified `coordinate` to search. Defaults to `250 kilometers`.\n* `locale: (optional; string)` - The returned output matches the `locale` specified. The default value is `en`.\n* `locationTypes: (optional; array)` - There are six types of locations: airports, autonomous territories, cities, countries, stations, and subdivisions. These location types are captured in the `LOCATION_TYPES` constant. The default behavior is to search all location types.\n* `limit: (optional; positive integer)` - This specifies the number of records returned by the API. The default value is `20`.\n* `sort: (optional: LOCATION_RESULTS_SORT_TYPES)` - Specifies whether output should be sorted by `name` or `rank` in an ascending or descending manner\n* [`REST` API documentation](https://skypickerpublicapi.docs.apiary.io/#reference/locations/locations-collection/search-by-radius)\n\n#### Example\n\n```javascript\nimport { searchLocationsByRadius, LOCATION_TYPES, LOCATION_RESULTS_SORT_TYPES } from 'skypicker';\n\nconst tenAirportsWithinA100KilometerRadiusOfNewYorkCityWithSpanishOutput = await searchLocationsByRadius({\n  coordinate: {\n    latitude: 40.7128,\n    longitude: -74.0059,\n  },\n  radius: 100,\n  locale: 'es-ES',\n  locationTypes: [LOCATION_TYPES.AIRPORT],\n  limit: 10,\n  sort: LOCATION_RESULTS_SORT_TYPES.DESCENDING_RANK,\n})\n```\n\n### `searchLocationsByBox`\n\n* `lowCoordinate: (required; object)` - Specifies a `coordinate` object with `latitude` and `longitude` properties that represent the southwest corner of the geo search box.\n* `highCoordinate: (required; object)` - Specifies a `coordinate` object with `latitude` and `longitude` properties that represent the northeast corner of the geo search box.\n* `locale: (optional; string)` - The returned output matches the `locale` specified. The default value is `en`.\n* `locationTypes: (optional; array)` - There are six types of locations: airports, autonomous territories, cities, countries, stations, and subdivisions. These location types are captured in the `LOCATION_TYPES` constant. The default behavior is to search all location types.\n* `limit: (optional; positive integer)` - This specifies the number of records returned by the API. The default value is `20`.\n* `sort: (optional: LOCATION_RESULTS_SORT_TYPES)` - Specifies whether output should be sorted by `name` or `rank` in an ascending or descending manner\n* [`REST` API documentation](https://skypickerpublicapi.docs.apiary.io/#reference/locations/locations-collection/search-by-box)\n\n#### Example\n\n```javascript\nimport { searchLocationsByBox, LOCATION_TYPES, LOCATION_RESULTS_SORT_TYPES } from 'skypicker';\n\nconst boxSearch = await searchLocationsByBox({\n  lowCoordinate: {\n    latitude: 40.200610,\n    longitude: -74.624328,\n  },\n  highCoordinate: {\n    latitude: 44.763212,\n    longitude: -73.376543,\n  },\n  locale: 'es-ES',\n  locationTypes: [LOCATION_TYPES.AIRPORT],\n  limit: 10,\n  sort: LOCATION_RESULTS_SORT_TYPES.DESCENDING_RANK,\n})\n```\n\n### `getLocationById`\n\n* `id: (required; string)` - Specifies the IATA airport or [ISO-3166 location code](https://en.wikipedia.org/wiki/ISO_3166)\n* `locale: (optional; string)` - The returned output matches the `locale` specified. The default value is `en`.\n* [`REST` API documentation](https://skypickerpublicapi.docs.apiary.io/#reference/locations/locations-collection/get-by-id)\n\n### `getLocationDump`\n\n* `locale: (optional; string)` - The returned output matches the `locale` specified. The default value is `en`.\n* `locationTypes: (optional; array)` - There are six types of locations: airports, autonomous territories, cities, countries, stations, and subdivisions. These location types are captured in the `LOCATION_TYPES` constant. The default behavior is to search all location types.\n* `limit: (optional; positive integer)` - This specifies the number of records returned by the API. The default value is `20`.\n* `sort: (optional: LOCATION_RESULTS_SORT_TYPES)` - Specifies whether output should be sorted by `name` or `rank` in an ascending or descending manner\n* [`REST` API documentation](https://skypickerpublicapi.docs.apiary.io/#reference/locations/locations-collection/get-dump)\n\n#### Example\n\n```javascript\nimport { getLocationDump, LOCATION_TYPES, LOCATION_RESULTS_SORT_TYPES } from 'skypicker';\n\nconst locationDump = await getLocationDump({\n  locationTypes: [LOCATION_TYPES.AIRPORT],\n  limit: 10,\n  sort: LOCATION_RESULTS_SORT_TYPES.DESCENDING_RANK,\n})\n```\n\n### `getAirlines`\n\n* Gets all airlines (both `LC (legacy carrier)` and `LCC (low-cost carrier)`)\n* No parameters needed\n* [`REST` API documentation](https://skypickerpublicapi.docs.apiary.io/#reference/airlines/get-dump)\n\n### `getAirlineIcon`\n\n* `airlineCode: (required; string)` - Specifies the airline's `IATA` code\n* [`REST` API documentation](https://skypickerpublicapi.docs.apiary.io/#reference/airline-logos/get-dump)\n\n### `searchFlights`\n\n* `departureIdentifier: (required; string, array[string])` - Any `Skypicker` location id(s), like airport codes, city IDs, two-letter country codes, etc.\n* `departureDateTimeRange: (required; object)` - Specifies the departure date and time-of-day ranges. The departure date values should be in [`ISO-8601` format (`YYYY-MM-DD`)](https://www.iso.org/iso-8601-date-and-time-format.html), while the time of day values should be in `HH:mm` format where the hour and minute values span `00-23` and `00-59`, respectively.\n\n```javascript\n{\n  date: {\n    start: '2018-01-01',\n    end: '2018-01-15',\n  },\n  timeOfDay: {\n    start: '02:30',\n    end: '14:15',\n  },\n};\n```\n\n* `returnDepartureDateTimeRange: (required if round-trip flight; object)` - Specifies the departure date and time-of-day ranges. Object should be in the same format as the `departureDateTimeRange` variable.\n* `arrivalIdentifier: (optional; string, array[string])` - Any `Skypicker` location id(s). If this is not specified, you'll get results for all airports in the world\n* `maximumHoursInFlight: (optional; non-negative integers)` - Maximum flight duration, in hours\n* `passengerCount: (optional; positive integers)` - Number of passengers. Default value is `1`.\n* `directFlightsOnly: (optional; boolean)` - When `true`, only direct flights are considered. By default, `false`.\n* `currencyCode: (optional; string)` - The currency in which prices and other relevant values are expressed. Follows [`ISO-4217` currency codes](https://en.wikipedia.org/wiki/ISO_4217). By default, `EUR`.\n* `priceRange: (optional; object)` - Only tickets within the specified range are returned. Values should be represented as non-negative integers.\n\n```javascript\n{\n  start: 0,\n  end: 100,\n}\n```\n\n* `maximumStopOverCount: (optional; non-negative integer)` - Maximum number of stopovers\n* `airlinesFilter: (optional; object)` - Either *excludes* or *includes* the specified airlines. The `airlinesFilter` object has two properties: `airlines` (an `array` of `IATA` codes) and `type` (an `AIRLINES_FILTER_TYPE` value).\n* `partner: (optional; string)` - The Skypicker Partner ID assigned to your account. Use `picky` for testing.\n\n```javascript\n{\n  airlines: [B6],\n  type: AIRLINES_FILTER_TYPE.EXCLUDE,\n}\n```\n\n* `locale: (optional; string)` - The returned output matches the `locale` specified. The default value is `en`.\n* `offset: (optional; non-negative integer)` - Specified for paginating through requests\n* `limit: (optional; positive integer)` - This specifies the number of records returned by the API. The default value is `20`.\n* `sortType: (optional; FLIGHT_RESULTS_SORT_TYPES)` - Specifies whether to sort results by date, duration, price, or quality\n* [`REST` API documentation](https://skypickerpublicapi.docs.apiary.io/#reference/flights/flights/get)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaebradley%2Fskypicker-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaebradley%2Fskypicker-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaebradley%2Fskypicker-client/lists"}