# Shipping rates API for AI agents (Pirate Ship, USPS, UPS) (/use-cases/shipping-rates)

Ask "what is the cheapest way to ship a 2 lb box from New York to Los Angeles?" and your agent gets back every USPS and UPS service with its price, the retail price it beats and the delivery estimate. The cheapest, fastest and best-value rows are flagged.

Pirate Ship prices labels at commercial discounts but publishes no API. Use Bowmark when your agent needs to know what a package will cost and how fast it arrives. If you need to buy and print labels in code, use a shipping API such as EasyPost or Shippo.

## What you can call

| Function                                | What it does                                                                        |
| --------------------------------------- | ----------------------------------------------------------------------------------- |
| `bowmark.providers.pirateship.getRates` | Every USPS and UPS rate for a package, with `cheapest`, `fastest` and `best` flags. |

## Try it

```js
const rates = await bowmark.providers.pirateship.getRates(
  '10001', '90001', 32, { length: 10, width: 8, height: 6 },
);
const cheapest = rates.find((r) => r.cheapest);
return {
  count: rates.length,
  cheapest: [cheapest.title, cheapest.totalPrice, cheapest.crossedTotalPrice],
};
```

Pass a 5-digit origin ZIP, a destination ZIP or country name, the weight in ounces and the box size in inches. `isResidential` defaults to true. Pass false for a business address.

Add the MCP server to Claude Code with this command, then ask your agent. Other clients are on [Installation](/docs/installation).

```sh
claude mcp add bowmark --transport http https://api.bowmark.ai/mcp --header "Authorization: Bearer $BOWMARK_API_KEY"
```

## FAQ

### Is there a Pirate Ship API?

Pirate Ship does not publish one. Bowmark returns the rates its calculator shows as typed rows, with one key and no Pirate Ship account.

### Can it buy a label?

No. It compares rates only. Buy the label on pirateship.com, or use a shipping API if you need labels in code.

### What does it cost?

Your first $10 is free, then you pay per call. See [Pricing](/docs/pricing).

## Next

Follow the [Quickstart](/docs/quickstart), or see [Shopping prices](/use-cases/shopping-prices).
