Skip to main content
Alpha API - This API is currently in Alpha and is subject to change at any time. Breaking changes may occur without prior notice.

Prerequisites

Before you begin, make sure you have:
  • A Happenstance account
  • API Credits (checkout via Settings)
  • Your API key (generated from Settings)

Make Your First Request

1. Research a Person

Generate a detailed profile:
curl -X POST https://api.happenstance.ai/v1/research \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "description": "Elon Musk Tesla"
  }'
Response:
{
  "id": "6a3ff726-c527-4044-a4b2-7d29f1e5088b"
}
View the research profile at: https://happenstance.ai/research/{id}Research generation takes 1-3 minutes. The page will update automatically when complete.

2. Poll for Completion

Research runs asynchronously. Poll the GET endpoint until the status is COMPLETED:
curl -X GET https://api.happenstance.ai/v1/research/6a3ff726-c527-4044-a4b2-7d29f1e5088b \
  -H "Authorization: Bearer YOUR_API_KEY"
Response (in progress):
{
  "id": "6a3ff726-c527-4044-a4b2-7d29f1e5088b",
  "status": "RUNNING",
  "query": "Elon Musk Tesla",
  "created_at": "2025-01-15T10:30:00Z",
  "updated_at": "2025-01-15T10:30:05Z",
  "profile": null
}
Response (completed):
{
  "id": "6a3ff726-c527-4044-a4b2-7d29f1e5088b",
  "status": "COMPLETED",
  "query": "Elon Musk Tesla",
  "created_at": "2025-01-15T10:30:00Z",
  "updated_at": "2025-01-15T10:32:15Z",
  "profile": {
    "person_metadata": {
      "full_name": "Elon Musk",
      "alternate_names": ["Elon Reeve Musk"],
      "profile_urls": [
        "https://www.tesla.com/elon-musk",
        "https://ir.tesla.com/corporate/elon-musk",
        "https://x.com/elonmusk",
        "https://www.spacex.com/",
        "https://neuralink.com/"
      ],
      "current_locations": [
        {
          "location": "Austin, Texas",
          "urls": ["https://www.forbes.com/profile/elon-musk/"]
        }
      ],
      "tagline": "Entrepreneur leading Tesla, SpaceX, Neuralink, The Boring Company, and xAI"
    },
    "employment": [
      {
        "company_name": "Tesla, Inc.",
        "job_title": "CEO, Technoking, Product Architect",
        "start_date": "2008-10",
        "end_date": null,
        "description": "Leads all product design, engineering, and global manufacturing of electric vehicles, battery products, and solar solutions.",
        "urls": ["https://ir.tesla.com/corporate/elon-musk", "https://www.tesla.com/elon-musk"]
      },
      {
        "company_name": "Space Exploration Technologies Corp. (SpaceX)",
        "job_title": "Founder, CEO, Chief Engineer",
        "start_date": "2002-05",
        "end_date": null,
        "description": "Oversees development of advanced rockets and spacecraft for missions to Earth orbit and beyond.",
        "urls": ["https://www.spacex.com/"]
      },
      {
        "company_name": "X Corp. (formerly Twitter)",
        "job_title": "CEO",
        "start_date": "2022-10",
        "end_date": null,
        "description": "Acquired Twitter and rebranded it as X, implementing vision for a global 'everything app'."
      }
    ],
    "education": [
      {
        "university_name": "University of Pennsylvania",
        "degree": "B.A. Physics, B.S. Economics (Wharton School)",
        "end_date": "1997",
        "description": "Received two bachelor's degrees, one in physics and another in business from the Wharton School."
      }
    ],
    "projects": [
      {
        "title": "Starlink Satellite Network",
        "description": "Deployed a satellite internet constellation to provide global broadband internet access.",
        "start_date": "2015"
      },
      {
        "title": "Tesla Electric Vehicles",
        "description": "Led design and development of electric vehicle models including Model S, 3, X, Y, and Cybertruck.",
        "start_date": "2004"
      }
    ],
    "summary": {
      "text": "Elon Musk is a prolific entrepreneur who has founded or co-founded several groundbreaking companies across diverse industries including electric vehicles (Tesla), space exploration (SpaceX), artificial intelligence (xAI), neurotechnology (Neuralink), and infrastructure (The Boring Company). His ventures reflect a consistent drive to tackle some of humanity's biggest challenges, from climate change to becoming a multi-planetary species.\n\nMusk has demonstrated remarkable technical leadership, holding roles such as CEO, CTO, and Chief Engineer at companies like Tesla and SpaceX. He is deeply involved in the product design and engineering aspects of his companies, personally overseeing the development of complex systems like the Falcon rockets, Starship, and Tesla's electric vehicle lineup.",
      "urls": [
        "https://www.tesla.com/elon-musk",
        "https://www.spacex.com/",
        "https://www.forbes.com/profile/elon-musk/",
        "https://ir.tesla.com/corporate/elon-musk"
      ]
    }
  }
}
Poll every 5-10 seconds. Research typically completes within 1-3 minutes. Status can be RUNNING, COMPLETED, FAILED, or FAILED_AMBIGUOUS.

Next Steps