Coinglass Liquidation Heatmap avatar
Coinglass Liquidation Heatmap

Pricing

Pay per event

Go to Apify Store
Coinglass Liquidation Heatmap

Coinglass Liquidation Heatmap

Captures high-resolution CoinGlass liquidation heatmap screenshots with Playwright. Supports custom coin, chart type, dimensions, and wait time. Saves images to Key-Value Store and returns direct URLs with full metadata in the dataset.

Pricing

Pay per event

Rating

0.0

(0)

Developer

Mahmoud Alhamdo

Mahmoud Alhamdo

Maintained by Community

Actor stats

0

Bookmarked

4

Total users

0

Monthly active users

4 days ago

Last modified

Share

CoinGlass Liquidation Heatmap Capture

An Apify Actor that captures CoinGlass liquidation heatmap charts as PNG screenshots. The actor navigates to CoinGlass liquidation heatmap pages and captures high-quality screenshots of the heatmap canvas.

Features

  • πŸ“Š Capture CoinGlass liquidation heatmaps for any cryptocurrency
  • 🎯 Automatic canvas detection and capture
  • πŸ–ΌοΈ High-resolution PNG screenshots
  • πŸ“¦ Base64 encoded images in dataset output
  • ☁️ Fully compatible with Apify platform
  • πŸš€ Can run locally or in the cloud
  • 🎨 Support for custom viewport sizes
  • ⏱️ Configurable wait times for page loading

Prerequisites

  • Python 3.8+ (for local development)
  • Apify account (for cloud deployment)
  • Git (for version control)

Local Development

1. Install Dependencies

# Install Python dependencies
pip install -r requirements.txt
# Install Playwright browsers
playwright install chromium

2. Run Locally with Apify SDK

The actor uses Apify SDK which works automatically in local environment:

# Run the actor (Apify CLI automatically reads storage/key_value_stores/default/INPUT.json)
apify run
# Or specify custom input file
apify run --input storage/key_value_stores/default/INPUT.json

3. Local Storage

When running locally, Apify SDK automatically creates:

  • storage/key_value_stores/default/ - Screenshots stored here
  • storage/datasets/default/ - Dataset JSON files stored here

4. Test Input Example

Create storage/key_value_stores/default/INPUT.json file:

{
"coin": "SOL",
"type": "symbol",
"width": 1920,
"height": 1080,
"waitTime": 5,
"headless": false
}

Note:

  • Apify SDK works automatically in local mode - no API token required for local testing
  • On Apify platform, input is provided via Actor input in the console

Input Schema

FieldTypeDefaultDescription
coinstring"SOL"Cryptocurrency symbol (e.g., SOL, BTC, ETH)
typestring"symbol"Chart type (usually "symbol")
widthinteger1920Screenshot width in pixels (800-3840)
heightinteger1080Screenshot height in pixels (600-2160)
waitTimeinteger5Time to wait for page to fully load before screenshot (in seconds, 1-30)
outputFileNamestringnullCustom filename (auto-generated if not provided)
headlessbooleanfalse (locally)Run browser in headless mode (hidden). Default: false locally, true on Apify platform

Output

The actor saves:

  • Screenshot: PNG image in Apify Key-Value store
  • Metadata: JSON record in Apify Dataset with:
    • Coin symbol, type, URL
    • screenshotBase64: Base64 encoded image string (ready to use)
    • screenshotDataUrl: Data URL format (data:image/png;base64,...)
    • Screenshot URL and key (for direct access)
    • Timestamp

Example output:

{
"coin": "SOL",
"type": "symbol",
"url": "https://www.coinglass.com/pro/futures/LiquidationHeatMap?coin=SOL&type=symbol",
"width": 1920,
"height": 1080,
"screenshotBase64": "iVBORw0KGgoAAAANSUhEUgAA...",
"screenshotDataUrl": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
"screenshotUrl": "https://api.apify.com/v2/key-value-stores/.../coinglass_SOL_2024-01-01T12-00-00.png",
"screenshotKey": "coinglass_SOL_2024-01-01T12-00-00.png",
"timestamp": "2024-01-01T12:00:00.000Z"
}

Supported Coins

The actor supports all cryptocurrencies available on CoinGlass, including:

  • SOL (Solana)
  • BTC (Bitcoin)
  • ETH (Ethereum)
  • BNB (Binance Coin)
  • And many more...

GitHub Setup & Deployment

1. Initialize Git Repository

# Initialize git (if not already done)
git init
# Add all files
git add .
# Create initial commit
git commit -m "Initial commit: CoinGlass heatmap capture actor"

2. Push to GitHub

# Create a new repository on GitHub, then:
git remote add origin https://github.com/YOUR_USERNAME/coinglass-heatmap-capture.git
git branch -M main
git push -u origin main

3. Deploy to Apify

  1. Go to Apify Console
  2. Click "Create new" β†’ "Actor"
  3. Select "Deploy from GitHub"
  4. Connect your GitHub account
  5. Select the repository: coinglass-heatmap-capture
  6. Apify will automatically build and deploy your actor

Option B: Deploy via CLI

# Login to Apify
apify login
# Build the actor
apify build
# Push to Apify
apify push

4. Configure GitHub Actions (Optional)

The project includes a GitHub Actions workflow (.github/workflows/deploy.yml) that automatically:

  • Installs dependencies
  • Builds the actor
  • Pushes to Apify on every push to main branch

Setup:

  1. Go to your GitHub repository
  2. Navigate to Settings β†’ Secrets and variables β†’ Actions
  3. Add a new secret named APIFY_TOKEN with your Apify API token
  4. Get your token from: Apify Settings β†’ Integrations

Project Structure

coinglass-heatmap-capture/
β”œβ”€β”€ src/
β”‚ β”œβ”€β”€ main.py # Main actor logic
β”‚ β”œβ”€β”€ __init__.py
β”‚ └── __main__.py
β”œβ”€β”€ .actor/
β”‚ β”œβ”€β”€ actor.json # Apify actor configuration
β”‚ β”œβ”€β”€ input_schema.json # Input schema definition
β”‚ β”œβ”€β”€ dataset_schema.json # Dataset output schema
β”‚ └── output_schema.json # Output schema
β”œβ”€β”€ storage/ # Local storage (gitignored)
β”‚ β”œβ”€β”€ datasets/ # Local dataset storage
β”‚ └── key_value_stores/ # Local key-value storage
β”œβ”€β”€ requirements.txt # Python dependencies
β”œβ”€β”€ Dockerfile # Docker image for Apify platform
β”œβ”€β”€ .gitignore # Git ignore rules
β”œβ”€β”€ README.md # This file
└── AGENTS.md # AI agent instructions

How It Works

  1. Launch Browser: Opens Chromium via Playwright
  2. Navigate: Goes to CoinGlass liquidation heatmap URL with specified coin
  3. Wait for Canvas: Waits for the heatmap canvas to load and render
  4. Capture: Takes PNG screenshot of the canvas element
  5. Save: Stores screenshot in Key-Value store and metadata (with base64) in Dataset

Troubleshooting

Canvas Not Found

  • Increase waitTime value to allow more time for page loading
  • Check if CoinGlass is accessible from your network
  • Verify the coin symbol is correct

Screenshot Quality

  • Increase width and height for higher resolution
  • Ensure waitTime is sufficient for chart to fully render

Page Not Loading

  • Check internet connection
  • Verify CoinGlass website is accessible
  • Increase timeout values if needed

License

ISC

Support

For issues and questions:


Note: This actor is for educational and personal use. Ensure compliance with CoinGlass's Terms of Service when using this tool.