Griffy API Documentation

Build powerful applications with Griffy's comprehensive API. Access real-time risk analysis, token metrics, and blockchain data for Solana tokens.

Get Started: Sign up for an API key to begin integrating with our platform.

API Features

Base URL

https://api.griffy.tech/v1

Response Format

All API responses are in JSON format and include a standard response object:

{ "status": "success", "data": { ... }, "meta": { "timestamp": "2023-11-15T14:30:00Z", "request_id": "req_123456789" } }

Authentication

All API requests require authentication using API keys. You can generate and manage your API keys in the Developer Dashboard.

Using Your API Key

Include your API key in the Authorization header of all requests:

Authorization: Bearer YOUR_API_KEY

Security Note: Never expose your API keys in client-side code. Keep them secure using environment variables or secret management systems.

Key Types

Key Type Permissions Rate Limit Environment
Test Key Read-only, limited data 10 req/min Development
Production Key Full access 60 req/min Production
Partner Key Extended access, higher limits 120 req/min Production

Rate Limiting

To ensure fair usage and system stability, all API endpoints have rate limits based on your API key type.

429 Too Many Requests

Rate Limit Headers

Each API response includes headers showing your current rate limit status:

X-RateLimit-Limit: 60 X-RateLimit-Remaining: 58 X-RateLimit-Reset: 1637082000

Handling Rate Limits

If you exceed your rate limit, you will receive a 429 status code. Implement exponential backoff in your application to handle these cases gracefully.

// Example retry logic in JavaScript async function makeRequest(url, retries = 3) { try { const response = await fetch(url, { headers: { Authorization: `Bearer ${API_KEY}` } }); if (response.status === 429 && retries > 0) { const resetTime = parseInt(response.headers.get('X-RateLimit-Reset')) * 1000; const delay = resetTime - Date.now() + 1000; // Add 1s buffer await new Promise(resolve => setTimeout(resolve, delay)); return makeRequest(url, retries - 1); } return response.json(); } catch (error) { console.error('API request failed:', error); } }

Risk Analysis Endpoint

Get comprehensive risk assessment for any Solana token. This endpoint analyzes multiple risk factors and returns a detailed risk profile.

GET
/risk-analysis/{token_address}

Path Parameters

Parameter Type Description Required
token_address string Solana token address (base58 encoded) Yes

Query Parameters

Parameter Type Description Required
timeframe string Analysis timeframe (1h, 24h, 7d, 30d) No
include_historical boolean Include historical risk scores No
detailed boolean Return detailed breakdown of risk factors No

Example Request

GET https://api.griffy.tech/v1/risk-analysis/So11111111111111111111111111111111111111112?timeframe=24h&detailed=true Authorization: Bearer YOUR_API_KEY

Response Example

{ "status": "success", "data": { "token_address": "So11111111111111111111111111111111111111112", "symbol": "SOL", "name": "Solana", "risk_level": "low", "risk_score": 89, "analysis": { "liquidity": { "score": 95, "pool_size": "2.5M USD", "pool_health": "excellent" }, "contract": { "score": 92, "verified": true, "vulnerabilities": [] }, "volume": { "score": 87, "authenticity": "high", "wash_trading_detected": false }, "holders": { "score": 85, "top_10_percent": "22.5%", "concentration_risk": "low" } }, "historical_scores": [ { "timestamp": "2023-11-14T12:00:00Z", "score": 87 }, { "timestamp": "2023-11-14T00:00:00Z", "score": 85 } ] }, "meta": { ... } }

SDKs & Libraries

Accelerate your integration with our official SDKs and community libraries:

Official SDKs

  • JavaScript SDK - Full browser and Node.js support
  • Python SDK - For data analysis and backend services
  • Java SDK - Enterprise-grade integration
# Install Python SDK pip install griffy-sdk
// JavaScript SDK usage import Griffy from 'griffy-sdk'; const client = new Griffy({ apiKey: 'YOUR_API_KEY' }); client.riskAnalysis('So111...') .then(data => console.log(data)) .catch(error => console.error(error));

Community Libraries

  • Go - griffy-go by community member
  • Ruby - griffy-ruby gem
  • PHP - Griffy-PHP package
  • .NET - Griffy.NET library

Contribute: Build your own library? Share it with the community and get featured here.

Error Codes

The Griffy API uses standard HTTP status codes and provides detailed error messages in responses.

400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
429 Too Many Requests
500 Server Error

Error Response Format

{ "status": "error", "code": "invalid_token_address", "message": "The provided token address is invalid", "details": { "parameter": "token_address", "value": "invalid_address" }, "meta": { ... } }

Common Error Codes

HTTP Code Error Code Description Solution
400 invalid_parameter Invalid or missing parameter Check request parameters
401 invalid_api_key Invalid or missing API key Verify your API key
403 access_denied Insufficient permissions Upgrade your API plan
404 token_not_found Token address not recognized Verify token address
429 rate_limit_exceeded Too many requests Check rate limit headers
500 server_error Internal server error Retry later or contact support

Best Practices

Follow these recommendations to build robust integrations with the Griffy API:

Secure Your API Keys

Never commit API keys to version control. Use environment variables or secret management systems.

Implement Caching

Cache responses where appropriate to reduce requests and improve performance.

Handle Rate Limits

Use exponential backoff and respect Retry-After headers when rate limited.

Use Webhooks for Real-time Updates

For critical data changes, use our webhook system instead of polling.

Monitor Your Usage

Track your API usage to avoid rate limits and optimize costs.

Webhook Integration

Receive real-time notifications for risk level changes, liquidity events, and other important token activities.

// Example webhook payload { "event": "risk_level_change", "token": "So11111111111111111111111111111111111111112", "previous_level": "medium", "new_level": "low", "timestamp": "2023-11-15T14:35:22Z", "trigger": "liquidity_increase" }

Production Tip: Always verify webhook signatures to ensure they come from Griffy.