Basic Usage
This example demonstrates how to interact with the FindMyClient API using Python.
It covers the full asynchronous workflow:
- Create a search job
- Poll for completion
- Retrieve final results
Info
This approach is ideal for automation scripts, backend systems, and AI agent integrations.
Python Example
import time
import requests
BASE_URL = "https://findmyclient.org/api"
API_TOKEN = "YOUR-API-TOKEN"
def search(query: str):
# Start search job
response = requests.post(
f"{BASE_URL}/search",
params={"query": query, "token": API_TOKEN},
timeout=30
)
response.raise_for_status()
data = response.json()
job_id = data["job_id"]
print(f"Job started: {job_id}")
# Poll for results
while True:
result = requests.get(
f"{BASE_URL}/result/{job_id}",
timeout=30
)
result.raise_for_status()
payload = result.json()
status = payload["status"]
if status == "completed":
if payload.get("error"):
raise Exception(payload["error"])
return payload["result"]
print("Still processing...")
time.sleep(60)
if __name__ == "__main__":
output = search("singapore cafe")
print("\nFinal Result:\n")
print(output)
Start a Search Job
Start a new search job by sending a query to the API. The request is processed
asynchronously and returns a job_id that can be used to retrieve results later.
Get Results
Retrieve the status and results of a previously submitted search job using its job_id.
Once processing is complete, the API returns structured company and contact data in
a machine-readable JSON format.
Get Leads
Retrieve enriched lead results for a completed scraping job using its job_id.
This endpoint returns structured lead data including business details, verified emails,
confidence scores, and metadata from the enrichment pipeline.
Tips
Search jobs are processed asynchronously. Save the returned job_id and poll the result endpoint until the status becomes completed.