Skip to main content

Overview

The Sourcing API provides AI-powered company discovery using Exa’s semantic search engine to find companies matching specific criteria. Base Path: /api/sourcing

Endpoints

Search Companies

Search for companies using natural language or specific criteria.
POST /api/sourcing/search
Request Body:
{
  "query": "Find B2B SaaS companies in healthcare with 50-200 employees and $5-20M revenue",
  "filters": {
    "industry": ["Healthcare", "Medical Technology"],
    "revenue_range": {
      "min": 5000000,
      "max": 20000000
    },
    "employee_range": {
      "min": 50,
      "max": 200
    },
    "location": ["United States"],
    "founded_after": 2015
  },
  "limit": 20
}
Example Request:
curl -X POST \
  -H "Authorization: Bearer TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "B2B SaaS companies in healthcare",
    "limit": 10
  }' \
  "http://localhost:8000/api/sourcing/search"
Response:
{
  "results": [
    {
      "name": "HealthTech Solutions",
      "domain": "healthtech.com",
      "description": "B2B SaaS platform for hospital management",
      "industry": "Healthcare Technology",
      "estimated_revenue": 12000000,
      "estimated_employees": 85,
      "founded": 2018,
      "location": "Boston, MA",
      "website": "https://healthtech.com",
      "linkedin": "https://linkedin.com/company/healthtech",
      "relevance_score": 0.92
    }
  ],
  "total": 20,
  "query_id": "ff0e8400-e29b-41d4-a716-446655441000"
}

Save to CRM

Save sourced company to CRM.
POST /api/sourcing/save-to-crm
Request Body:
{
  "company_data": {
    "name": "HealthTech Solutions",
    "website": "https://healthtech.com",
    "industry": "Healthcare Technology",
    "revenue": 12000000,
    "employees": 85,
    "location": "Boston, MA"
  },
  "source": "exa_sourcing",
  "query_id": "ff0e8400-e29b-41d4-a716-446655441000"
}
Response:
{
  "company_id": "gg0e8400-e29b-41d4-a716-446655441111",
  "message": "Company added to CRM",
  "duplicate_check": {
    "is_duplicate": false,
    "potential_matches": []
  }
}

Query Examples

Natural Language

{
  "query": "Find cybersecurity startups in NYC founded after 2020"
}

Industry-Specific

{
  "query": "Manufacturing companies with automation technology in the Midwest"
}

Growth-Focused

{
  "query": "Fast-growing e-commerce companies with 100%+ YoY growth"
}

Geographic

{
  "query": "Fintech companies in London or Berlin"
}

Response Fields

FieldTypeDescription
namestringCompany name
domainstringPrimary domain
descriptionstringCompany description
industrystringPrimary industry
estimated_revenuenumberEstimated annual revenue
estimated_employeesnumberEstimated employee count
foundedintegerYear founded
locationstringHeadquarters location
websitestringCompany website
linkedinstringLinkedIn URL
relevance_scorenumberMatch quality (0-1)

Frontend Integration

async function searchCompanies(query: string) {
  const response = await fetch('http://localhost:8000/api/sourcing/search', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${token}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({ query, limit: 20 })
  })

  const data = await response.json()
  return data.results
}

// Save to CRM
async function saveToCRM(company: any) {
  const response = await fetch('http://localhost:8000/api/sourcing/save-to-crm', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${token}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({ company_data: company })
  })

  return response.json()
}

Configuration

# Environment variable
EXA_API_KEY=your-exa-api-key

Next Steps