Skip to main content

Python client for the CEOInterviews API at https://ceointerviews.ai/api_docs/

Project description

CEOInterviews Python Client

A Python client library for the CEOInterviews.ai API. We are the largest database of insights from global leaders.

Access millions of verified quotes and precise transcripts from CEOs, Executives, Presidents, and Public Officials across more than 100,000 carefully vetted interviews, podcasts, and public appearances.

PyPI version License: MIT

Why trust CEOInterviews?

  • Our rigorous AI verification process ensures you receive only authentic statements from influential figures—CEOs, Presidents, and Public Officials.
  • When you search for Elon Musk, you get his exact words—not someone else's interpretation.
  • Accuracy matters. Get direct insights from verified sources.
Low quality sources with red X CEOInterviews AI Verified with green checkmark
Other sources: Low quality with inaccuracies CEOInterviews: AI-verified authentic quotes

Installation

pip install ceointerviews

Authentication

To use this library, you need an API key from CEOInterviews.ai:

from ceointerviews import CEOInterviews
client = CEOInterviews(api_key="your_api_key_here")

Quick Start Examples

Get controversial quotes from Elon Musk on AI

from ceointerviews import CEOInterviews
api_key = "your_api_key_here"
client = CEOInterviews(api_key)

# Get controversial quotes from Elon Musk on AI
elon_resp = client.get_entities(keyword="elon musk")
elon_id = elon_resp.results[0]["id"]
elon_ai_quotes = client.get_quotes(
    entity_id=elon_id, is_controversial=True, keyword="artificial intelligence"
)

# Print the first quote
if elon_ai_quotes.results:
    quote = elon_ai_quotes.results[0]
    print(f"Quote: \"{quote['text']}\"")

# Get financial policy quotes across all entities and topics
financial_policy_quotes = client.get_quotes(is_financial_policy=True)

Fetch entity data and conversations

# Get Elon Musk's entity data
elon_resp = client.get_entities(keyword="elon musk")
elon_obj = elon_resp.results[0]

# Fetch Elon Musk's conversations
elon_feed = client.get_feed(entity_id=elon_obj["id"]).results

# Inspect results
first_item = elon_feed[0]
print(first_item["title"])
# Example: "LA wildfire: Tesla CEO Elon Musk speaks to fire command team in Los Angeles"

print(first_item["ai_summary"])
# Example: "Elon Musk: discusses the ongoing investigation into the cause of the Palisades fire..."

Core Concepts

The CEOInterviews API is built around several key resources:

Entities

An Entity represents an influential individual such as a CEO, politician, or executive. Each entity has an ID, name, title, and associated organization information.

Feed Items (Conversations)

Transcribed interviews, podcasts, and appearances where entities have spoken. Each feed item includes an AI-generated summary, title, full transcript, attached Quote objects from the transcript, and metadata.

Quotes

Notable statements extracted from feed items. These can be filtered by attributes like "controversial" or "financial policy." Each Quote is attached to both an Entity and a Feed Item.

Companies

Organizations associated with entities, including both public companies (with tickers) and private institutions. Each Company has a list of Entities linked to it, usually the C-suite.

API Reference

Get Entities

# Search for entities by keyword
entities = client.get_entities(keyword="elon musk")
print(entities.results)

# Pagination
page_2 = client.get_entities(keyword="david", page_num=2, page_size=10)

# Get all entities in the database
all_entities = []
for page_num in range(1, 500):
    resp = client.get_entities(page_num=page_num, page_size=100)
    all_entities.extend(resp.results)
    if not resp.page_has_next:
        break

Get Feed (Conversations)

# Get feed posts for a specific entity
entities = client.get_entities(keyword="elon musk")
entity_id = entities.results[0]["id"]
feed = client.get_feed(entity_id=entity_id)

# Search within an entity's feed
keyword_feed = client.get_feed(entity_id=entity_id, keyword="tesla")

# Get all conversations from the database
all_convos = []
for page_num in range(1, 100):
    resp = client.get_feed(page_num=page_num, page_size=50)
    all_convos.extend(resp.results)
    if not resp.page_has_next:
        break

Get Companies

# Search for companies
companies = client.get_companies(keyword="tesla")

# Pagination for companies
companies_page_2 = client.get_companies(page_num=2, page_size=20)

Get Quotes

# Get all quotes
quotes = client.get_quotes()

# Get quotes for a specific entity
entity_quotes = client.get_quotes(entity_id=123)

# Get notable quotes
notable_quotes = client.get_quotes(is_notable=True)

# Get controversial quotes
controversial_quotes = client.get_quotes(is_controversial=True)

# Get financial policy quotes
financial_quotes = client.get_quotes(is_financial_policy=True)

# Search quotes by keyword
keyword_quotes = client.get_quotes(keyword="innovation")

# Get all quotes from the database
all_quotes = []
for page_num in range(1, 500):
    resp = client.get_quotes(page_num=page_num, page_size=100)
    all_quotes.extend(resp.results)
    if not resp.page_has_next:
        break

Use Case Examples

Investment Research Platform

Build a dashboard that monitors financial policy statements from Federal Reserve officials and track sentiment changes over time:

# Get all Federal Reserve officials
fed_officials = client.get_entities(keyword="federal reserve")
fed_ids = [official["id"] for official in fed_officials.results]

# For each official, get their financial policy statements
all_statements = []
for official_id in fed_ids:
    statements = client.get_quotes(
        entity_id=official_id,
        is_financial_policy=True
    )
    all_statements.extend(statements.results)

# Sort statements by date for timeline analysis
sorted_statements = sorted(all_statements, key=lambda x: x["created_at"])

Competitive Intelligence Tool

Monitor what competitors are saying about your product category or industry trends:

competitor_names = ["Competitor A", "Competitor B", "Competitor C"]
product_keywords = ["product category", "industry trend", "technology"]
insights = {}

for competitor in competitor_names:
    # Get entity IDs for company executives
    execs = client.get_entities(keyword=competitor)
    exec_ids = [exec["id"] for exec in execs.results]

    competitor_insights = []
    for exec_id in exec_ids:
        for keyword in product_keywords:
            # Get relevant statements
            statements = client.get_feed(
                entity_id=exec_id,
                keyword=keyword
            )
            competitor_insights.extend(statements.results)

    insights[competitor] = competitor_insights

Response Format

All API methods return an APIResults object with the following properties:

  • results: List of results
  • page_has_previous: Boolean indicating if there are previous pages
  • page_has_next: Boolean indicating if there are more pages
  • page_num: Current page number
  • num_results: Number of results in the current page
  • http_status: HTTP status code of the response

Example:

response = client.get_entities(keyword="elon")
print(f"Found {response.num_results} results")
print(f"Current page: {response.page_num}")
print(f"Has next page: {response.page_has_next}")

Error Handling

The library uses the requests module's exception handling. If an API request fails, a requests.exceptions.HTTPError will be raised.

import requests

try:
    response = client.get_entities(keyword="elon")
except requests.exceptions.HTTPError as e:
    print(f"API request failed: {e}")

Rate Limits

  • API Tier: 100 requests per minute, 100,000 requests per month
  • Custom Tier: Unlimited requests, custom rate limits based on needs

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ceointerviews-0.1.0.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ceointerviews-0.1.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file ceointerviews-0.1.0.tar.gz.

File metadata

  • Download URL: ceointerviews-0.1.0.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for ceointerviews-0.1.0.tar.gz
Algorithm Hash digest
SHA256 53dbf26d905c44a31e139db4b1bed0680348c7258c34cfddd335e19ee3288f88
MD5 06aeec4be598b4f8b45be05e78e29b6c
BLAKE2b-256 13b111bf1dda90cf01d17db2a7ff8211e2fc94d1774f15910faa736ae1ed9afe

See more details on using hashes here.

File details

Details for the file ceointerviews-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ceointerviews-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for ceointerviews-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2f11cfb5496fddf33d942d37ac5549dbe79cbbf4a7ead501ebacdfc148d4a246
MD5 fa836fdd98496e6040136802c9c6a9e6
BLAKE2b-256 b9a76e3889c171100af2d09b5d10927f0abbbd2f595235c097317282ff848536

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page