Skip to main content
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:
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

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

Account Smart Stats Action

Parameter Details

Time Windows

The following time windows are supported for various endpoints:
  • 1h - Last hour
  • 24h - Last 24 hours
  • 7d - Last 7 days
  • 14d - Last 14 days
  • 30d - Last 30 days

Pagination

Most endpoints support pagination with the following parameters:
  • limit or pageSize - Number of results per page
  • offset or page - Page number or offset for results
  • cursor - 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

  1. Rate Limiting: Monitor your API usage through the key status endpoint
  2. Data Freshness: Social media data can become stale quickly, consider time windows carefully
  3. Error Handling: Implement comprehensive error handling for all API calls
  4. Pagination: For large datasets, implement pagination to avoid timeouts
  5. Date Ranges: For search queries, use reasonable date ranges to optimize performance

Resources