> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://docs.prividium.com/api/mcp` to find what you need.
>
> **Have feedback?** Use `submit_feedback` on the same MCP server.

The Prividium Block Explorer provides a REST API for querying blockchain data such as transactions, accounts, blocks,
and contracts. Like other Prividium services, the API requires authentication.

## Authentication

The Block Explorer API uses the same authentication mechanism as other Prividium services. You must obtain an access
token using the [SIWE authentication flow](/developers/scripting/programmatic-token-management) and include it
as a Bearer token in your requests.

:::info[IMPORTANT]
The Block Explorer API requires admin role permissions. Contact your network administrator if you need access.
:::

### Request Headers

| Header          | Value                   |
| --------------- | ----------------------- |
| `Authorization` | `Bearer <access-token>` |

## API Documentation

The full API documentation is available at your Block Explorer API service:

```
https://<your-block-explorer-api>/docs
```

This Swagger UI provides interactive documentation for all available endpoints.

## Example Request

```bash
# First, obtain a token using the SIWE flow (see programmatic token management guide)
TOKEN="your-access-token"

# Query the API with the Bearer token
curl -X GET "https://block-explorer-api.prividium.dev/api/stats" \
  -H "Authorization: Bearer $TOKEN"
```

## Example with JavaScript

**explorer.ts**

```typescript
const BLOCK_EXPLORER_API = 'http://localhost:3002';

async function queryBlockExplorer(token: string, endpoint: string) {
    const response = await fetch(`${BLOCK_EXPLORER_API}${endpoint}`, {
        headers: {
            Authorization: `Bearer ${token}`
        }
    });
    return response.json();
}

// Usage
export async function getExplorerData() {
    const session = await prividium.authorize();
    const token = session.rawToken;
    const stats = await queryBlockExplorer(token, '/api/stats/ethprice');
    const txlist = await queryBlockExplorer(token, `/api?module=account&action=txlist&address=${ACCOUNT_ADDRESS}`);

    return { stats, txlist };
}
```

## Next Steps

* [Programmatic Token Management](/developers/scripting/programmatic-token-management) - Learn how to obtain
  and refresh access tokens
* [Contract Deployment and Scripting](/developers/scripting/contract-deployment-scripting) - Deploy contracts
  and interact with the RPC
