# Company Analysis AI Agent (`harvestlabs/company-analysis-ai-agent`) Actor

- **URL**: https://apify.com/harvestlabs/company-analysis-ai-agent.md
- **Developed by:** [harvest-org](https://apify.com/harvestlabs) (community)
- **Categories:** AI, Agents, Lead generation
- **Stats:** 50 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1,000.00 / 1,000 actor initializations

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## AI Agent Company Analyzer

### Overview

The AI Agent Company Analyzer is an Apify Actor that takes a query as input, extracts the company name, and gathers detailed information from various sources across the web. The actor provides both structured JSON output and an HTML report containing the findings.

### Features

- Extracts company information from a given query
- Gathers details such as basic company information, funding history, employee statistics, and headquarters location
- Collects relevant news articles about the company
- Parses the details to create a concise summary of the company.
- Generates structured JSON output and an HTML report

### Input

The Actor requires the following input in JSON format:

```json
{
    "companyRequest": "Tell me about Microsoft's business",
    "OPENAI_API_KEY": "YOUR_OPENAI_API_KEY" //optional
}
```

#### Input Fields

- `companyRequest` (string): A query containing the company name and the type of information required.
- `OPENAI_API_KEY` (string - optional): Your OpenAI API key for natural language processing.

### Output

The Actor generates two types of output:

#### HTML Report

![Sample HTML Report](https://raw.githubusercontent.com/JEBishop/company-analysis-ai-agent/main/sample_report.png)
An HTML report is also generated, summarizing the collected information in a visually structured format.

#### JSON Output

The structured JSON output includes details about the company, such as:

```json
{
    "results": [
        {
            "basic_info": {
                "name": "Microsoft",
                "universal_name": "microsoft",
                "description": "Every company has a mission...",
                "website": "https://news.microsoft.com/",
                "linkedin_url": "https://www.linkedin.com/company/microsoft/",
                "specialties": ["AI", "Cloud Computing", "Gaming"],
                "industries": ["Computer Software"],
                "is_verified": true
            },
            "stats": {
                "employee_count": 239069,
                "follower_count": 25034990
            },
            "locations": {
                "headquarters": {
                    "country": "US",
                    "state": "Washington",
                    "city": "Redmond",
                    "postal_code": "98052",
                    "line1": "1 Microsoft Way"
                }
            },
            "funding": {
                "total_rounds": 2,
                "latest_round": {
                    "type": "Post IPO equity",
                    "date": { "year": 2022, "month": 12, "day": 9 },
                    "url": "https://www.crunchbase.com/funding_round/microsoft-post-ipo-equity..."
                }
            },
            "news": [
                {
                    "title": "Microsoft to invest $3 billion in India...",
                    "source": "Reuters",
                    "link": "https://www.reuters.com/...",
                    "summary": "Microsoft has announced a $3 billion investment..."
                }
            ]
        }
    ]
}
```

### Usage

1. Deploy the Actor on Apify.
2. Provide the required input (company query and API key).
3. Execute the Actor and retrieve the JSON output or the HTML report from the Apify dataset.

### Example Use Case

- Competitive analysis for businesses
- Market research
- Tracking company news and trends

### Limitations

- The quality of extracted information depends on the availability of online data sources.
- API rate limits may apply when using OpenAI for query processing.

# Actor input Schema

## `companyRequest` (type: `string`):

The company to research.

## `OPENAI_API_KEY` (type: `string`):

The API key to use for prompting ChatGPT.

## Actor input object example

```json
{
  "companyRequest": "Tell me about Microsoft's business."
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "companyRequest": "Tell me about Microsoft's business."
};

// Run the Actor and wait for it to finish
const run = await client.actor("harvestlabs/company-analysis-ai-agent").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "companyRequest": "Tell me about Microsoft's business." }

# Run the Actor and wait for it to finish
run = client.actor("harvestlabs/company-analysis-ai-agent").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "companyRequest": "Tell me about Microsoft'\''s business."
}' |
apify call harvestlabs/company-analysis-ai-agent --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,harvestlabs/company-analysis-ai-agent"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/LHqzJXldQwI3qU6nG/builds/UqYG5UBAtbCyPcelC/openapi.json
