Retrieve Companies
Retrieve all companies in your portfolio with detailed information including analysis results, scores, project status, and owner details. Results are paginated for efficient data handling.
Endpoint
GET https://api.kruncher.ai/api/integration/projects
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Your API key (format: YOUR_API_KEY) |
Content-Type | Yes | Must be application/json |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | No | Page number (0-indexed, default: 0) |
orderby | string | No | Field name to sort by (ascending) |
Code Examples
JavaScript/TypeScript
Basic
const API_KEY = "YOUR_API_KEY_HERE";
const response = await fetch("https://api.kruncher.ai/api/integration/projects", {
method: "GET",
headers: {
"Authorization": `${API_KEY}`,
"Content-Type": "application/json"
}
});
const data = await response.json();
console.log(`Found ${data.pagination.totalCount} companies`);
console.log("Companies:", data.data);Result: Retrieves first page of companies with default pagination.
Python
Basic
import requests
API_KEY = "YOUR_API_KEY_HERE"
url = "https://api.kruncher.ai/api/integration/projects"
headers = {
"Authorization": f"{API_KEY}",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers)
if response.status_code == 200:
data = response.json()
print(f"Found {data['pagination']['totalCount']} companies")
print(f"Companies on this page: {len(data['data'])}")
else:
print(f"Error: {response.status_code} {response.text}")Result: Retrieves first page of companies.
cURL
Basic
curl -X GET "https://api.kruncher.ai/api/integration/projects" \
-H "Authorization: YOUR_API_KEY_HERE" \
-H "Content-Type: application/json"Response Structure
Success Response (200 OK)
{
"code": "1000",
"title": "Successful",
"description": "",
"data": [
{
"id": "proj_abc123",
"name": "TechStartup",
"companyName": "TechStartup Inc.",
"companyLegalName": "TechStartup Incorporated",
"companyEmail": "contact@techstartup.com",
"companyWebsite": "https://techstartup.com",
"companyIndustry": "Software",
"companyCountry": "US",
"companyBusinessModel": "b2b",
"companyStage": "seriesA",
"companyRevenueRange": "$1M-$10M",
"isVisible": true,
"isPending": false,
"isUnread": false,
"processing": "completed",
"projectUser": {
"role": "owner"
},
"analyses": [
{
"id": "analysis_xyz789",
"type": "company",
"status": "completed",
"createdAt": "2024-01-15T10:30:00Z"
}
],
"projectscores": [
{
"status": "done",
"scoreText": "Strong Fit",
"score": 8.5
}
],
"projectstatus": {
"name": "Active",
"code": "active",
"order": 1,
"isVisible": true,
"hasProjectPhase": true
},
"projectphase": {
"name": "Due Diligence",
"code": "dueDiligence",
"order": 2,
"isVisible": true
},
"projectowner": {
"fullName": "John Smith",
"email": "john@example.com",
"status": "active"
}
}
],
"pagination": {
"page": 1,
"totalCount": 150,
"pageSize": 20,
"nextPage": true
}
}Response Fields
Metadata
| Field | Type | Description |
|---|---|---|
code | string | Status code ("1000" for success) |
title | string | Status message (e.g., "Successful") |
description | string | Additional context or error details |
Company Data Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique project identifier |
name | string | Short project nickname |
companyName | string | Full company name |
companyLegalName | string | Legal entity name |
companyEmail | string | Company contact email |
companyWebsite | string | Company website URL |
companyIndustry | string | Industry classification |
companyCountry | string | Country code (ISO 3166-1) |
companyBusinessModel | string | b2b, b2c, b2b2c, etc. |
companyStage | string | preSeed, seed, seriesA, seriesB, etc. |
companyRevenueRange | string | Revenue bracket |
isVisible | boolean | Visibility in lists |
isPending | boolean | Pending review status |
isUnread | boolean | Unread notification flag |
processing | string | Processing status |
projectUser | object | User role information |
Analysis Object
| Field | Type | Description |
|---|---|---|
id | string | Unique analysis identifier |
type | string | Analysis type (e.g., "company") |
status | string | completed, progress, pending, failed |
createdAt | string | ISO 8601 timestamp |
Project Score Object
| Field | Type | Description |
|---|---|---|
status | string | Score calculation status |
scoreText | string | Human-readable score description |
score | number | Numerical score (typically 0-10) |
Project Status Object
| Field | Type | Description |
|---|---|---|
name | string | Status display name |
code | string | Status identifier |
order | integer | Display order |
isVisible | boolean | Visibility flag |
hasProjectPhase | boolean | Whether project has phases |
Project Phase Object
| Field | Type | Description |
|---|---|---|
name | string | Phase display name |
code | string | Phase identifier |
order | integer | Phase sequence number |
isVisible | boolean | Visibility flag |
Project Owner Object
| Field | Type | Description |
|---|---|---|
fullName | string | Owner’s full name |
email | string | Owner’s email address |
status | string | Owner account status |
Pagination Object
| Field | Type | Description |
|---|---|---|
page | integer | Current page number |
totalCount | integer | Total number of companies |
pageSize | integer | Results per page |
nextPage | boolean | Whether more pages exist |
Common Use Cases
Filter by Analysis Status
const companies = await api.getCompanies();
const completed = companies.data.filter(company =>
company.analyses?.some(a => a.status === 'completed')
);Sort by Score
const companies = await api.getCompanies();
const sorted = companies.data.sort((a, b) => {
const scoreA = a.projectscores?.[0]?.score || 0;
const scoreB = b.projectscores?.[0]?.score || 0;
return scoreB - scoreA;
});Group by Industry
from collections import defaultdict
companies = api.get_all_companies()
by_industry = defaultdict(list)
for company in companies:
industry = company.get('companyIndustry', '')
if industry:
by_industry[industry].append(company)
print(f"Software companies: {len(by_industry['Software'])}")Error Responses
401 Unauthorized
{
"code": "4010",
"title": "Unauthorized",
"description": "Invalid or missing API key"
}500 Internal Server Error
{
"code": "5000",
"title": "Internal Server Error",
"description": "An unexpected error occurred"
}Related Endpoints
- Create Company - Add new companies to your portfolio
- Upload Files - Upload documents for analysis
- Company Report - Access detailed analysis results
- Config - Get mappings for industries, stages, etc.
Best Practices
Pagination
- Use appropriate page sizes (20-50 for UI, 100 for batch processing)
- Implement page caching for frequently accessed data
- Handle the
nextPageflag to avoid unnecessary requests
Performance
- Cache company lists when appropriate
- Use search parameters to reduce data transfer
- Fetch all pages only when necessary
Data Handling
- Always check for
nullor missing fields - Handle empty arrays in
analysesandprojectscores - Validate data types before processing
Need Help?
- Large datasets? Contact support for bulk export options
- Custom filtering? Let us know what filters you need
- Rate limits? Check your plan for API limits
Last updated on