# MEV Protect API.

> A server-to-server path for platforms that send transactions from their own backend: one base URL per chain, one key for all of them.

## Endpoint

One base URL per chain, with the chain's id in the path. The same key works on every chain your account sends on.

Base URL

```
https://api.mevlabs.xyz/v1/<chain>
```

- **BSC**: https://api.mevlabs.xyz/v1/bsc
- **Arbitrum**: https://api.mevlabs.xyz/v1/arbitrum
- **Base**: https://api.mevlabs.xyz/v1/base
- **Robinhood**: https://api.mevlabs.xyz/v1/robinhood
- **Arc**: https://api.mevlabs.xyz/v1/arc
- **Elysium**: https://api.mevlabs.xyz/v1/elysium

## Authentication

Send your key as a bearer token on every request. Keep it on your server; it must not ship in a client. Every error has the same shape (see Errors).

Header

```
Authorization: Bearer mp_live_…
```

Response · 401

```
{
  "error": {
    "code": "revoked_key",
    "message": "This key was revoked. Make a new one in the dashboard."
  }
}
```

**See also**: [API keys](https://www.mevlabs.xyz/docs/api-keys.md), [Errors](https://www.mevlabs.xyz/docs/errors.md)

## Submit a transaction

Post a signed transaction to the chain it is for. The answer is its hash, or an error. Sending the same transaction again returns the same hash: nothing is sent twice.

POST /v1/{chain}/transactions

```
curl https://api.mevlabs.xyz/v1/base/transactions \
  -H "Authorization: Bearer mp_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "rawTransaction": "0x02f8…" }'
```

Response · 202

```
{ "hash": "0x9fc3…c8e0" }
```

Response · 400

```
{
  "error": {
    "code": "chain_mismatch",
    "message": "The transaction is signed for arbitrum; the URL is for base."
  }
}
```

- `rawTransaction`: The signed transaction, hex encoded. It is executed exactly as signed. A transaction signed for another chain than the URL's is refused with `chain_mismatch`.

**See also**: [Errors](https://www.mevlabs.xyz/docs/errors.md)

## Read a transaction

Ask for a transaction by its hash, on the chain it was sent on. The answer is a transaction object.

GET /v1/{chain}/transactions/{hash}

```
curl https://api.mevlabs.xyz/v1/base/transactions/0x9fc3…c8e0 \
  -H "Authorization: Bearer mp_live_…"
```

Response · 200

```
{
  "hash": "0x9fc3…c8e0",
  "chain": "base",
  "status": "rebated",
  "submittedAt": 1763286112417,
  "block": { "number": 38117387, "position": 45, "timestamp": 1763286114 },
  "backrun": { "hash": "0x4796…4527", "number": 38117387, "position": 46 },
  "rebate": { "to": "0x18da…4954", "amount": "…", "usd": "…" }
}
```

Response · 404

```
{
  "error": {
    "code": "not_found",
    "message": "No transaction with this hash was sent with your keys on base."
  }
}
```

**See also**: [Transaction](https://www.mevlabs.xyz/docs/transaction.md), [Errors](https://www.mevlabs.xyz/docs/errors.md)

## List transactions

The transactions sent with your keys on one chain, newest first, a page at a time. Pass the cursor of a page to get the next one.

GET /v1/{chain}/transactions

```
curl "https://api.mevlabs.xyz/v1/base/transactions?status=rebated&limit=50" \
  -H "Authorization: Bearer mp_live_…"
```

Response · 200

```
{
  "data": [ { "hash": "0x9fc3…c8e0", "status": "rebated", … } ],
  "nextCursor": "c_8f2a…"
}
```

Response · 400

```
{
  "error": {
    "code": "invalid_request",
    "message": "status must be one of pending, protected, rebated, reverted, dropped, expired."
  }
}
```

- `status`: Optional. One of the statuses.
- `key`: Optional. The id of one of your keys.
- `since`: Optional. Only transactions submitted at or after this time, as a Unix timestamp in milliseconds.
- `limit`: Optional. Up to 100; 50 when left out.
- `cursor`: Optional. The `nextCursor` of the page before. A page with no `nextCursor` is the last.

**See also**: [Transaction](https://www.mevlabs.xyz/docs/transaction.md), [Errors](https://www.mevlabs.xyz/docs/errors.md)

## Revert protection

On chains with revert protection, a key can keep transactions that would revert out of the block, so no gas is paid for them. It is off until you turn it on for the key in the dashboard. The submit answers the same either way; such a transaction ends as `dropped`.

**See also**: [API keys](https://www.mevlabs.xyz/docs/api-keys.md), [Transaction](https://www.mevlabs.xyz/docs/transaction.md)

## WebSocket

One connection per chain. Each submit is answered with the hash or an error, as over HTTPS. To follow what happens to a transaction, read it over HTTPS or receive webhooks. Send your key in the Authorization header when you open the connection.

URL

```
wss://api.mevlabs.xyz/v1/<chain>/ws
```

Submit

```
{
  "id": 1,
  "method": "submit",
  "params": { "rawTransaction": "0x02f8…" }
}
```

Reply

```
{ "id": 1, "result": { "hash": "0x9fc3…c8e0" } }
```

Reply · error

```
{
  "id": 1,
  "error": {
    "code": "nonce_too_low",
    "message": "A transaction with this nonce from this sender is already included."
  }
}
```

- `id`: Any number you choose. The reply to a message carries the same id.
- `result`: The transaction's hash. When the submit is refused, `error` comes back in its place, in the same shape as over HTTPS.

**See also**: [Errors](https://www.mevlabs.xyz/docs/errors.md)

---

Page: https://www.mevlabs.xyz/docs/api · [All pages](https://www.mevlabs.xyz/llms.txt)
