API Documentation

Lead submission API reference

Overview

The LeadMarket API lets you submit leads programmatically from any source. Each submission is scored in real time (0–100) and returns an estimated payout. Leads are immediately routed to active buyers upon acceptance.

Endpoint
POST /api/trpc/affiliate.submitLeadViaApi
Content-Type
application/json
Authentication
apiKey field in body

Quick Start

bash
curl -X POST https://leadmarket.app/api/trpc/affiliate.submitLeadViaApi \
  -H "Content-Type: application/json" \
  -d '{
    "json": {
      "apiKey": "lmk_your_api_key_here",
      "vertical": "solar",
      "firstName": "Bob",
      "lastName": "Johnson",
      "email": "[email protected]",
      "phone": "5559876543",
      "state": "CA",
      "zipCode": "90210",
      "homeOwner": true,
      "monthlyElectricBill": "$200-$300",
      "consentText": "I agree to be contacted."
    }
  }'

Request Body

Wrap your payload in a json key when calling the tRPC endpoint.

json
{
  "apiKey": "lmk_your_api_key_here",
  "vertical": "solar",
  "firstName": "Bob",
  "lastName": "Johnson",
  "email": "[email protected]",
  "phone": "5559876543",
  "state": "CA",
  "zipCode": "90210",
  "city": "Beverly Hills",
  "homeOwner": true,
  "roofAge": "5-10 years",
  "monthlyElectricBill": "$200-$300",
  "roofOrientation": "south",
  "solarReadiness": "ready_now",
  "consentText": "I agree to be contacted by solar providers.",
  "ipAddress": "1.2.3.4"
}

Field Reference

Field
Type
Required
Description
apiKeystringRequiredYour API key from the dashboard
verticalenumRequiredinsurance | solar | funding
firstNamestringRequiredLead's first name
lastNamestringRequiredLead's last name
emailstringRequiredValid email address
phonestringRequired10-digit US phone number
statestringRequired2-letter US state code (e.g. CA, TX)
zipCodestringRequired5-digit ZIP code
citystringOptionalCity name
consentTextstringOptionalTCPA consent text shown to lead
ipAddressstringOptionalLead's IP address for compliance
insuranceTypestringOptional[Insurance] auto | home | life | health
currentInsurerstringOptional[Insurance] Current insurance provider
coverageAmountstringOptional[Insurance] Desired coverage amount
homeOwnerbooleanOptional[Solar] Whether lead owns their home
roofAgestringOptional[Solar] Age of roof (e.g. '5-10 years')
monthlyElectricBillstringOptional[Solar] Monthly electric bill range
roofOrientationstringOptional[Solar] south | east | west | north
solarReadinessstringOptional[Solar] ready_now | 3_months | 6_months
businessNamestringOptional[Funding] Business legal name
businessRevenuestringOptional[Funding] Annual revenue range
businessIndustrystringOptional[Funding] Industry/sector
fundingAmountstringOptional[Funding] Requested funding amount
creditBandstringOptional[Funding] excellent | good | fair | poor
timeInBusinessstringOptional[Funding] Years in business

Response

Success (200)
json
{
  "result": {
    "data": {
      "success": true,
      "leadId": 1042,
      "score": 82,
      "estimatedPayout": 29.16,
      "message": "Lead accepted. Estimated payout: $29.16"
    }
  }
}
Error (4xx)
json
{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Invalid or revoked API key"
  }
}

Lead Scoring

Every submitted lead is scored 0–100 based on data completeness and quality signals. Higher scores earn higher payouts. The score is returned in the API response so you can optimize your forms and data collection.

Score 80–100
Premium quality. 20% payout bonus.
Score 60–79
Standard quality. Base payout rate.
Score 0–59
Below average. 20% payout reduction.

Rate Limits & Compliance

Rate Limit: 1,000 requests per hour per API key. Contact us for higher limits.

TCPA Compliance: All leads must have explicit consent. Include the consent text in consentText.

Duplicates: Leads with the same email/phone submitted within 30 days are flagged as duplicates and rejected.

Data Quality: Invalid emails, disconnected phone numbers, or P.O. Box addresses will reduce your acceptance rate.

Ready to Start Submitting?

Generate your API key from the dashboard and start earning today.