Skip to content

shevernitskiy/post-tracking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📦RussianPost tracking API client

npm JSR dependencies license

This is super simple API client for RussianPost Traking API. It just fetch the tracking history from the API.

Installation

Node.js

npm i @shevernitskiy/post-tracking
npx jsr add @shevernitskiy/post-tracking

Deno

deno add @shevernitskiy/post-tracking

Usage

Create an instance and call method tracking. That's it.

const client = new PostTracking("your_login", "your_password");
const history = await client.tracking(1116949696969);
console.log(history);

You can pass options object as a third argument.

const client = new PostTracking("your_login", "your_password", { language: "ENG" });

As as result you will get the history:

{
  history: [
    {
      index: 111024,
      place: "Москва 24",
      operation_type: "Прием",
      operation_desc: "Единичный",
      datetime: 2024-07-10T10:31:41.000Z
    },
    {
      index: 111024,
      place: "Москва 24",
      operation_type: "Обработка",
      operation_desc: "Покинуло место приёма",
      datetime: 2024-07-10T13:08:20.000Z
    },
    {
      index: 111974,
      place: "Москва МСП-3 Цех-4 МПКО-Восток",
      operation_type: "Обработка",
      operation_desc: "Прибыло в сортировочный центр",
      datetime: 2024-07-10T14:18:07.001Z
    },
    {
      index: 111974,
      place: "Москва МСП-3 Цех-4 МПКО-Восток",
      operation_type: "Обработка",
      operation_desc: "Сортировка",
      datetime: 2024-07-10T14:32:54.000Z
    }
  ],
  last_operation: "Обработка",
  duration: 434992
}

Contribution

Pull request, issues and feedback are very welcome. Code style is formatted with deno fmt.

License

Copyright 2024, shevernitskiy. MIT license.