# PaquetExpress Tracking Scraper (`blacksequence/paquetexpress-scraper`) Actor

Scrapes shipment tracking details from paquetexpress.com.mx for one or more tracking numbers and outputs structured JSON.

- **URL**: https://apify.com/blacksequence/paquetexpress-scraper.md
- **Developed by:** [blacksequence](https://apify.com/blacksequence) (community)
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## PaquetExpress Tracking Scraper

Apify actor that scrapes shipment tracking details from
[paquetexpress.com.mx](https://www.paquetexpress.com.mx) and outputs structured JSON.

The tracking page renders its data client-side, so the actor drives a headless
browser (Playwright) and transforms the rendered DOM into JSON.

### Input

```json
{
  "trackingNumbers": ["111253951107"]
}
```

| Field | Type | Description |
| --- | --- | --- |
| `trackingNumbers` | string\[] | PaquetExpress tracking numbers (guias) to look up. Required. |
| `markdownOutput` | boolean | Append a human-readable Markdown rendering (`markdown` field) to each output object. Default: `true`. |
| `proxyConfiguration` | object | Optional Apify proxy settings. The site is public; usually not needed. |

### Output

One JSON object per tracking number in the default dataset:

```json
{
  "trackingNumber": "111253951107",
  "guide": "MOCK00WE0000000",
  "reference": "MOCK-REFERENCE-000",
  "shippingDate": "05 De Enero Del 2026",
  "deliveryService": "A domicilio",
  "destinationBranch": "Calle Falsa 123, Colonia Ejemplo",
  "origin": { "code": "ORG01", "cityState": "Ciudad Origen, Estado", "country": "Mexico" },
  "destination": { "code": "DES01", "cityState": "Ciudad Destino, Estado", "country": "Mexico" },
  "status": "Entregado",
  "statusStep": 5,
  "steps": ["Mercancía documentada", "En tránsito", "En sucursal de destino", "Entrega a Domicilio", "Entregado"],
  "estimatedDeliveryDate": "",
  "electronicSignature": { "dataUri": "data:image/png;base64,AAAA...", "mimeType": "image/png", "bytes": 2600 },
  "movements": [
    {
      "time": "10:00",
      "date": "10 De Enero Del 2026",
      "description": "Envío Entregado A Domicilio, recibió nombre",
      "location": "Ciudad Destino, Estado, Mexico"
    }
  ],
  "sourceUrl": "https://www.paquetexpress.com.mx/rastreo/111253951107",
  "scrapedAt": "2026-10-12T00:00:00.000Z",
  "markdown": "## Rastreo 111253951107\n\n- **Gu\u00eda:** MOCK00WE0000000\n- **Estatus:** Entregado (paso 5 de 5)\n..."
}
```

The `electronicSignature.dataUri` field contains the signature image as a base64
PNG data URI (`mimeType` and `bytes` describe it); the `markdown` field is a
human-readable summary of the same record, embedded signature included. Both are
only present when their data exists on the tracking page.

Unknown or invalid tracking numbers produce a record with `"error": "not_found"` and
empty fields instead of crashing the run.

### Run locally

```bash
npm install
npx playwright install chromium
node src/main.js 111253951107
```

The full JSON result array is also printed to stdout at the end of a run.
Multiple numbers are accepted: `node src/main.js 111253951107 111253951102`.

### Run on Apify

Push this repository to Apify (or use `apify push`). The `Dockerfile` and
`.actor/` configuration are already set up; input takes `trackingNumbers`.

# Actor input Schema

## `trackingNumbers` (type: `array`):

List of PaquetExpress tracking numbers (guias) to look up, e.g. \["111253951107"].

## `markdownOutput` (type: `boolean`):

Append a human-readable Markdown rendering to each output object ("markdown" field) and to stdout.

## `proxyConfiguration` (type: `object`):

Optional proxy settings. The site is public; proxies are usually not required.

## Actor input object example

```json
{
  "trackingNumbers": [
    "111253951107"
  ],
  "markdownOutput": true,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

Tracking results, one item per input tracking number

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("blacksequence/paquetexpress-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("blacksequence/paquetexpress-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call blacksequence/paquetexpress-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,blacksequence/paquetexpress-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/ofFSKq1OWKlYvSbV7/builds/tiZzOeQ0QIATAkxG6/openapi.json
