# AyMakan Tracking API & MCP

URL: https://docs.lastscanned.com/carriers/aymakan

Query live **AyMakan** (`aymakan`) package status and scan history in a single synchronous `GET` request or MCP tool call.

## Overview & Quick Facts

| Property | Value |
|---|---|
| **Carrier slug (`?carrier=`)** | `aymakan` |
| **Brand aliases** | Aymakan, Ay Makan, AyMakan Logistics |
| **Category** | Domestic parcels (Saudi Arabia) |
| **Single-package REST endpoint** | `GET https://api.lastscanned.com/v1/track/{trackingNumber}` |
| **Batch REST endpoint** | `GET https://api.lastscanned.com/v1/track?numbers=...,...` |
| **MCP server (`https://mcp.lastscanned.com`)** | `track_package`, `track_packages`, `list_carriers` |
| **Authentication & pricing** | `Authorization: Bearer lsk_live_...` · 1 free keyless lookup/day per IP |

## Tracking Number Formats & Auto-Detection

| Pass | Rule / Regex | Check Digit | Examples |
|---|---|---|---|
| **Pass 1 (`matches`)** | `/^AY\d{9,11}$/` | none | `AY12345678901` |
| **Pass 2 (`mayMatch`)** | none | none | none |

`matches` takes `AY` plus 9 to 11 digits. `mayMatch` is empty.

## Synchronous `GET` Request & Normalized JSON Response

```bash
curl -s "https://api.lastscanned.com/v1/track/AY12345678901?carrier=aymakan" \
  -H "Authorization: Bearer $LASTSCANNED_API_KEY"
```

```json
{
  "carrier": "aymakan",
  "trackingNumber": "AY12345678901",
  "status": "delivered",
  "statusDescription": "Shipment is delivered to customer - Received by Sample Receiver",
  "service": null,
  "deliveredAt": null,
  "deliveredAtLocal": "2026-03-05",
  "signedBy": "Sample Receiver",
  "destination": null,
  "events": [
    {
      "timestamp": null,
      "localTime": "2026-03-05",
      "status": "delivered",
      "description": "Shipment is delivered to customer - Received by Sample Receiver",
      "location": null,
      "code": null
    },
    {
      "timestamp": null,
      "localTime": "2026-03-05",
      "status": "out_for_delivery",
      "description": "Shipment is out for its final destination.",
      "location": null,
      "code": null
    },
    {
      "timestamp": null,
      "localTime": "2026-03-05",
      "status": "in_transit",
      "description": "Received at Riyadh Warehouse",
      "location": null,
      "code": null
    },
    {
      "timestamp": null,
      "localTime": "2026-03-05",
      "status": "in_transit",
      "description": "Shipment is received at hub",
      "location": null,
      "code": null
    },
    {
      "timestamp": null,
      "localTime": "2026-03-01",
      "status": "label_created",
      "description": "Shipment is created at collection point",
      "location": null,
      "code": null
    }
  ]
}
```

## Notes

- **Source**: the server-rendered tracking page `aymakan.com/tracking/{number}`. No account is needed.
- **Dates only**: AyMakan prints a weekday and day (`Sat, Apr 05`) with no year and no time. The year is the latest one in which that date falls on that weekday. `timestamp` is `null` and `localTime` is a date.
- **`signedBy`**: read from the `Received by …` part of the delivered scan.

## Related Resources

- **Regex & check digits**: [Tracking number formats & auto-detection](/formats)
