5-Minute Setup
Follow these steps to make your first API request:
Generate Your API Key
Log in to your ElasticFunnels account
Navigate to Settings → API
Click Generate API Key
Copy and securely store your key
Find Your Brand ID
Your brand (project) ID is in the URL when you’re viewing your project: https://app.elasticfunnels.io/123/analytics
^^^
Brand ID
Make Your First Request
Test your authentication by fetching your project details: curl https://app.elasticfunnels.io/api/brands/{brand_id} \
-H "EF-Access-Key: your_api_key_here"
Start Building
You’re ready! Explore the endpoints documentation to build your integration.
Common Use Cases
Sync Conversions to Your CRM
Automatically sync new orders to your CRM or analytics platform:
// Fetch recent conversions
const response = await fetch (
'https://app.elasticfunnels.io/api/brands/123/conversions?page=1&per_page=50' ,
{
headers: {
'EF-Access-Key' : 'your_api_key_here'
}
}
);
const { data } = await response . json ();
// Process each conversion
for ( const order of data ) {
await syncToCRM ({
email: order . customer_email ,
name: order . customer_name ,
revenue: order . total ,
order_id: order . code
});
}
Check split test results programmatically:
import requests
# Get split test results
response = requests.get(
'https://app.elasticfunnels.io/api/brands/123/split-tests/456' ,
headers = { 'EF-Access-Key' : 'your_api_key_here' }
)
split_test = response.json()
# Find the winning variant
winner = next (v for v in split_test[ 'variants' ] if v[ 'is_winner' ])
print ( f "Winner: { winner[ 'name' ] } with { winner[ 'conversion_rate' ] } % CR" )
# Alert if improvement is significant
if winner[ 'conversion_rate' ] > 5.0 :
send_slack_notification( f "🎉 Split test winner: { winner[ 'conversion_rate' ] } % CR!" )
Bulk Create Pages from Templates
Automate page creation for new campaigns:
const campaigns = [
{ name: 'Summer Sale' , slug: 'summer-sale' },
{ name: 'Black Friday' , slug: 'black-friday' },
{ name: 'New Year' , slug: 'new-year' }
];
for ( const campaign of campaigns ) {
const response = await fetch (
'https://app.elasticfunnels.io/api/brands/123/pages' ,
{
method: 'POST' ,
headers: {
'EF-Access-Key' : 'your_api_key_here' ,
'Content-Type' : 'application/json'
},
body: JSON . stringify ({
name: campaign . name ,
slug: campaign . slug ,
type: 'landing' ,
status: 'inactive'
})
}
);
const page = await response . json ();
console . log ( `Created page: ${ page . url } ` );
}
Daily Revenue Report
Generate and email daily performance reports:
from datetime import date, timedelta
import requests
# Get yesterday's metrics
yesterday = date.today() - timedelta( days = 1 )
response = requests.get(
f 'https://app.elasticfunnels.io/api/brands/123/analytics/metrics' ,
params = {
'start_date' : yesterday.isoformat(),
'end_date' : yesterday.isoformat()
},
headers = { 'EF-Access-Key' : 'your_api_key_here' }
)
metrics = response.json()[ 'metrics' ]
# Format report
report = f """
Daily Performance Report - { yesterday }
📊 Visitors: { metrics[ 'visitors' ] :,}
📧 Leads: { metrics[ 'leads' ] :,}
🛒 Orders: { metrics[ 'orders' ] :,}
💰 Revenue: $ { metrics[ 'revenue' ] :,.2f}
📈 AOV: $ { metrics[ 'aov' ] :.2f}
🎯 Conversion Rate: { metrics[ 'conversion_rate' ] :.2f} %
"""
send_email( to = '[email protected] ' , subject = 'Daily Report' , body = report)
Export Conversion Data
Export conversion data for analysis in your BI tool:
# Request export
curl -X POST https://app.elasticfunnels.io/api/brands/123/conversions/export \
-H "EF-Access-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"start_date": "2024-12-01",
"end_date": "2024-12-31"
}'
# Response includes download URL
{
"message" : "Export is being processed",
"export_id" : "exp_abc123",
"download_url" : "https://app.elasticfunnels.io/api/brands/123/exports/exp_abc123/download/token"
}
# Download the file
curl -O "https://app.elasticfunnels.io/api/brands/123/exports/exp_abc123/download/token"
SDKs and Libraries
While ElasticFunnels doesn’t provide official SDKs yet, the API works with any HTTP client library:
JavaScript
fetch (native)
axios
node-fetch
Rate Limiting Best Practices
While rate limits aren’t strictly enforced currently, follow these best practices for optimal performance:
Batch Requests : Fetch multiple items in one request when possible
Cache Responses : Cache data that doesn’t change frequently
Use Pagination : Don’t try to fetch all records at once
Implement Backoff : Retry failed requests with exponential backoff
Example retry logic:
async function fetchWithRetry ( url , options , maxRetries = 3 ) {
for ( let attempt = 0 ; attempt < maxRetries ; attempt ++ ) {
try {
const response = await fetch ( url , options );
if ( response . ok ) {
return await response . json ();
}
// If rate limited, wait before retry
if ( response . status === 429 ) {
const waitTime = Math . pow ( 2 , attempt ) * 1000 ; // Exponential backoff
await new Promise ( resolve => setTimeout ( resolve , waitTime ));
continue ;
}
throw new Error ( `HTTP ${ response . status } ` );
} catch ( error ) {
if ( attempt === maxRetries - 1 ) throw error ;
}
}
}
Next Steps