> ## Documentation Index
> Fetch the complete documentation index at: https://sidiorresearchlabs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# BlockScout API

> Complete REST API for querying blockchain data on Paxeer Network

## Overview

Complete REST API for interacting with PaxScan (BlockScout). Query transactions, blocks, addresses, tokens, and network statistics.

> [!NOTE]
>
> **Base URL:** `https://paxscan.io/api/v2`

> [!NOTE]
>
> All endpoints are publicly accessible without authentication.

## Search & Discovery

### Universal Search

**q** `string` *required*

Search query (address, transaction hash, block number, token name)

```bash GET /search theme={null}
curl "https://paxscan.io/api/v2/search?q=USDT"
```

Search for tokens, addresses, blocks, and transactions across the network.

***

### Check Redirect

**q** `string` *required*

Search query to check for redirect

```bash GET /search/check-redirect theme={null}
curl "https://paxscan.io/api/v2/search/check-redirect?q=0x..."
```

Returns redirect information for search results.

## Transactions

### Get Transactions

**filter** `string`

Filter type: `pending` | `validated`

**type** `string`

Transaction type: `token_transfer`, `contract_call`, etc.

**method** `string`

Method name: `approve`, `transfer`, `mint`, etc.

```bash GET /transactions theme={null}
curl "https://paxscan.io/api/v2/transactions?filter=validated&type=token_transfer"
```

Retrieve paginated list of transactions with optional filters.

***

### Get Transaction Details

**transaction\_hash** `string` *required*

Transaction hash

```bash GET /transactions/{transaction_hash} theme={null}
curl "https://paxscan.io/api/v2/transactions/0x..."
```

Get detailed information about a specific transaction.

**Response Example:**

```json theme={null}
{
  "hash": "0x...",
  "block_number": 1234567,
  "from": {
    "hash": "0x..."
  },
  "to": {
    "hash": "0x..."
  },
  "value": "1000000000000000000",
  "gas_used": "21000",
  "gas_price": "1000000000",
  "status": "ok",
  "method": "transfer",
  "timestamp": "2024-01-01T00:00:00Z"
}
```

***

### Get Transaction Token Transfers

```bash GET /transactions/{transaction_hash}/token-transfers theme={null}
curl "https://paxscan.io/api/v2/transactions/0x.../token-transfers?type=ERC-20"
```

Get all token transfers within a transaction.

***

### Get Internal Transactions

```bash GET /transactions/{transaction_hash}/internal-transactions theme={null}
curl "https://paxscan.io/api/v2/transactions/0x.../internal-transactions"
```

Get internal transactions (contract calls) within a transaction.

***

### Get Transaction Logs

```bash GET /transactions/{transaction_hash}/logs theme={null}
curl "https://paxscan.io/api/v2/transactions/0x.../logs"
```

Get all event logs emitted by a transaction.

***

### Get Transaction State Changes

```bash GET /transactions/{transaction_hash}/state-changes theme={null}
curl "https://paxscan.io/api/v2/transactions/0x.../state-changes"
```

Get all state changes caused by a transaction.

## Blocks

### Get Blocks

**type** `string`

Block type: `block` | `uncle` | `reorg`

```bash GET /blocks theme={null}
curl "https://paxscan.io/api/v2/blocks"
```

Retrieve paginated list of blocks.

***

### Get Block Details

**block\_number\_or\_hash** `string` *required*

Block number or hash

```bash GET /blocks/{block_number_or_hash} theme={null}
curl "https://paxscan.io/api/v2/blocks/1000"
```

Get detailed information about a specific block.

***

### Get Block Transactions

```bash GET /blocks/{block_number_or_hash}/transactions theme={null}
curl "https://paxscan.io/api/v2/blocks/1000/transactions"
```

Get all transactions in a specific block.

***

### Get Block Withdrawals

```bash GET /blocks/{block_number_or_hash}/withdrawals theme={null}
curl "https://paxscan.io/api/v2/blocks/1000/withdrawals"
```

Get all withdrawals in a specific block.

## Addresses

### Get Address Details

**address\_hash** `string` *required*

Address hash (0x...)

```bash GET /addresses/{address_hash} theme={null}
curl "https://paxscan.io/api/v2/addresses/0x..."
```

Get detailed information about an address.

**Response Example:**

```json theme={null}
{
  "hash": "0x...",
  "balance": "1000000000000000000",
  "transactions_count": 42,
  "token_transfers_count": 100,
  "is_contract": true,
  "creator_hash": "0x...",
  "creation_tx_hash": "0x..."
}
```

***

### Get Address Counters

```bash GET /addresses/{address_hash}/counters theme={null}
curl "https://paxscan.io/api/v2/addresses/0x.../counters"
```

Get transaction counts and other metrics for an address.

***

### Get Address Transactions

**filter** `string`

Direction filter: `to` | `from`

```bash GET /addresses/{address_hash}/transactions theme={null}
curl "https://paxscan.io/api/v2/addresses/0x.../transactions?filter=from"
```

Get all transactions for a specific address.

***

### Get Address Token Transfers

**type** `string`

Token type: `ERC-20`, `ERC-721`, `ERC-1155`

**filter** `string`

Direction filter: `to` | `from`

```bash GET /addresses/{address_hash}/token-transfers theme={null}
curl "https://paxscan.io/api/v2/addresses/0x.../token-transfers?type=ERC-20"
```

Get all token transfers for an address.

***

### Get Address Token Balances

**type** `string`

Token type: `ERC-20`, `ERC-721`, `ERC-1155`

```bash GET /addresses/{address_hash}/tokens theme={null}
curl "https://paxscan.io/api/v2/addresses/0x.../tokens?type=ERC-20"
```

Get all token balances for an address.

***

### Get Address Balance History

```bash GET /addresses/{address_hash}/coin-balance-history theme={null}
curl "https://paxscan.io/api/v2/addresses/0x.../coin-balance-history"
```

Get historical balance changes for an address.

***

### Get Address Internal Transactions

```bash GET /addresses/{address_hash}/internal-transactions theme={null}
curl "https://paxscan.io/api/v2/addresses/0x.../internal-transactions?filter=to"
```

Get internal transactions involving an address.

***

### Get Address Logs

```bash GET /addresses/{address_hash}/logs theme={null}
curl "https://paxscan.io/api/v2/addresses/0x.../logs"
```

Get all event logs related to an address.

## Tokens

### Get All Token Transfers

```bash GET /token-transfers theme={null}
curl "https://paxscan.io/api/v2/token-transfers"
```

Get paginated list of all token transfers on the network.

***

### Get Tokens

**type** `string`

Token type: `ERC-20` | `ERC-721` | `ERC-1155`

```bash GET /tokens theme={null}
curl "https://paxscan.io/api/v2/tokens?type=ERC-20"
```

Get list of tokens deployed on Paxeer Network.

***

### Get Token Details

**address\_hash** `string` *required*

Token contract address

```bash GET /tokens/{address_hash} theme={null}
curl "https://paxscan.io/api/v2/tokens/0x..."
```

Get detailed information about a specific token.

**Response Example:**

```json theme={null}
{
  "address": "0x...",
  "name": "USD Tether",
  "symbol": "USDT",
  "decimals": 6,
  "type": "ERC-20",
  "total_supply": "1000000000000",
  "holders": 1234,
  "exchange_rate": "1.00"
}
```

***

### Get Token Transfers

```bash GET /tokens/{address_hash}/transfers theme={null}
curl "https://paxscan.io/api/v2/tokens/0x.../transfers"
```

Get all transfers of a specific token.

***

### Get Token Holders

```bash GET /tokens/{address_hash}/holders theme={null}
curl "https://paxscan.io/api/v2/tokens/0x.../holders"
```

Get list of addresses holding a specific token.

## Statistics

### Get Network Statistics

```bash GET /stats theme={null}
curl "https://paxscan.io/api/v2/stats"
```

Get overall network statistics and metrics.

**Response Example:**

```json theme={null}
{
  "total_blocks": 1234567,
  "total_transactions": 9876543,
  "total_addresses": 54321,
  "average_block_time": 2.5,
  "gas_prices": {
    "average": "1000000000",
    "fast": "1500000000",
    "slow": "800000000"
  }
}
```

***

### Get Transaction Chart Data

```bash GET /stats/charts/transactions theme={null}
curl "https://paxscan.io/api/v2/stats/charts/transactions"
```

Get historical transaction count data for charts.

***

### Get Market Chart Data

```bash GET /stats/charts/market theme={null}
curl "https://paxscan.io/api/v2/stats/charts/market"
```

Get historical market data for HPX token.

## Main Page Data

### Get Latest Transactions

```bash GET /main-page/transactions theme={null}
curl "https://paxscan.io/api/v2/main-page/transactions"
```

Get most recent transactions for home page display.

***

### Get Latest Blocks

```bash GET /main-page/blocks theme={null}
curl "https://paxscan.io/api/v2/main-page/blocks"
```

Get most recent blocks for home page display.

***

### Get Indexing Status

```bash GET /main-page/indexing-status theme={null}
curl "https://paxscan.io/api/v2/main-page/indexing-status"
```

Get current blockchain indexing status.

## Code Examples

**JavaScript**

```javascript theme={null}
// Get transaction details
async function getTransaction(hash) {
  const response = await fetch(
    `https://paxscan.io/api/v2/transactions/${hash}`
  );
  const data = await response.json();
  return data;
}

// Get address token balances
async function getTokenBalances(address) {
  const response = await fetch(
    `https://paxscan.io/api/v2/addresses/${address}/tokens?type=ERC-20`
  );
  const data = await response.json();
  return data;
}

// Get latest blocks
async function getLatestBlocks() {
  const response = await fetch(
    'https://paxscan.io/api/v2/main-page/blocks'
  );
  const data = await response.json();
  return data;
}
```

**Python**

```python theme={null}
import requests

# Get transaction details
def get_transaction(hash):
    url = f'https://paxscan.io/api/v2/transactions/{hash}'
    response = requests.get(url)
    return response.json()

# Get address token balances
def get_token_balances(address):
    url = f'https://paxscan.io/api/v2/addresses/{address}/tokens'
    params = {'type': 'ERC-20'}
    response = requests.get(url, params=params)
    return response.json()

# Get latest blocks
def get_latest_blocks():
    url = 'https://paxscan.io/api/v2/main-page/blocks'
    response = requests.get(url)
    return response.json()
```

**cURL**

```bash theme={null}
# Get transaction details
curl "https://paxscan.io/api/v2/transactions/0x..."

# Get address token balances
curl "https://paxscan.io/api/v2/addresses/0x.../tokens?type=ERC-20"

# Get latest blocks
curl "https://paxscan.io/api/v2/main-page/blocks"

# Search for token
curl "https://paxscan.io/api/v2/search?q=USDT"
```

## React Hook Example

```typescript useBlockScoutAPI.ts theme={null}
import { useState, useEffect } from 'react';

export function useTransactionDetails(hash: string) {
  const [data, setData] = useState(null);
  const [loading, setLoading] = useState(true);
  const [error, setError] = useState(null);

  useEffect(() => {
    if (!hash) return;

    async function fetchTransaction() {
      try {
        const response = await fetch(
          `https://paxscan.io/api/v2/transactions/${hash}`
        );
        if (!response.ok) throw new Error('Transaction not found');
        const data = await response.json();
        setData(data);
      } catch (err) {
        setError(err.message);
      } finally {
        setLoading(false);
      }
    }

    fetchTransaction();
  }, [hash]);

  return { data, loading, error };
}

export function useAddressTokens(address: string) {
  const [tokens, setTokens] = useState([]);
  const [loading, setLoading] = useState(true);

  useEffect(() => {
    if (!address) return;

    async function fetchTokens() {
      try {
        const response = await fetch(
          `https://paxscan.io/api/v2/addresses/${address}/tokens?type=ERC-20`
        );
        const data = await response.json();
        setTokens(data.items || []);
      } catch (error) {
        console.error('Error fetching tokens:', error);
      } finally {
        setLoading(false);
      }
    }

    fetchTokens();
  }, [address]);

  return { tokens, loading };
}
```

## Pagination

Most list endpoints support pagination with these query parameters:

**page** `number`

Page number (starts at 1)

**items\_count** `number`

Number of items per page (default: 50, max: 100)

```bash Example theme={null}
curl "https://paxscan.io/api/v2/transactions?page=2&items_count=25"
```

## Rate Limiting

* **No authentication required**
* **No rate limits** on public endpoints
* Responses may be cached for performance

## Error Handling

API returns standard HTTP status codes:

| Code | Description |
| - | - |
| 200 | Success |
| 400 | Bad Request |
| 404 | Not Found |
| 422 | Unprocessable Entity |
| 500 | Internal Server Error |

## Resources

> **[PaxScan](https://paxscan.io)**
>
> Explore the blockchain

> **[API Documentation](https://paxscan.io/api-docs)**
>
> Complete API docs

> **[Network Stats](https://paxscan.io/stats)**
>
> View network statistics

> **[Community](https://paxeer.app/community)**
>
> Get support

## Next Steps

> **[Quick Start](https://sidiorresearchlabs.mintlify.site/quickstart.md)**
>
> Get started with Paxeer Network

> **[Examples](https://sidiorresearchlabs.mintlify.site/examples.md)**
>
> View integration examples


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.