Documentation
Get started with AI Excel Services in minutes. This guide will walk you through setup and your first API call.
Quick Start Guide
Step 1: Get Your API Key
- Sign up for a free account at dashboard
- Navigate to your dashboard
- Copy your API key (starts with
sk_)
Step 2: Test Your API Key
Try this in your browser (replace YOUR_API_KEY):
https://your-domain.com/api/enrich-company.php?company=Microsoft&api_key=YOUR_API_KEY
Step 3: Integrate with Excel
Choose your preferred method:
- VBA Functions - Easiest, copy/paste our code
- Power Query - Most powerful for batch operations
- WEBSERVICE() - Simplest, built into Excel
Authentication
All API requests require authentication using your API key.
Methods
Include your API key in one of two ways:
1. Query Parameter (Recommended)
GET /api/enrich-company.php?company=Acme&api_key=YOUR_KEY
2. HTTP Header
GET /api/enrich-company.php?company=Acme
X-API-Key: YOUR_KEY
Rate Limits & Credits
Rate Limits
| Plan | Requests/Hour | Requests/Day |
|---|---|---|
| Free | 100 | 1,000 |
| Pro | 500 | 10,000 |
| Enterprise | Unlimited | Unlimited |
Credit Costs
| Service | Credits | Notes |
|---|---|---|
| Company Enrichment | 1 | Per successful enrichment |
| Email Finder | 1 | 0.1 if not found |
| Text Analysis | 0.1-0.5 | Based on text length |
| Cached Results | 0 | Free! |
VBA Integration
The easiest way to use AI Excel Services in Excel.
Setup Instructions
- Open Excel and press Alt + F11 to open VBA Editor
- Click Insert → Module
- Copy and paste the code below
- Update the
API_KEYconstant with your key - Save and close VBA Editor
VBA Code
' AI Excel Services VBA Module
Const API_BASE_URL As String = "https://your-domain.com/api/"
Const API_KEY As String = "your_api_key_here"
' Company Enrichment
Function AICompanyIndustry(companyName As String) As String
Dim url As String
url = API_BASE_URL & "enrich-company.php?api_key=" & API_KEY
url = url & "&company=" & WorksheetFunction.EncodeURL(companyName)
Dim json As String
json = MakeAPICall(url)
AICompanyIndustry = ParseJSON(json, "industry")
End Function
Function AICompanyEmployees(companyName As String) As String
Dim url As String
url = API_BASE_URL & "enrich-company.php?api_key=" & API_KEY
url = url & "&company=" & WorksheetFunction.EncodeURL(companyName)
Dim json As String
json = MakeAPICall(url)
AICompanyEmployees = ParseJSON(json, "employee_count")
End Function
' Email Finder
Function AIFindEmail(personName As String, companyName As String) As String
Dim url As String
url = API_BASE_URL & "find-email.php?api_key=" & API_KEY
url = url & "&name=" & WorksheetFunction.EncodeURL(personName)
url = url & "&company=" & WorksheetFunction.EncodeURL(companyName)
Dim json As String
json = MakeAPICall(url)
AIFindEmail = ParseJSON(json, "email")
End Function
' Sentiment Analysis
Function AISentiment(text As String) As String
Dim url As String
url = API_BASE_URL & "analyze-text.php?api_key=" & API_KEY
url = url & "&text=" & WorksheetFunction.EncodeURL(text)
url = url & "&analysis_type=sentiment"
Dim json As String
json = MakeAPICall(url)
AISentiment = ParseJSON(json, "sentiment")
End Function
' Helper Functions
Private Function MakeAPICall(url As String) As String
Dim http As Object
Set http = CreateObject("MSXML2.XMLHTTP")
http.Open "GET", url, False
http.send
If http.Status = 200 Then
MakeAPICall = http.responseText
Else
MakeAPICall = "ERROR: " & http.Status
End If
End Function
Private Function ParseJSON(json As String, key As String) As String
' Simple JSON parser - extracts value for a key
Dim searchStr As String
searchStr = """" & key & """:"
Dim startPos As Long
startPos = InStr(json, searchStr)
If startPos = 0 Then
ParseJSON = ""
Exit Function
End If
startPos = startPos + Len(searchStr)
' Skip whitespace and quotes
Do While Mid(json, startPos, 1) = " " Or Mid(json, startPos, 1) = """"
startPos = startPos + 1
Loop
Dim endPos As Long
endPos = InStr(startPos, json, """")
If endPos = 0 Then endPos = InStr(startPos, json, ",")
If endPos = 0 Then endPos = InStr(startPos, json, "}")
If endPos > startPos Then
ParseJSON = Mid(json, startPos, endPos - startPos)
Else
ParseJSON = ""
End If
End Function
Usage Examples
=AICompanyIndustry("Microsoft")
=AICompanyEmployees("Apple")
=AIFindEmail("Tim Cook", "Apple")
=AISentiment(A2)
Power Query Integration
Best for batch processing multiple companies or contacts.
Batch Company Enrichment
let
ApiKey = "your_api_key_here",
ApiBaseUrl = "https://your-domain.com/api/",
// Get source table
Source = Excel.CurrentWorkbook(){[Name="Companies"]}[Content],
// Function to enrich
EnrichCompany = (companyName as text) =>
let
Url = ApiBaseUrl & "enrich-company.php?api_key=" & ApiKey
& "&company=" & Uri.EscapeDataString(companyName),
Response = Json.Document(Web.Contents(Url)),
Data = Response[data]
in
Data,
// Add enrichment
AddedEnrichment = Table.AddColumn(Source, "Data",
each EnrichCompany([Company])),
// Expand data
ExpandedData = Table.ExpandRecordColumn(AddedEnrichment, "Data",
{"industry", "employee_count", "headquarters"},
{"Industry", "Employees", "Location"})
in
ExpandedData
WEBSERVICE() Function
Simplest method using Excel's built-in function.
Basic Usage
=WEBSERVICE("https://your-domain.com/api/enrich-company.php?company=Microsoft&api_key=YOUR_KEY")
Extract Specific Values
Use FILTERXML to parse JSON response:
=FILTERXML(WEBSERVICE("..."), "//industry")
API Reference: Company Enrichment
/api/enrich-company.php
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
company |
string | Yes* | Company name to enrich |
domain |
string | No | Company domain (improves accuracy) |
api_key |
string | Yes | Your API key |
* Either company or domain required
Response
{
"success": true,
"data": {
"company_name": "Microsoft",
"domain": "microsoft.com",
"industry": "Technology",
"employee_count": "200,000+",
"revenue_estimate": "$211 billion",
"founded_year": 1975,
"headquarters": "Redmond, Washington",
"description": "Leading technology company...",
"linkedin_url": "https://linkedin.com/company/microsoft",
"twitter_url": "https://twitter.com/microsoft",
"confidence_score": 0.9
},
"cached": false,
"credits_used": 1,
"credits_remaining": 99
}
API Reference: Email Finder
/api/find-email.php
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name |
string | Yes | Person's full name |
company |
string | Yes* | Company name |
domain |
string | No | Company domain |
api_key |
string | Yes | Your API key |
Response
{
"success": true,
"data": {
"name": "John Smith",
"email": "john.smith@acme.com",
"verified": true,
"confidence": 0.85,
"title": "Software Engineer",
"linkedin_url": "https://linkedin.com/in/johnsmith",
"company": "Acme Corp",
"domain": "acme.com"
},
"credits_used": 1
}
API Reference: Text Analysis
/api/analyze-text.php
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
text |
string | Yes | Text to analyze (max 10,000 chars) |
analysis_type |
string | Yes | sentiment | categorize | extract | summarize |
categories |
string | No | Comma-separated categories (for categorize) |
extract_type |
string | No | email,phone,url,date (for extract) |
api_key |
string | Yes | Your API key |
Response (Sentiment)
{
"success": true,
"data": {
"sentiment": "positive",
"confidence": 0.95,
"explanation": "Strong positive language detected"
},
"credits_used": 0.1
}
Code Examples
cURL
curl "https://your-domain.com/api/enrich-company.php?company=Microsoft&api_key=YOUR_KEY"
Python
import requests
url = "https://your-domain.com/api/enrich-company.php"
params = {
"company": "Microsoft",
"api_key": "YOUR_KEY"
}
response = requests.get(url, params=params)
data = response.json()
print(data)
JavaScript
const url = 'https://your-domain.com/api/enrich-company.php';
const params = new URLSearchParams({
company: 'Microsoft',
api_key: 'YOUR_KEY'
});
fetch(`${url}?${params}`)
.then(response => response.json())
.then(data => console.log(data));
Troubleshooting
Common Errors
401 - Invalid API Key
Cause: API key is missing, incorrect, or expired.
Solution: Verify your API key in the dashboard and ensure it's properly included in requests.
402 - Insufficient Credits
Cause: Your account has run out of credits.
Solution: Add more credits or upgrade your plan.
429 - Rate Limit Exceeded
Cause: Too many requests in a short time.
Solution: Wait a few minutes or upgrade to a higher tier.
CORS Errors
Cause: Browser blocking cross-origin requests.
Solution: Use the proxy.php script provided in the website package.