Elfa AI Integration
Learn how to use Elfa AI features with Solana Agent Kit for social media intelligence
Solana Agent Kit provides integration with Elfa AI for retrieving social media intelligence, market data, and trend analysis from platforms like Twitter. This documentation covers the available functions and tools for interacting with Elfa AI API.
Overview
Elfa AI integration enables access to:
- Smart mentions detection
- Top mentions by ticker symbol
- Keyword-based mentions search
- Trending tokens analysis
- Twitter account statistics
- API key status monitoring
Configuration
Before using Elfa AI integration, you need to configure your API key in the Solana Agent Kit:
Core Functions
The integration provides several core functions for interacting with the Elfa AI API:
API Health Check
API Key Status
Smart Mentions
Retrieve tweets from smart accounts with high engagement:
Example response:
Top Mentions by Ticker
Retrieve top tweets for a specific ticker symbol:
Example response:
Search Mentions by Keywords
Search for tweets containing specific keywords within a date range:
Example response:
Trending Tokens
Get tokens trending in social media discussions:
Example response:
Twitter Account Smart Stats
Get engagement and influence metrics for a Twitter account:
Example response:
LangChain Tools
For AI agent integration with LangChain, the following tools are available:
Ping Tool
API Key Status Tool
Smart Mentions Tool
Top Mentions Tool
Search Mentions Tool
Trending Tokens Tool
Account Smart Stats Tool
Action Definitions
In addition to functions and tools, Solana Agent Kit provides actions for interacting with Elfa AI:
Ping Action
API Key Status Action
Smart Mentions Action
Top Mentions Action
Search Mentions Action
Trending Tokens Action
Account Smart Stats Action
Parameter Details
Time Windows
The following time windows are supported for various endpoints:
1h
- Last hour24h
- Last 24 hours7d
- Last 7 days14d
- Last 14 days30d
- Last 30 days
Pagination
Most endpoints support pagination with the following parameters:
limit
orpageSize
- Number of results per pageoffset
orpage
- Page number or offset for resultscursor
- For cursor-based pagination (used in search endpoints)
Error Handling
All functions and tools include error handling. Here’s an example of handling errors:
Utility Functions
The integration includes several utility functions:
Create Axios Instance
Integration with AI Agents
For AI agents built with LangChain, you can register these tools:
Best Practices
- Rate Limiting: Monitor your API usage through the key status endpoint
- Data Freshness: Social media data can become stale quickly, consider time windows carefully
- Error Handling: Implement comprehensive error handling for all API calls
- Pagination: For large datasets, implement pagination to avoid timeouts
- Date Ranges: For search queries, use reasonable date ranges to optimize performance