A Python-based web scraping application that collects token data from DexScreener and tracks top traders. The application provides REST API endpoints to manage tokens and retrieve top trader information.
- Scrape token data from DexScreener
- Store and manage tokens in database
- Track top traders for specific tokens
- RESTful API endpoints for data access
- Configurable time periods for top trader analysis
- Python
- Quart (async web framework)
- Selenium WebDriver
- BeautifulSoup4
- Prisma (database ORM)
- Chrome WebDriver
GET /api/tokens
- Retrieve all tokensPOST /api/tokens
- Add new token{ "token": "TOKEN_NAME", "chain": "CHAIN_NAME", "address": "TOKEN_ADDRESS" }
DELETE /api/tokens/<token_id>
- Delete a token
GET /api/top-traders/<token_address>
- Get top traders for a specific token- Query Parameters:
- period: Time period (30d, 7d, 3d, 1d)
- limit: Number of traders to return (max 30)
- Query Parameters:
POST /api/scrape
- Trigger manual data scraping
-
Install dependencies:
pip install -r requirements.txt
-
Set up Chrome WebDriver:
The application uses ChromeDriver Manager for automatic driver installation
-
Initialize database:
Configure Prisma connection Run database migrations
-
Configure environment variables:
DATABASE_PROVIDER= DATABASE_URL=
-
Run the application:
python main.py
WebDriver stealth mode implementation Request validation Error handling for API endpoints