# Company Needs

> Summarize pain points / challenges from a company’s official filings.

- **Endpoint:** `POST https://api.nyne.ai/company/needs`
- **Group:** Company APIs (https://api.nyne.ai/documentation/company.md)
- **Auth:** `X-API-Key` + `X-API-Secret` headers
- **Mode:** Asynchronous - submit returns a `request_id` (normally with `202 Accepted`); poll `GET /company/needs?request_id=<request_id>` with the same auth headers until the endpoint reports a terminal response. Where supported, a `callback_url` can notify you when queued work finishes; follow this endpoint's retrieval notes.
- **HTML version:** https://api.nyne.ai/documentation/company/needs

Surface recent pain points, challenges, or other requested topics from a company’s official filings as concise, structured highlights. Both `company_name` and `content` (the topic to surface) are required; an optional `filing` restricts the search to one filing type. The request is queued asynchronously and returns a `request_id`; poll the status endpoint or supply a `callback_url`. The completed result includes a `needs` array with one entry per matching filing excerpt (filing, content, date, and source URL) - an empty array when nothing matches. Analysis typically takes 15-60 seconds. A credit is charged only when the analysis produces results.

## Authentication

All `/person/*` and `/company/*` endpoints authenticate with an API key and secret sent as HTTP headers on every request: `X-API-Key` and `X-API-Secret`. Create keys from your Nyne.ai dashboard and keep the secret server-side. Rate limits: 100 requests/minute, 1,000 requests/hour. Full guide: https://api.nyne.ai/documentation/authentication.md

## Parameters

| Name | Type | Required | Description | Example |
| --- | --- | --- | --- | --- |
| `company_name` | string | **yes** | Company to analyze, e.g. “Uber Technologies, Inc.”. Max 255 chars. | "Uber Technologies, Inc." |
| `content` | string | **yes** | Topic to surface, e.g. “Regulatory challenges”, “Supply chain issues”. Max 255 chars. | "Regulatory challenges" |
| `filing` | string | no | Restrict to a filing type, e.g. “Form 10-K”, “Form 8-K”. Max 255 chars. | "Form 10-K" |
| `callback_url` | string | no | http(s) URL on an allowed host that receives the completed payload automatically. | "https://example.com/webhooks/company-needs" |

## Polling for the result

A newly queued submit normally returns `202 Accepted` with a `request_id`. Poll the same path until `status` is `completed` (results stay available afterwards). Where supported, pass a `callback_url` on the submit to receive a webhook when queued work finishes; keep the documented GET as a recovery and retrieval path:

```bash
curl "https://api.nyne.ai/company/needs?request_id=<request_id>" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "X-API-Secret: YOUR_API_SECRET"
```

## Credit usage

| Item | Credits | Condition |
| --- | --- | --- |
| Needs Analysis | - | Charged once when the analysis produces results |
| No data | 0 | No relevant filings never burns credits |

## Responses

| Code | Meaning |
| --- | --- |
| `202` | Needs analysis queued - poll the status endpoint with the returned request_id |
| `400` | missing_parameters / invalid_parameters / invalid_callback_url |
| `401` | Missing or invalid API credentials |
| `403` | subscription_required or ip_not_allowed |
| `404` | no needs data found (no credit charged) |
| `429` | rate_limit_exceeded / monthly_limit_exceeded |
| `503` | service_unavailable - the API is temporarily unavailable |

## Example request

### cURL

```bash
curl -X POST https://api.nyne.ai/company/needs \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "X-API-Secret: YOUR_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "company_name": "Uber Technologies, Inc.",
    "content": "Regulatory challenges",
    "filing": "Form 10-K",
    "callback_url": "https://example.com/webhooks/company-needs"
  }'
```

### Python

```python
import requests

resp = requests.post(
    "https://api.nyne.ai/company/needs",
    headers={
        "X-API-Key": "YOUR_API_KEY",
        "X-API-Secret": "YOUR_API_SECRET",
    },
    json={
        "company_name": "Uber Technologies, Inc.",
        "content": "Regulatory challenges",
        "filing": "Form 10-K",
        "callback_url": "https://example.com/webhooks/company-needs",
    },
)
data = resp.json()
print(data)
```

### Node

```javascript
const resp = await fetch("https://api.nyne.ai/company/needs", {
  method: "POST",
  headers: {
    "X-API-Key": "YOUR_API_KEY",
    "X-API-Secret": "YOUR_API_SECRET",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    company_name: "Uber Technologies, Inc.",
    content: "Regulatory challenges",
    filing: "Form 10-K",
    callback_url: "https://example.com/webhooks/company-needs",
  }),
});
const data = await resp.json();
console.log(data);
```

### PHP

```php
<?php
$ch = curl_init("https://api.nyne.ai/company/needs");
curl_setopt_array($ch, [
  CURLOPT_POST => true,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    "X-API-Key: YOUR_API_KEY",
    "X-API-Secret: YOUR_API_SECRET",
    "Content-Type: application/json",
  ],
  CURLOPT_POSTFIELDS => json_encode([
    "company_name" => "Uber Technologies, Inc.",
    "content" => "Regulatory challenges",
    "filing" => "Form 10-K",
    "callback_url" => "https://example.com/webhooks/company-needs",
  ]),
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);
```

## Example response

```json
{
  "request_id": "64f2d8e4nd1f065a9b4e7fbc3df6aabb_1700000456_7710",
  "status": "completed",
  "completed": true,
  "result": {
    "company": "Uber Technologies, Inc.",
    "needs": [
      {
        "filing": "Form 10-K",
        "content": "Notes increased regulatory compliance costs across multiple regions.",
        "filing_date": "2025-02-14",
        "source_url": "https://www.sec.gov/Archives/edgar/data/1543151/uber-20241231x10k.htm"
      }
    ]
  },
  "completed_on": "2026-01-15T10:35:00Z"
}
```

---

All documentation pages are available as Markdown by appending `.md` to their URL. Index: https://api.nyne.ai/llms.txt
