npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

whereparcel

v0.2.1

Published

Official WhereParcel SDK - Track parcels across 500+ carriers worldwide

Readme

WhereParcel

Official Node.js SDK for the WhereParcel package tracking API. Track parcels across 500+ carriers worldwide including USPS, FedEx, UPS, DHL, and more.

Install

npm install whereparcel

Quick Start

import { WhereParcel } from 'whereparcel';

const wp = new WhereParcel('your-api-key', 'your-secret-key');

const result = await wp.track('us.usps', '9400111899562537866361');

if (result.status === 'success') {
  console.log(result.data.deliveryStatus); // 'delivered'
  console.log(result.data.events);         // Tracking events
}

Get your API key at whereparcel.com/dashboard.

Features

  • 500+ carriers — USPS, FedEx, UPS, DHL, and carriers across 50+ countries
  • TypeScript first — Full type definitions included
  • Zero dependencies — Uses native fetch (Node.js 18+)
  • Bulk tracking — Track up to 50 parcels per request
  • Webhooks — Real-time delivery notifications
  • ESM + CJS — Works with both module systems

API Reference

Constructor

const wp = new WhereParcel(apiKey, secretKey, options?);

| Parameter | Type | Description | |-----------|------|-------------| | apiKey | string | Your API key | | secretKey | string | Your secret key | | options.baseUrl | string | API base URL (default: https://api.whereparcel.com) | | options.timeout | number | Request timeout in ms (default: 30000) |

Tracking

track(carrier, trackingNumber, clientId?)

Track a single parcel.

const result = await wp.track('us.fedex', '123456789012');

if (result.status === 'success') {
  console.log(result.data.deliveryStatus);  // 'in_transit'
  console.log(result.data.estimatedDelivery); // '2026-03-01'
  console.log(result.data.events);          // Array of tracking events
}

if (result.status === 'error') {
  console.log(result.error.code);    // 'TRACKING_NOT_FOUND'
  console.log(result.error.message);
}

trackBulk(items)

Track multiple parcels in one request (max 50).

const response = await wp.trackBulk([
  { carrier: 'us.usps', trackingNumber: '9400111899562537866361' },
  { carrier: 'us.fedex', trackingNumber: '123456789012' },
  { carrier: 'kr.cj', trackingNumber: '1234567890', clientId: 'order-42' },
]);

console.log(response.summary);
// { total: 3, success: 2, failed: 1, usageIncremented: 2 }

for (const result of response.results) {
  if (result.status === 'success') {
    console.log(`${result.carrier}: ${result.data.deliveryStatus}`);
  }
}

Carriers

getCarriers()

List all supported carrier codes.

const carriers = await wp.getCarriers();
// ['kr.cj', 'kr.hanjin', 'us.fedex', 'us.ups', 'us.usps', ...]

getCountries()

List all supported country codes.

const countries = await wp.getCountries();
// ['kr', 'us', 'jp', 'cn', 'de']

getCarriersByCountry(country)

List carriers for a specific country.

const usCarriers = await wp.getCarriersByCountry('us');
// ['us.fedex', 'us.ups', 'us.usps', ...]

getCarriersByRegion(country, region)

List carriers for a specific region.

const caCarriers = await wp.getCarriersByRegion('us', 'ca');
// ['us.ca.ontrac', ...]

Webhooks

registerWebhook(options)

Register webhook tracking for parcels.

// One-time fetch
const result = await wp.registerWebhook({
  trackingItems: [{ carrier: 'us.usps', trackingNumber: '...' }],
});

// Recurring monitoring until delivery
const subscription = await wp.registerWebhook({
  trackingItems: [{ carrier: 'us.usps', trackingNumber: '...' }],
  recurring: true,
  webhookEndpointId: 'endpoint_abc123',
});

getSubscriptions()

List all active webhook subscriptions.

const subscriptions = await wp.getSubscriptions();

Webhook Endpoints

createWebhookEndpoint(options)

Create a URL endpoint to receive webhook events.

const endpoint = await wp.createWebhookEndpoint({
  name: 'Production',
  url: 'https://myapp.com/webhooks/whereparcel',
});

console.log(endpoint.endpointId); // 'endpoint_abc123'
console.log(endpoint.secret);     // 'whsec_...' — use to verify signatures

getWebhookEndpoints()

List all registered webhook endpoints.

const endpoints = await wp.getWebhookEndpoints();

Error Handling

import { WhereParcel, AuthenticationError, RateLimitError } from 'whereparcel';

try {
  const result = await wp.track('us.usps', '...');
} catch (error) {
  if (error instanceof AuthenticationError) {
    console.error('Invalid API credentials');
  } else if (error instanceof RateLimitError) {
    console.error(`Rate limited. Retry after ${error.retryAfter}s`);
  }
}

| Error Class | Status Code | When | |-------------|-------------|------| | AuthenticationError | 401 | Invalid or missing API key | | RateLimitError | 429 | Too many requests | | NotFoundError | 404 | Carrier or country not found | | WhereParcelError | Other | All other API errors |

Tracking Statuses

All carrier statuses are normalized to these values:

| Status | Description | |--------|-------------| | pending | Label created, not yet picked up | | in_transit | Package is in transit | | out_for_delivery | Out for delivery | | delivered | Successfully delivered | | failed | Delivery attempt failed | | returned | Returned to sender | | cancelled | Shipment cancelled | | unknown | Status could not be determined |

Requirements

  • Node.js 18+ (uses native fetch)

Links

License

MIT