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

# Quickstart

> Get started with Blockline MEV Analytics API in under 5 minutes

# Quickstart Guide

Get up and running with the Blockline API in three simple steps. You'll learn how to authenticate, make your first request, and analyze transaction context.

## Prerequisites

* A Blockline account ([sign up here](https://blockline.soltop.sh))
* A Solana transaction signature to analyze
* Basic knowledge of HTTP APIs and curl/your programming language of choice

## Step 1: Get Your API Key

<Steps>
  <Step title="Sign up for Blockline">
    Visit [blockline.soltop.sh](https://blockline.soltop.sh) and create an account. New users get a free trial to explore the API.
  </Step>

  {" "}

  <Step title="Navigate to API Keys">
    Once logged in, go to [Dashboard → API
    Keys](https://blockline.soltop.sh/dashboard/api-keys)
  </Step>

  <Step title="Generate a new key">
    Click **"Create New API Key"**, give it a name (e.g., "Production"), and save the key securely.

    <Warning>
      Your API key is shown only once! Copy it immediately and store it securely. It looks like: `sk_live_xxxxxxxxxx...`
    </Warning>
  </Step>
</Steps>

## Step 2: Make Your First Request

Let's analyze a Solana transaction to see who traded before and after it.

<CodeGroup>
  ```bash curl theme={null}
  curl -X POST https://api.soltop.sh/analyze-trade \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer sk_live_YOUR_API_KEY" \
    -d '{
      "signature": "pHXgUjY4cVvi5orXuK3b66MBhF2W3MpXruRGKodqTWze7354iVQ66k1rWCzyWTU7UDeebojPTpW9ZmVv9Dn12cg",
      "account_id": "FnmStvzQ27Pm4U8r3M6gPD7mnk6ST6HwraPsoNmYpump",
      "slot_range": 4
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.soltop.sh/analyze-trade", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      Authorization: "Bearer sk_live_YOUR_API_KEY",
    },
    body: JSON.stringify({
      signature:
        "pHXgUjY4cVvi5orXuK3b66MBhF2W3MpXruRGKodqTWze7354iVQ66k1rWCzyWTU7UDeebojPTpW9ZmVv9Dn12cg",
      account_id: "FnmStvzQ27Pm4U8r3M6gPD7mnk6ST6HwraPsoNmYpump",
      slot_range: 4,
    }),
  });

  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://api.soltop.sh/analyze-trade',
      headers={
          'Content-Type': 'application/json',
          'Authorization': 'Bearer sk_live_YOUR_API_KEY'
      },
      json={
          'signature': 'pHXgUjY4cVvi5orXuK3b66MBhF2W3MpXruRGKodqTWze7354iVQ66k1rWCzyWTU7UDeebojPTpW9ZmVv9Dn12cg',
          'account_id': 'FnmStvzQ27Pm4U8r3M6gPD7mnk6ST6HwraPsoNmYpump',
          'slot_range': 4
      }
  )

  data = response.json()
  print(data)
  ```
</CodeGroup>

### Understanding the Request

* **signature**: Your transaction signature (base58-encoded, 87-88 characters)
* **account\_id**: The market/pool address your transaction touched (base58-encoded, 32-44 characters)
* **slot\_range**: Number of slots before/after to search (default: 4, max: 100)

<Tip>
  Don't have a transaction to test with? Use the example signature above to see
  how it works!
</Tip>

## Step 3: Understand the Response

The API returns all transactions that touched the same market within ±4 slots of your transaction:

```json theme={null}
{
  "success": true,
  "data": {
    "original_transaction": {
      "signature": "pHXgUjY4cVvi...",
      "slot": 370537741,
      "poh_tick": 23714415424,
      "signer": "FnmStvzQ27Pm..."
    },
    "results_by_slot": [
      {
        "slot": 370537741,
        "slot_offset": 0,
        "transactions": [
          {
            "signature": "abc123...",
            "poh_tick_offset": -150000,
            "signer": "7xKXtg2CW...",
            "is_original": false
          }
        ]
      }
    ],
    "summary": {
      "total_matching_transactions": 15,
      "slots_with_activity": 3
    }
  }
}
```

### Key Fields Explained

<ResponseField name="poh_tick_offset" type="integer">
  **Negative** = transaction happened before yours (potential front-runner)
  **Zero** = your transaction **Positive** = transaction happened after yours
  (potential back-runner)
</ResponseField>

<ResponseField name="slot_offset" type="integer">
  **Negative** = earlier slot/block **Zero** = same slot as your transaction
  **Positive** = later slot/block
</ResponseField>

## Common Errors

<AccordionGroup>
  <Accordion title="401 Unauthorized">
    **Cause**: Invalid or missing API key
    **Solution**: Check that you're including the `Authorization: Bearer sk_live_...` header with a valid API key
  </Accordion>

  {" "}

  <Accordion title="403 Forbidden">
    **Cause**: Subscription required or expired **Solution**: Ensure your
    subscription is active (trial, active, or grace period) at [your
    dashboard](https://blockline.soltop.sh/dashboard)
  </Accordion>

  {" "}

  <Accordion title="400 Bad Request">
    **Cause**: Invalid signature format or parameters **Solution**: Verify your
    signature is base58-encoded and 87-88 characters long
  </Accordion>

  <Accordion title="429 Too Many Requests">
    **Cause**: Rate limit exceeded (6 requests/minute)
    **Solution**: Wait for the `retry_after_seconds` time before retrying
  </Accordion>
</AccordionGroup>

## Next Steps

Now that you've made your first request, explore more capabilities:

<CardGroup cols={2}>
  <Card title="Detect Front-Running" icon="gauge-high" href="/guides/use-cases#front-running-detection">
    Learn how to identify transactions that front-ran yours
  </Card>

  {" "}

  <Card title="Find Sandwich Attacks" icon="burger" href="/guides/use-cases#mev-sandwich-detection">
    Detect if you were sandwiched by MEV bots
  </Card>

  {" "}

  <Card title="Get Transaction Details" icon="file-invoice" href="/api-reference/openapi#get-/transaction/{signature}">
    Fetch detailed transaction metadata including fees and tokens
  </Card>

  <Card title="Code Examples" icon="code" href="/guides/examples/javascript">
    See complete integration examples in JavaScript and Python
  </Card>
</CardGroup>

<Check>
  **You're all set!** You now know how to authenticate and make requests to the
  Blockline API.
</Check>

## Need Help?

* Read the full [API Reference](/api-reference/openapi)
* Explore [Use Cases & Patterns](/guides/use-cases)
* Check [Error Handling Guide](/guides/error-handling)
* Visit the [Dashboard](https://blockline.soltop.sh)
