import Whop from '@whop/sdk';
const client = new Whop({
apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const companyListResponse of client.companies.list()) {
console.log(companyListResponse.id);
}{
"data": [
{
"id": "biz_xxxxxxxxxxxxxx",
"title": "Pickaxe",
"description": "Learn the fundamentals of data analytics with hands-on projects.",
"verified": true,
"send_customer_emails": true,
"created_at": "2023-12-01T05:00:00.401Z",
"updated_at": "2023-12-01T05:00:00.401Z",
"member_count": 42,
"owner_user": {
"id": "user_xxxxxxxxxxxxx",
"name": "John Doe",
"username": "johndoe42"
},
"route": "pickaxe",
"logo": {
"url": "https://media.whop.com/abc123/optimized.jpg"
},
"published_reviews_count": 42,
"metadata": {}
}
],
"page_info": {
"end_cursor": "<string>",
"start_cursor": "<string>",
"has_next_page": true,
"has_previous_page": true
}
}Returns a paginated list of companies. When parent_company_id is provided, lists connected accounts under that platform. When omitted, lists companies the current user has access to.
Required permissions:
company:basic:readimport Whop from '@whop/sdk';
const client = new Whop({
apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const companyListResponse of client.companies.list()) {
console.log(companyListResponse.id);
}{
"data": [
{
"id": "biz_xxxxxxxxxxxxxx",
"title": "Pickaxe",
"description": "Learn the fundamentals of data analytics with hands-on projects.",
"verified": true,
"send_customer_emails": true,
"created_at": "2023-12-01T05:00:00.401Z",
"updated_at": "2023-12-01T05:00:00.401Z",
"member_count": 42,
"owner_user": {
"id": "user_xxxxxxxxxxxxx",
"name": "John Doe",
"username": "johndoe42"
},
"route": "pickaxe",
"logo": {
"url": "https://media.whop.com/abc123/optimized.jpg"
},
"published_reviews_count": 42,
"metadata": {}
}
],
"page_info": {
"end_cursor": "<string>",
"start_cursor": "<string>",
"has_next_page": true,
"has_previous_page": true
}
}A company API key, company scoped JWT, app API key, or user OAuth token. You must prepend your key/token with the word 'Bearer', which will look like Bearer ***************************
Returns the elements in the list that come after the specified cursor.
Returns the elements in the list that come before the specified cursor.
Returns the first n elements from the list.
42
Returns the last n elements from the list.
42
The unique identifier of the parent platform company. When provided, lists connected accounts under that platform. Omit to list the current user's own companies.
The sort direction for results. Defaults to descending.
asc, desc Only return companies created before this timestamp.
"2023-12-01T05:00:00.401Z"
Only return companies created after this timestamp.
"2023-12-01T05:00:00.401Z"
Was this page helpful?