Create Company from HTML
Send an HTML blob and Kruncher renders it to a PDF, attaches it to a new company, and starts a full analysis. Use this when the source material lives in HTML rather than in a file you can upload — a newsletter issue, an email body, an internal deal memo, a scraped company profile.
Functionally this is Create Company with projectAnalysisWithFile, except the “file” is generated from the HTML you pass in.
Endpoint
POST https://api.kruncher.ai/api/integration/project/fromhtml
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Your API key (format: YOUR_API_KEY) |
Content-Type | Yes | application/json |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
companyName | string | Yes | Company name (non-empty) |
companyWebsite | string | Yes | Company website — also used to deduplicate against companies you already have |
content | string | Yes | The HTML document. Send it as a JSON string; no size-stripping is done for you |
Cost & Timing
Starts a full analysis: 1 credit, typically 15–20 minutes to complete. Poll Analysis Detail or subscribe to Webhooks to learn when the report is ready.
Quick Start
curl -X POST "https://api.kruncher.ai/api/integration/project/fromhtml" \
-H "Authorization: YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"companyName": "Acme Corporation",
"companyWebsite": "https://acme.com",
"content": "<h1>Acme Corporation</h1><p>Series A, $4M ARR, 32 employees. Building warehouse robotics for mid-market 3PLs.</p>"
}'Code Examples
JavaScript/TypeScript
Basic
const API_KEY = "YOUR_API_KEY_HERE";
const BASE_URL = "https://api.kruncher.ai/api";
async function createCompanyFromHtml(companyName, companyWebsite, html) {
const response = await fetch(`${BASE_URL}/integration/project/fromhtml`, {
method: "POST",
headers: {
"Authorization": `${API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
companyName,
companyWebsite,
content: html
})
});
if (!response.ok) {
throw new Error(`Failed to create company: ${response.statusText}`);
}
const body = await response.json();
if (body.metadata && body.metadata.code !== "1000") {
throw new Error(`${body.metadata.title}: ${body.metadata.description}`);
}
return body.data;
}
// Usage
const project = await createCompanyFromHtml(
"Acme Corporation",
"https://acme.com",
"<h1>Acme</h1><p>Series A robotics company, $4M ARR.</p>"
);
console.log("Created company:", project.id);Python
import requests
API_KEY = "YOUR_API_KEY_HERE"
BASE_URL = "https://api.kruncher.ai/api"
def create_company_from_html(company_name: str, company_website: str, html: str) -> dict:
"""Create a company from an HTML document and start a full analysis."""
response = requests.post(
f"{BASE_URL}/integration/project/fromhtml",
json={
"companyName": company_name,
"companyWebsite": company_website,
"content": html,
},
headers={
"Authorization": f"{API_KEY}",
"Content-Type": "application/json",
},
)
response.raise_for_status()
body = response.json()
if body["metadata"]["code"] != "1000":
raise RuntimeError(body["metadata"]["description"])
return body["data"]
# Usage — a newsletter section about one company
html = """
<h2>Acme Corporation</h2>
<p>Raised a $12M Series A led by Example Ventures. $4M ARR, 32 employees,
warehouse robotics for mid-market 3PLs.</p>
"""
project = create_company_from_html("Acme Corporation", "https://acme.com", html)
print(f"Created company: {project['id']}")Response
Success Response (200 OK)
{
"metadata": {
"code": "1000",
"title": "Successful",
"description": ""
},
"data": {
"id": "521a93a6-091d-4943-ba13-7c1a654a14ae",
"name": "Acme Corporation",
"companyName": "Acme Corporation",
"companyWebsite": "https://acme.com",
"...": "created project object"
}
}Errors
| Situation | Response |
|---|---|
companyName, companyWebsite, or content missing or empty | 400 naming the field |
| Invalid API key | 401 Unauthorized |
| Rendering or analysis start failed | 200 with an error envelope (metadata.code ≠ 1000) |
Notes
- Keep the HTML focused on one company. The analysis reads the whole rendered document, so a full newsletter with twelve companies in it produces a muddled report. Split it first and call this endpoint once per company.
- Inline what matters. External stylesheets and scripts are not fetched during rendering; content inside
<img>tags is not read as text. - Deduplication is by website. Posting twice for the same
companyWebsiteattaches to the existing company rather than creating a second one.
Related Endpoints
- Create Company — create from a website, doc link, or notes
- Create Company & Upload — create and attach real files in one request
- Upload Files — attach files to an analysis that already exists
- Process Message — attach an inbound message to an existing company
Last updated on