In the world of Web3 and DeFi, security is everything. Rugcheck has quickly become one of the most reliable tools for analyzing smart contracts and protecting investors from scams or "rug pulls." By offering an API, Rugcheck enables developers, traders, and platforms to integrate contract analysis directly into their applications.
A quick guide to get started:
Sign up at Rugcheck.xyz: Create an account and verify your email.
Generate an API key: Access the API section in your dashboard and securely store the key.
Integrate the API: Use programming languages like Python, JavaScript, Rust, or others to connect and authenticate.
Analyze tokens: Scan Solana tokens for risks, assess trust scores, and review security data.
To get started with the Rugcheck API, you’ll need a few tools and accounts. The setup is straightforward, and most developers will already have everything they need. Once ready, you’ll also need to configure your Rugcheck account to manage your API keys.
Start by creating an account on Rugcheck.xyz, which will allow you to generate and manage your API keys. These keys are essential for authenticating every request you make to the API.
After creating your account, navigate to the API section in your dashboard. Look for tabs or options labeled "API", "Developer", or "API Keys." Here, you’ll generate your authentication credentials. Every API request must include your key in the X-API-KEY header.
If you’re working on Solana-specific applications, you’ll also need your Solana private key to generate JWT tokens for authentication.
The Rugcheck API is RESTful, meaning it’s compatible with any programming language or environment capable of making HTTP requests. This versatility allows you to use your preferred tech stack for integration.
Python: A popular choice with detailed documentation. Ensure Python 3.x is installed on your system, along with the requests library (install it via pip install requests). A Python wrapper is available on GitHub, offering examples for automated token risk checks. It includes both a command-line interface and a Python module for seamless integration.
TypeScript/JavaScript: Developers have successfully used the Rugcheck API with projects like degenfrends/solana-rugchecker, which checks Solana tokens, and monsterdev95/sol-rugchecker-raydium, which analyzes new tokens on Raydium.
Other Languages: Rugcheck can also be integrated using Rust, Java, C#, and Go, as long as your environment supports JSON parsing and HTTP headers.
Protecting your API credentials is critical. Here are some best practices to ensure your keys remain secure:
Avoid Hardcoding: Never embed your API key directly in your source code. This practice leaves your credentials exposed and vulnerable to misuse.
Use Environment Variables: Store your API key in environment variables (e.g., os.getenv('RUGCHECK_API_KEY')) or use a dedicated secrets manager. In Python, this is a standard approach to keep sensitive information out of your codebase.
Backend API Calls: For frontend applications, avoid exposing your API key by routing API calls through a backend server. This adds a layer of security by keeping the key hidden from users.
Solana Key Security: For Solana-specific integrations, apply similar practices for storing your private keys. For instance, a Reddit user, filkosmak, showcased a secure method by saving their SOLANA_PRIVATE_KEY in a .env file and using it to generate JWT tokens for API requests to endpoints like /v1/tokens/{token}/report.
Getting started with Rugcheck’s API is simple. All you need to do is create an account, generate an API key, and store it safely. Here’s a step-by-step guide to help you through the process.
Sign up: Go to Rugcheck.xyz and sign up using a valid email address and a strong password.
Verify your email: Check your inbox for a verification email and click the confirmation link. (You won’t be able to generate an API key until you verify your email.)
Login to the dashboard: After verification, log in to your Rugcheck dashboard. This is where you’ll manage your API keys and other credentials.
Go to Developer Section: Inside your dashboard, open the API/Developer section.
Generate a new key: Click the “Generate New API Key” button.
Name your key: Use clear names like Production App or Testing Environment to identify the key later.
Copy your key: Once generated, the API key will be shown on the screen only once. Copy it immediately and store it securely.
Keeping your key secure is as important as generating it. Here’s how:
Use an environment file:
Create a .env file in your project and add your key like this:
Then use libraries (like dotenv) to load this securely in your code.
Secrets management tools:
For production, use secure services like AWS Secrets Manager, Google Secret Manager, or Azure Key Vault. These tools help rotate keys automatically and provide access logs.
Secure environment files:
Limit access so only your app and authorized users can view the file.
Add .env files to .gitignore so they never get uploaded to GitHub or version control systems by mistake.
Integrating the Rugcheck API into your app is simple if you follow the right steps. The main things you’ll need to do are:
Configure your API key securely.
Set up authentication in your code.
Test your setup with a few sample API calls.
Steps:
Before you start making requests, you need to safely store and load your Rugcheck API Key.
Why? Storing keys directly in your code is risky. Instead, use environment variables so your keys stay hidden and secure.
Install the required libraries:
Load your key using dotenv:
Add dependencies to your Cargo.toml:
Create a client:
The Rugcheck API uses Bearer Token Authentication. This means:
Every request must include your API key in the header.
Example format:
Tip: Never print or log your API key in production.
Now that authentication is working, test the endpoints with real data:
Token Scan – Get the risk level of a token.
Source Code – Check if a contract is verified.
Wallet Risk Rating – Assess wallet safety.
Python Example Test:
API Key Security: Always store keys in environment variables.
Rate Limits: Respect limits, use retries with backoff.
Error Handling: Catch timeouts, invalid tokens, and 401/429 errors.
Caching: Cache responses for data that doesn’t change often.
Swagger Docs: Check Rugcheck Swagger UI for the latest endpoints.
Interpret Results Carefully: Tools provide insights, but you must validate data and apply judgment.
With Qodex.ai, you can streamline this process even further. Qodex can automate API testing, security checks, and monitoring—so your Rugcheck API integration becomes more efficient and reliable from day one.
Once you’ve set up your Rugcheck API key, the next step is learning how to make API requests. These requests let you scan tokens, check their security, and generate detailed reports.
The Rugcheck API makes it simple to scan tokens for potential risks. You’ll use the endpoint:
This returns important details like risk level, trust score, scams, warnings, taxes, liquidity, and holder analysis.
Load your API key.
Call the Solana token scan endpoint.
Print results like Risk Level, Trust Score, and Contract Name.
Example:
Use reqwest and serde_json for requests.
Call the token scan endpoint with your API key.
Print Risk Level and Trust Score.
Beyond basic token scans, you can create a detailed security report that brings everything together.
A security report may include:
Risk Assessment → Risk level, trust score, and rating
Threats → Scams and warnings detected
Contract Security → Verification status, owner address, buy/sell taxes
Liquidity Analysis → How liquid the token is
Holder Distribution → Who owns how much of the supply
Example in Python:
This helps you quickly detect issues like:
HONEYPOT (can’t sell)
PROXY_CONTRACT (can change logic anytime)
HIGH_TAXES (huge buy/sell fees)
OWNERSHIP_NOT_RENOUNCED (creator has too much control)
The API response is in JSON format.
You can use it to:
Show results in your dashboard
Build custom alerts for scams
Visualize token health with graphs and charts
Use /tokens/scan/{chain}/{contractAddress} to scan tokens.
Always check risk level, trust score, and warnings before making decisions.
Build security reports for deeper analysis.
Don’t just trust the data — combine it with your own research (DYOR).
After you've successfully integrated and tested the Rugcheck API, the next step is understanding its responses. These responses provide key insights into token security, helping you evaluate risks effectively. Below, we'll break down the critical response fields and their meanings, followed by a comparison table and practical tips for exporting and visualizing the data.
riskLevel: This is your main indicator of token security, with values like LOW, MEDIUM, HIGH, or CRITICAL. A CRITICAL rating signals severe risks, such as honeypots or other malicious activities.
trustScore: This field gives a numerical score (0-100) and a rating (e.g., EXCELLENT, GOOD) to indicate token safety. A score above 80 typically suggests a safer token, while anything below 30 points to higher risks.
scams: This array lists specific threats, such as HONEYPOT, FAKE_TOKEN, or RUG_PULL. Each entry includes a severity level and a contextual message to explain the risk.
contractDetails: This section provides essential contract information. The isVerified boolean confirms if the contract's source code is verified, while fields like ownerAddress and isOwnershipRenounced reveal details about control and ownership.
taxes: This object shows buyTax and sellTax percentages. High sell taxes (over 10%) can be a red flag, as they are often used by honeypot tokens to trap investors.
liquidityDetails: Offers market data, including the dollar value of totalLiquidity and the percentage of liquidityLocked. Low or unlocked liquidity is a potential sign of manipulation.
holderAnalysis: This field examines token distribution. The topHoldersConcentration value highlights how much of the token supply is held by top holders - values above 50% may indicate centralization risks.
Attribute | Advantages | Limitations | Best Use Case |
|---|---|---|---|
| Simple and quick to interpret | Lacks detailed context | Initial screening of tokens |
| Detailed scale (0-100) with clear ratings | May overlook new attack patterns | Comparing tokens' safety |
| Identifies specific threats and severity | Potential for false positives | Thorough security audits |
| Real-time liquidity metrics | Sensitive to rapid market changes | Supporting trading decisions |
| Highlights token concentration risks | Doesn't differentiate legitimate holders | Evaluating long-term investments |
| Clear fee breakdown | Variable fees can exist in legitimate tokens | Planning transaction costs |
Once you've interpreted the API responses, exporting and visualizing the data can help you dive deeper into the analysis. You can convert API responses into formats like CSV for spreadsheet analysis or JSON for integration with analytics tools.
Here’s an example Python script to export data to a CSV file and generate a security summary:
Understanding how to make API requests and analyze response data is essential for building secure and reliable applications. With Rugcheck’s powerful token analysis and Qodex.ai’s advanced API testing and monitoring, developers get a complete toolkit to ensure both functionality and security.
By combining these platforms, you can:
Detect risks in tokens and smart contracts.
Automate testing and streamline your API workflow.
Gain actionable insights to protect users and projects.
Together, Qodex.ai and Rugcheck make API development.
The RugCheck API is a developer-friendly interface that enables you to programmatically access RugCheck’s token risk analysis, contract scanning, liquidity insights, and other security metrics for Solana tokens. By obtaining a RugCheck API key, you unlock the ability to embed token safety checks into your own tools, dashboards, bots or web apps—turning manual risk analysis into automated workflows. With your API key, each request to the RugCheck endpoints (for example, /tokens/scan/{chain}/{contractAddress}) is authenticated so you can retrieve detailed JSON reports about contract vulnerabilities, liquidity status, and holder concentration. In short, the RugCheck API key allows you to move from one-off checks on the website to scale safe integration for trading systems and portfolio tools.
First, you’ll need to register or log into your account on the RugCheck website (rugcheck.xyz). Once logged in, go to your user dashboard and look for a section labeled “API,” “Developer,” or “API Keys.” From there you’ll usually find an option to generate a new key—often you can name it (for example “MyTradingBotKey”) for internal tracking. After the key is created, copy it and store it securely (for instance in environment variables or a password manager), never exposing it in public code or client-side scripts. Finally, verify whether your calls require passing the key in an X-API-KEY HTTP header or in query parameters (the official docs tend to use header authentication). Once set up, you’re ready to make authorized requests to RugCheck’s endpoints. (This method is supported by the Swagger UI and developer documentation.)
Once you have your API key, you can make a simple GET request to an endpoint like /tokens/scan/{chain}/{contractAddress} using a standard HTTP library such as requests in Python. You’ll set up a base URL (for example, https://api.rugcheck.xyz) and include a headers dictionary where "X-API-KEY": <your_api_key>. Optionally you can pass query parameters (such as includeDexScreenerData=true) to enrich the output. If everything is correct, the API returns a JSON response containing fields like riskLevel, liquidityDetails, scams, warnings, topHolders, and so on. From there you can parse and integrate the data into your application logic—e.g. flagging high risks or notifying your users if a token is flagged as suspicious. Be sure to handle HTTP errors and rate limits gracefully. (This flow is outlined in several RugCheck developer guides.)
Through the RugCheck APIs, you can derive a wealth of token analysis data: contract source code verification, liquidity lock status, unlocked supply, top holder percentages, risk scores, flagged warning messages (honeypot checks, admin privileges, unverified functions), and historical events tied to the token. For example, a high riskLevel or “critical” flag is a red flag, while a well-distributed top 10 holder percentage is usually safer. If the liquidityDetails show most of the liquidity is locked or burned, that’s a positive sign; conversely, if the deployer retains huge control over liquidity, that’s a warning. The warnings or “scams” field might highlight specific vulnerabilities like hidden mint rights or freeze functions. By combining several metrics—score, liquidity, holder concentration—you can more confidently separate relatively safer tokens from risky ones. The deeper your logic, the better your decisions will become when you scale automated risk assessment.
When integrating the RugCheck API, treat your API key like a secret: never commit it into public repositories or client-side code, and rotate it periodically if the platform allows. Always store your key in environment variables or secure vaults. Respect any rate limits that RugCheck imposes—if you receive HTTP 429 (Too Many Requests), back off and retry with exponential delay rather than hammering the endpoint. Use caching for relatively static data (e.g., contract source code) so you don’t rerun scans needlessly. Implement retries for transient failures (timeouts or 5xx errors) but enforce reasonable bounds. Monitor key usage and error logs so you can detect anomalies or misuse. Finally, consider logging the call latency and error codes, because performance and stability matter when embedding security logic into production tools.
Once your basic integration is solid, you can scale to batch scanning hundreds or thousands of token addresses in parallel, either via asynchronous request pools or job queues. You might schedule regular rescans to monitor evolving risks, rechecking tokens daily or hourly. A webhook or callback system (if RugCheck supports it) can let you push alerts to your backend the moment a token status changes. You might also build a dashboard that visualizes risk trends, or integrate risk scores into trading algorithms or front ends so users see real-time warnings before they swap. For advanced users, you can cross-reference RugCheck data with on-chain analytics (wallet transactions, volume spikes) to fine-tune scoring or anomaly detection. You may also integrate multi-chain support as RugCheck adds more blockchains, or tie it with NFT or DeFi monitoring tools for holistic security coverage. Over time, your system can evolve from simple query responses into a full risk orchestration engine, empowering traders, bots, or analytics platforms with proactive defenses.
Auto-discover every endpoint, generate functional & security tests (OWASP Top 10), auto-heal as code changes, and run in CI/CD - no code needed.


