Skip to content

cURL

cURL Examples

Complete cURL examples for integrating with the OpenProspect API.

Prerequisites

  • API key with companies:read scope
  • Prospect search UUID from your OpenProspect account
  • cURL installed (curl --version to verify)

Basic Authentication

All requests require the Authorization header:

Bash
curl -H "Authorization: Bearer lnc_live_your_api_key_here" \
  https://api.openprospect.io/health

List Companies

Basic List Request

Retrieve the first 50 companies from a prospect search:

Bash
curl -H "Authorization: Bearer lnc_live_your_api_key_here" \
  "https://api.openprospect.io/api/v1/companies/?prospect_search_id=550e8400-e29b-41d4-a716-446655440000&limit=50"

With Filters

Filter by minimum match score and review status:

Bash
curl -H "Authorization: Bearer lnc_live_your_api_key_here" \
  "https://api.openprospect.io/api/v1/companies/?prospect_search_id=550e8400-e29b-41d4-a716-446655440000&min_match_score=7.0&review_status=accepted&limit=20"

Search across company name, city, and contacts:

Bash
curl -H "Authorization: Bearer lnc_live_your_api_key_here" \
  "https://api.openprospect.io/api/v1/companies/?prospect_search_id=550e8400-e29b-41d4-a716-446655440000&search=software&limit=25"

Pagination

Get second page of results:

Bash
curl -H "Authorization: Bearer lnc_live_your_api_key_here" \
  "https://api.openprospect.io/api/v1/companies/?prospect_search_id=550e8400-e29b-41d4-a716-446655440000&limit=50&offset=50"

Multiple Review Statuses

Filter by multiple statuses:

Bash
curl -H "Authorization: Bearer lnc_live_your_api_key_here" \
  "https://api.openprospect.io/api/v1/companies/?prospect_search_id=550e8400-e29b-41d4-a716-446655440000&review_status_list=accepted&review_status_list=pending"

Get Single Company

Retrieve detailed information for a specific company:

Bash
curl -H "Authorization: Bearer lnc_live_your_api_key_here" \
  https://api.openprospect.io/api/v1/companies/7f3e8c90-1234-5678-9abc-def012345678

Company Job Listings

Get All Jobs

Retrieve job listings for the last 30 days:

Bash
curl -H "Authorization: Bearer lnc_live_your_api_key_here" \
  "https://api.openprospect.io/api/v1/companies/7f3e8c90-1234-5678-9abc-def012345678/jobs?days_back=30&limit=50"

Filter by Platform

Get only LinkedIn jobs:

Bash
curl -H "Authorization: Bearer lnc_live_your_api_key_here" \
  "https://api.openprospect.io/api/v1/companies/7f3e8c90-1234-5678-9abc-def012345678/jobs?platform=linkedin&days_back=60"

Job Activity Summary

Get lightweight metrics and latest job:

Bash
curl -H "Authorization: Bearer lnc_live_your_api_key_here" \
  https://api.openprospect.io/api/v1/companies/7f3e8c90-1234-5678-9abc-def012345678/jobs/summary

Company Technology Stack

Get All Technologies

Retrieve complete technology stack:

Bash
curl -H "Authorization: Bearer lnc_live_your_api_key_here" \
  "https://api.openprospect.io/api/v1/companies/7f3e8c90-1234-5678-9abc-def012345678/webtech-intel?min_confidence=80"

Filter by Category

Get only JavaScript frameworks:

Bash
curl -H "Authorization: Bearer lnc_live_your_api_key_here" \
  "https://api.openprospect.io/api/v1/companies/7f3e8c90-1234-5678-9abc-def012345678/webtech-intel?category=javascript_framework&min_confidence=90"

Technology Summary

Get top 3-5 technologies:

Bash
curl -H "Authorization: Bearer lnc_live_your_api_key_here" \
  https://api.openprospect.io/api/v1/companies/7f3e8c90-1234-5678-9abc-def012345678/webtech-intel/summary

Pretty Print JSON

Use jq to format JSON output:

Bash
curl -H "Authorization: Bearer lnc_live_your_api_key_here" \
  "https://api.openprospect.io/api/v1/companies/?prospect_search_id=550e8400-e29b-41d4-a716-446655440000&limit=5" \
  | jq '.'

Extract specific fields:

Bash
curl -H "Authorization: Bearer lnc_live_your_api_key_here" \
  "https://api.openprospect.io/api/v1/companies/?prospect_search_id=550e8400-e29b-41d4-a716-446655440000&limit=5" \
  | jq '.items[] | {name: .name, match_score: .match_score, city: .city}'

Save Response to File

Bash
curl -H "Authorization: Bearer lnc_live_your_api_key_here" \
  "https://api.openprospect.io/api/v1/companies/?prospect_search_id=550e8400-e29b-41d4-a716-446655440000" \
  -o companies.json

Error Handling

Check HTTP Status Code

Bash
curl -w "HTTP Status: %{http_code}\n" \
  -H "Authorization: Bearer lnc_live_your_api_key_here" \
  "https://api.openprospect.io/api/v1/companies/?prospect_search_id=550e8400-e29b-41d4-a716-446655440000"

Show Response Headers

Bash
curl -i -H "Authorization: Bearer lnc_live_your_api_key_here" \
  "https://api.openprospect.io/api/v1/companies/?prospect_search_id=550e8400-e29b-41d4-a716-446655440000&limit=1"

Silent Mode with Fail

Exit with error code on HTTP errors:

Bash
curl -sf -H "Authorization: Bearer lnc_live_your_api_key_here" \
  "https://api.openprospect.io/api/v1/companies/?prospect_search_id=550e8400-e29b-41d4-a716-446655440000" \
  || echo "Request failed"

Rate Limit Headers

Check rate limit status:

Bash
curl -i -H "Authorization: Bearer lnc_live_your_api_key_here" \
  https://api.openprospect.io/health \
  | grep -i "x-ratelimit"

Complete Pagination Example

Fetch all companies using pagination:

Bash
#!/bin/bash

API_KEY="lnc_live_your_api_key_here"
PROSPECT_SEARCH_ID="550e8400-e29b-41d4-a716-446655440000"
LIMIT=100
OFFSET=0
HAS_MORE=true

while [ "$HAS_MORE" = "true" ]; do
  echo "Fetching companies at offset $OFFSET..."

  RESPONSE=$(curl -s -H "Authorization: Bearer $API_KEY" \
    "https://api.openprospect.io/api/v1/companies/?prospect_search_id=$PROSPECT_SEARCH_ID&limit=$LIMIT&offset=$OFFSET")

  # Save this batch
  echo "$RESPONSE" | jq '.items[]' >> all_companies.jsonl

  # Check if more results available
  HAS_MORE=$(echo "$RESPONSE" | jq -r '.has_more')
  OFFSET=$((OFFSET + LIMIT))

  # Rate limiting: wait 1 second between requests
  sleep 1
done

echo "Done! All companies saved to all_companies.jsonl"

Environment Variables

Store API key securely:

Bash
# Set environment variable
export OPENPROSPECT_API_KEY="lnc_live_your_api_key_here"

# Use in requests
curl -H "Authorization: Bearer $OPENPROSPECT_API_KEY" \
  "https://api.openprospect.io/api/v1/companies/?prospect_search_id=550e8400-e29b-41d4-a716-446655440000"

Troubleshooting

401 Unauthorized

Verify API key format:

Bash
# Should start with lnc_live_ or lnc_test_
echo $OPENPROSPECT_API_KEY | grep "^lnc_"

403 Forbidden

Check required scopes in error message:

Bash
curl -i -H "Authorization: Bearer $OPENPROSPECT_API_KEY" \
  "https://api.openprospect.io/api/v1/companies/?prospect_search_id=550e8400-e29b-41d4-a716-446655440000" \
  2>&1 | grep -A5 "403"

429 Too Many Requests

Check rate limit reset time:

Bash
curl -i -H "Authorization: Bearer $OPENPROSPECT_API_KEY" \
  https://api.openprospect.io/health \
  | grep "X-RateLimit-Reset"

Next Steps