{"id":15590770,"url":"https://github.com/timrogers/inpost","last_synced_at":"2025-07-03T22:34:06.526Z","repository":{"id":63864364,"uuid":"571315751","full_name":"timrogers/inpost","owner":"timrogers","description":"A JavaScript library for interacting with parcel lockers offered by InPost (https://inpost.eu/) - starting with the UK.","archived":false,"fork":false,"pushed_at":"2025-06-12T06:46:14.000Z","size":2197,"stargazers_count":0,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-13T20:53:20.201Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/timrogers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-27T20:42:42.000Z","updated_at":"2025-03-23T20:26:59.000Z","dependencies_parsed_at":"2023-11-25T10:24:30.252Z","dependency_job_id":"9f1bba18-3079-411d-8f11-15d38ba6b15a","html_url":"https://github.com/timrogers/inpost","commit_stats":{"total_commits":57,"total_committers":2,"mean_commits":28.5,"dds":"0.19298245614035092","last_synced_commit":"5ca489e596d2fc7215bd1be9b31cedf32f1b7378"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/timrogers/inpost","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timrogers%2Finpost","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timrogers%2Finpost/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timrogers%2Finpost/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timrogers%2Finpost/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timrogers","download_url":"https://codeload.github.com/timrogers/inpost/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timrogers%2Finpost/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263415758,"owners_count":23463104,"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":[],"created_at":"2024-10-02T23:28:56.162Z","updated_at":"2025-07-03T22:34:06.460Z","avatar_url":"https://github.com/timrogers.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# InPost\n\nThis JavaScript package allows you to interact with [InPost parcel lockers](https://inpost.eu) in the [UK](https://inpost.co.uk) using InPost's undocumented APIs.\n\nWith this client library, you can __access the name, address, coordinates and current locker availability__ at InPost parcel lockers near a given UK postcode or set of latitude and longitude coordinates.\n\n## Installation\n\nInstall the `inpost` package from the npm package registry:\n\n```bash\n# If you're using npm\nnpm install --save inpost\n\n# If you're using Yarn\nyarn add inpost\n```\n\n## Usage\n\nThis package includes:\n\n* support for ESM and CommonJS modules - so no matter how your project is set up, you should be able to use it with either `import` or `require` ✨\n* Typescript types for a 10/10 developer experience 🌟\n\n### Finding InPost locations near to a given UK postcode\n\nTo find InPost locations near to a given UK postcode, use the `findLocationsByPostcode` function:\n\n```ts\nimport { findLocationsByPostcode } from 'inpost';\n\nconst locations = await findLocationsByPostcode('SW1A 1AA');\n\nfor (const location of locations) {\n  console.log(`Found nearby location \"${location.name}\" (${location.id})`);\n  console.log(`Current availability: S: ${location.smallLockerAvailability}, M: ${location.mediumLockerAvailability}, L: ${location.largeLockerAvailability}`);\n}\n```\n\nSee the [`ListedLocation` type](https://github.com/timrogers/inpost/blob/main/src/types.ts) for details on the data available for each location.\n\nEach location includes an `id` which can be used to get locker availability for that location and to fetch the location by its ID in the future.\n\n### Finding InPost locations near to a set of latitude and longitude coordinates\n\nTo find InPost locations near to a specific set of latitude and longitude coordinates, use the `findLocationsByCoordinates` function:\n\n```ts\nimport { findLocationsByCoordinates } from 'inpost';\n\nconst locations = await findLocationsByCoordinates(51.463, -0.0987);\n\nfor (const location of locations) {\n  console.log(`Found nearby location \"${location.name}\" (${location.id})`);\n  console.log(`Current availability: S: ${location.smallLockerAvailability}, M: ${location.mediumLockerAvailability}, L: ${location.largeLockerAvailability}`);\n}\n```\n\nSee the [`ListedLocation` type](https://github.com/timrogers/inpost/blob/main/src/types.ts) for details on the data available for each location.\n\nEach location includes an `id` which can be used to get locker availability for that location and to fetch the location by its ID in the future.\n\n### Fetching a location by its ID\n\nTo fetch an InPost location by its ID - returned by `findLocationsByPostcode` or `findLocationsByCoordinates` - use the `getLocation` function:\n\n```ts\nimport { getLocation } from 'inpost';\n\nconst location = await getLocation('UK00000756');\n\nconsole.log(`Loaded location \"${location.name}\"`);\nconsole.log(`Current availability: S: ${location.smallLockerAvailability}, M: ${location.mediumLockerAvailability}, L: ${location.largeLockerAvailability}`);\n```\n\nSee the [`Location` type](https://github.com/timrogers/inpost/blob/main/src/types.ts) for details on the data available for a location. __Note that the `lastUpdatedAt` data, indicating when locker availability was last updated, is not available in this type, and can only be accessed through `findLocationsByPostcode` and `findLocationsByCoordinates`.__\n\n### Error handling\n\nIf InPost returns an error, then a [`ResponseError`](https://github.com/timrogers/inpost/blob/main/src/errors.ts#L1) will be thrown.\n\nThe error's message will include the error message returned by InPost - or if no error message can be found, then it'll use something fairly generic (`Got status code 404, expected 200`).\n\n`ResponseError`s expose the full `fetch` `Response` - see [MDN web docs](https://developer.mozilla.org/en-US/docs/Web/API/Response) for details on that interface.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimrogers%2Finpost","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimrogers%2Finpost","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimrogers%2Finpost/lists"}