pounce-agent-data 1.1.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,183 +1,146 @@
1
1
  /**
2
- * Pounce Agent Data SDK - TypeScript Client
3
- *
4
- * Minimal client for the Pounce Agent Data API.
5
- * Supports recent signals, semantic search, signal details, and SSE streaming.
2
+ * Pounce Agent Data SDK TypeScript client for the Pounce v2 Entity API.
6
3
  *
7
4
  * @example
8
- * ```typescript
9
- * import { PounceAgentDataClient } from '@pounce/agent-data';
10
- *
11
- * const client = new PounceAgentDataClient({ apiKey: 'pounce_live_xxx' });
12
- *
13
- * // Recent signals
14
- * const { json, rateLimit } = await client.recentSignals({ limit: 10, category: 'saas' });
5
+ * ```ts
6
+ * import { PounceClient } from 'pounce-agent-data';
15
7
  *
16
- * // Semantic search
17
- * const results = await client.search('AI companies in healthcare', { limit: 20 });
18
- *
19
- * // Use search for targeted queries
20
- * const results = await client.search('AI healthcare');
21
- * results.json.items.forEach(r => console.log(r.domain));
8
+ * const client = new PounceClient({ apiKey: 'your_key' });
9
+ * const { data } = await client.search({ q: 'AI companies', country: 'CH' });
10
+ * data.items.forEach(c => console.log(c.canonical_name, c.primary_domain));
22
11
  * ```
23
12
  */
24
- type RateLimitInfo = {
25
- limit?: number;
26
- remaining?: number;
27
- resetUnix?: number;
28
- };
29
- type Signal = {
30
- signalId: string;
31
- domain: string;
32
- companyName?: string | null;
33
- category?: string | null;
34
- subcategory?: string | null;
35
- signalScore: number;
36
- trustScore?: number | null;
37
- intentTags?: string[] | null;
38
- techStack?: string[] | null;
39
- country?: string | null;
40
- description?: string | null;
41
- detectedAt?: string | null;
42
- uiUrl?: string | null;
43
- };
44
- type AgentDataRecentSignal = {
13
+ export interface EntitySummary {
45
14
  id: number;
46
- signal_id?: string;
47
- domain: string;
48
- tld: string;
49
- title?: string | null;
50
- description?: string | null;
51
- h1?: string | null;
52
- category?: string | null;
53
- subcategory?: string | null;
54
- business_type?: string | null;
55
- signal_score: number;
56
- signal_grade?: string | null;
57
- tech_stack?: string[] | null;
58
- intent_tags?: string[] | null;
59
- hosting_provider?: string | null;
60
- country?: string | null;
61
- has_real_content: boolean;
62
- scanned_at?: string | null;
63
- discovered_at: string;
64
- ui_url?: string | null;
65
- };
66
- type RecentSignalsResponse = {
67
- items: AgentDataRecentSignal[];
68
- count: number;
69
- has_more?: boolean;
70
- };
71
- type SemanticSearchItem = {
72
- signal_id: string;
73
- domain: string;
74
- company_name?: string | null;
75
- category?: string | null;
76
- signal_score: number;
77
- similarity: number;
78
- snippet?: string | null;
79
- intent_tags?: string[] | null;
80
- country?: string | null;
81
- ui_url?: string | null;
82
- };
83
- type SemanticSearchResponse = {
84
- items: SemanticSearchItem[];
85
- count: number;
86
- query_tokens?: number;
87
- };
88
- type SignalDetailResponse = {
89
- signal_id: string;
90
- domain: string;
91
- company_name?: string | null;
92
- category?: string | null;
93
- subcategory?: string | null;
94
- signal_score: number;
95
- trust_score?: number | null;
96
- intent_tags?: string[] | null;
97
- tech_stack?: string[] | null;
98
- country?: string | null;
99
- description?: string | null;
100
- social_links?: Record<string, string> | null;
101
- detected_at?: string | null;
102
- ui_url?: string | null;
103
- };
104
- type AgentDataUsageResponse = {
105
- api_key_prefix: string;
106
- usage: {
107
- period_start: string;
108
- period_end: string;
109
- used: number;
110
- limit: number;
111
- remaining: number;
112
- reset_at: string;
113
- };
114
- };
115
- type RecentSignalsOptions = {
116
- hours?: number;
117
- limit?: number;
118
- minScore?: number;
119
- category?: string;
120
- country?: string;
121
- tlds?: string[];
122
- };
123
- type SemanticSearchOptions = {
124
- limit?: number;
125
- minScore?: number;
126
- category?: string;
127
- country?: string;
128
- tlds?: string[];
129
- };
130
- declare class PounceAgentDataClient {
131
- private readonly apiKey;
132
- private readonly baseUrl;
133
- constructor(options: {
134
- apiKey: string;
135
- baseUrl?: string;
136
- });
137
- private extractRateLimit;
138
- private getJson;
139
- private postJson;
140
- /**
141
- * Get recent B2B signals.
142
- */
143
- recentSignals(options?: RecentSignalsOptions): Promise<{
144
- json: RecentSignalsResponse;
145
- rateLimit: RateLimitInfo;
15
+ canonical_name: string | null;
16
+ country: string | null;
17
+ city: string | null;
18
+ trust_tier: number;
19
+ quality_score: number;
20
+ primary_domain: string | null;
21
+ categories: Record<string, unknown> | null;
22
+ first_seen_at: string | null;
23
+ }
24
+ export interface SemanticSearchItem extends EntitySummary {
25
+ description: string | null;
26
+ employee_estimate: number | null;
27
+ relevance_score: number;
28
+ }
29
+ export interface EntityDetail extends EntitySummary {
30
+ legal_name: string | null;
31
+ lei: string | null;
32
+ region: string | null;
33
+ tech_stack: Record<string, unknown> | null;
34
+ keywords: string[] | null;
35
+ description: string | null;
36
+ employee_estimate: number | null;
37
+ revenue_estimate_usd: number | null;
38
+ founded_year: number | null;
39
+ legal_form: string | null;
40
+ is_verified: boolean;
41
+ intent_signals: Record<string, unknown> | null;
42
+ social_links: Record<string, string> | null;
43
+ last_enriched_at: string | null;
44
+ domains: Array<{
45
+ domain: string;
46
+ is_primary: boolean;
47
+ source: string | null;
146
48
  }>;
147
- /**
148
- * Semantic search for signals using natural language.
149
- *
150
- * @param query - Natural language search query
151
- * @param options - Search options
152
- *
153
- * @example
154
- * ```typescript
155
- * const { json } = await client.search('AI startups in healthcare', { limit: 10 });
156
- * for (const item of json.items) {
157
- * console.log(`${item.domain}: similarity=${item.similarity.toFixed(2)}`);
158
- * }
159
- * ```
160
- */
161
- search(query: string, options?: SemanticSearchOptions): Promise<{
162
- json: SemanticSearchResponse;
163
- rateLimit: RateLimitInfo;
49
+ registrations: Array<{
50
+ registry: string;
51
+ registry_id: string;
52
+ legal_name: string | null;
164
53
  }>;
165
- /**
166
- * Get full details for a specific signal.
167
- */
168
- signalDetail(signalId: string): Promise<{
169
- json: SignalDetailResponse;
170
- rateLimit: RateLimitInfo;
54
+ financials: Array<{
55
+ source: string;
56
+ fiscal_year: number | null;
57
+ revenue: number | null;
171
58
  }>;
172
- /**
173
- * Get API usage information for your account.
174
- */
175
- usage(): Promise<{
176
- json: AgentDataUsageResponse;
177
- rateLimit: RateLimitInfo;
59
+ connections: Array<{
60
+ connected_entity_id: number;
61
+ connection_type: string;
178
62
  }>;
179
- private parseSignal;
180
63
  }
181
- declare const PounceClient: typeof PounceAgentDataClient;
182
-
183
- export { type AgentDataRecentSignal, type AgentDataUsageResponse, PounceAgentDataClient, PounceClient, type RateLimitInfo, type RecentSignalsOptions, type RecentSignalsResponse, type SemanticSearchItem, type SemanticSearchOptions, type SemanticSearchResponse, type Signal, type SignalDetailResponse };
64
+ export interface SearchResponse {
65
+ items: EntitySummary[];
66
+ total: number;
67
+ limit: number;
68
+ offset: number;
69
+ }
70
+ export interface SemanticSearchResponse {
71
+ items: SemanticSearchItem[];
72
+ total: number;
73
+ query: string;
74
+ }
75
+ export interface BulkResponse {
76
+ items: EntitySummary[];
77
+ not_found: string[];
78
+ }
79
+ export interface MatchScoreResponse {
80
+ entity_a_id: number;
81
+ entity_b_id: number;
82
+ score: number;
83
+ grade: string;
84
+ dimensions: {
85
+ offering_fit: number;
86
+ timing: number;
87
+ trust: number;
88
+ reciprocity: number;
89
+ };
90
+ evidence: string[];
91
+ }
92
+ export interface StatsResponse {
93
+ total_entities: number;
94
+ verified_entities: number;
95
+ countries_covered: number;
96
+ api_version: string;
97
+ }
98
+ export interface RateLimitInfo {
99
+ remaining: number;
100
+ creditsUsed: number;
101
+ }
102
+ export interface ApiResponse<T> {
103
+ data: T;
104
+ rateLimit: RateLimitInfo;
105
+ }
106
+ export declare class PounceError extends Error {
107
+ statusCode: number;
108
+ detail: unknown;
109
+ constructor(statusCode: number, detail: unknown);
110
+ }
111
+ export interface PounceClientOptions {
112
+ apiKey?: string;
113
+ baseUrl?: string;
114
+ timeout?: number;
115
+ }
116
+ export declare class PounceClient {
117
+ private apiKey;
118
+ private baseUrl;
119
+ private timeout;
120
+ constructor(options?: PounceClientOptions);
121
+ private request;
122
+ /** Search companies with filters (1 credit). */
123
+ search(options?: {
124
+ q?: string;
125
+ country?: string;
126
+ category?: string;
127
+ minTrustTier?: number;
128
+ limit?: number;
129
+ offset?: number;
130
+ }): Promise<ApiResponse<SearchResponse>>;
131
+ /** AI semantic search by natural language (2 credits). */
132
+ semanticSearch(query: string, options?: {
133
+ country?: string;
134
+ limit?: number;
135
+ }): Promise<ApiResponse<SemanticSearchResponse>>;
136
+ /** Look up a company by domain (1 credit). */
137
+ lookup(domain: string): Promise<ApiResponse<EntitySummary>>;
138
+ /** Get full company profile by ID (1 credit). */
139
+ detail(entityId: number): Promise<ApiResponse<EntityDetail>>;
140
+ /** Bulk lookup by domains, max 100 (1 credit per found). */
141
+ bulkLookup(domains: string[]): Promise<ApiResponse<BulkResponse>>;
142
+ /** Compute match score between two companies (3 credits, Business+). */
143
+ matchScore(entityAId: number, entityBId: number): Promise<ApiResponse<MatchScoreResponse>>;
144
+ /** Get public platform statistics (free, no auth). */
145
+ stats(): Promise<ApiResponse<StatsResponse>>;
146
+ }
package/dist/index.js CHANGED
@@ -1,171 +1,127 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/index.ts
21
- var index_exports = {};
22
- __export(index_exports, {
23
- PounceAgentDataClient: () => PounceAgentDataClient,
24
- PounceClient: () => PounceClient
25
- });
26
- module.exports = __toCommonJS(index_exports);
27
- var PounceAgentDataClient = class {
28
- apiKey;
29
- baseUrl;
30
- constructor(options) {
31
- this.apiKey = options.apiKey;
32
- this.baseUrl = (options.baseUrl ?? "https://api.pounce.ch").replace(/\/$/, "");
33
- if (!this.apiKey.startsWith("pounce_live_")) {
34
- throw new Error("Invalid API key format (expected pounce_live_...)");
1
+ /**
2
+ * Pounce Agent Data SDK — TypeScript client for the Pounce v2 Entity API.
3
+ *
4
+ * @example
5
+ * ```ts
6
+ * import { PounceClient } from 'pounce-agent-data';
7
+ *
8
+ * const client = new PounceClient({ apiKey: 'your_key' });
9
+ * const { data } = await client.search({ q: 'AI companies', country: 'CH' });
10
+ * data.items.forEach(c => console.log(c.canonical_name, c.primary_domain));
11
+ * ```
12
+ */
13
+ const API_BASE = 'https://api.pounce.ch';
14
+ const V2_PREFIX = '/api/v1/v2';
15
+ export class PounceError extends Error {
16
+ constructor(statusCode, detail) {
17
+ super(`Pounce API error ${statusCode}: ${JSON.stringify(detail)}`);
18
+ this.statusCode = statusCode;
19
+ this.detail = detail;
20
+ this.name = 'PounceError';
35
21
  }
36
- }
37
- extractRateLimit(res) {
38
- return {
39
- limit: res.headers.get("X-RateLimit-Limit") ? Number(res.headers.get("X-RateLimit-Limit")) : void 0,
40
- remaining: res.headers.get("X-RateLimit-Remaining") ? Number(res.headers.get("X-RateLimit-Remaining")) : void 0,
41
- resetUnix: res.headers.get("X-RateLimit-Reset") ? Number(res.headers.get("X-RateLimit-Reset")) : void 0
42
- };
43
- }
44
- async getJson(path, params) {
45
- const url = new URL(this.baseUrl + path);
46
- if (params) {
47
- for (const [k, v] of Object.entries(params)) {
48
- if (v !== void 0) url.searchParams.set(k, String(v));
49
- }
22
+ }
23
+ export class PounceClient {
24
+ constructor(options = {}) {
25
+ this.apiKey = options.apiKey || process.env.POUNCE_API_KEY || '';
26
+ this.baseUrl = (options.baseUrl || process.env.POUNCE_API_BASE || API_BASE).replace(/\/$/, '');
27
+ this.timeout = options.timeout || 30000;
50
28
  }
51
- const res = await fetch(url.toString(), {
52
- method: "GET",
53
- headers: {
54
- Authorization: `Bearer ${this.apiKey}`,
55
- Accept: "application/json"
56
- }
57
- });
58
- const rateLimit = this.extractRateLimit(res);
59
- if (!res.ok) {
60
- const text = await res.text();
61
- throw new Error(`HTTP ${res.status}: ${text}`);
29
+ async request(method, path, options) {
30
+ let url = `${this.baseUrl}${V2_PREFIX}${path}`;
31
+ if (options?.params) {
32
+ const searchParams = new URLSearchParams();
33
+ for (const [key, value] of Object.entries(options.params)) {
34
+ if (value !== undefined && value !== null) {
35
+ searchParams.set(key, String(value));
36
+ }
37
+ }
38
+ const qs = searchParams.toString();
39
+ if (qs)
40
+ url += `?${qs}`;
41
+ }
42
+ const controller = new AbortController();
43
+ const timeoutId = setTimeout(() => controller.abort(), this.timeout);
44
+ try {
45
+ const response = await fetch(url, {
46
+ method,
47
+ headers: {
48
+ 'Authorization': `Bearer ${this.apiKey}`,
49
+ 'Content-Type': 'application/json',
50
+ 'User-Agent': 'pounce-agent-data/2.0.0 typescript',
51
+ },
52
+ body: options?.body ? JSON.stringify(options.body) : undefined,
53
+ signal: controller.signal,
54
+ });
55
+ const rateLimit = {
56
+ remaining: parseInt(response.headers.get('x-ratelimit-remaining') || '-1', 10),
57
+ creditsUsed: parseInt(response.headers.get('x-credits-used') || '0', 10),
58
+ };
59
+ if (!response.ok) {
60
+ let detail;
61
+ try {
62
+ detail = await response.json();
63
+ }
64
+ catch {
65
+ detail = await response.text();
66
+ }
67
+ throw new PounceError(response.status, detail);
68
+ }
69
+ const data = (await response.json());
70
+ return { data, rateLimit };
71
+ }
72
+ finally {
73
+ clearTimeout(timeoutId);
74
+ }
62
75
  }
63
- const json = await res.json();
64
- return { json, rateLimit };
65
- }
66
- async postJson(path, body) {
67
- const url = new URL(this.baseUrl + path);
68
- const res = await fetch(url.toString(), {
69
- method: "POST",
70
- headers: {
71
- Authorization: `Bearer ${this.apiKey}`,
72
- Accept: "application/json",
73
- "Content-Type": "application/json"
74
- },
75
- body: JSON.stringify(body)
76
- });
77
- const rateLimit = this.extractRateLimit(res);
78
- if (!res.ok) {
79
- const text = await res.text();
80
- throw new Error(`HTTP ${res.status}: ${text}`);
76
+ /** Search companies with filters (1 credit). */
77
+ async search(options = {}) {
78
+ const params = {
79
+ limit: options.limit || 25,
80
+ offset: options.offset || 0,
81
+ min_trust_tier: options.minTrustTier || 3,
82
+ };
83
+ if (options.q)
84
+ params.q = options.q;
85
+ if (options.country)
86
+ params.country = options.country.toUpperCase();
87
+ if (options.category)
88
+ params.category = options.category;
89
+ return this.request('GET', '/entities/search', { params });
81
90
  }
82
- const json = await res.json();
83
- return { json, rateLimit };
84
- }
85
- // ---------------------------------------------------------------------------
86
- // Public API Methods
87
- // ---------------------------------------------------------------------------
88
- /**
89
- * Get recent B2B signals.
90
- */
91
- async recentSignals(options = {}) {
92
- const { hours = 24, limit = 100, minScore = 50, category, country, tlds } = options;
93
- return this.getJson("/api/v1/agent-data/signals/recent", {
94
- hours,
95
- limit,
96
- min_score: minScore,
97
- category,
98
- country,
99
- tlds: tlds?.join(",")
100
- });
101
- }
102
- /**
103
- * Semantic search for signals using natural language.
104
- *
105
- * @param query - Natural language search query
106
- * @param options - Search options
107
- *
108
- * @example
109
- * ```typescript
110
- * const { json } = await client.search('AI startups in healthcare', { limit: 10 });
111
- * for (const item of json.items) {
112
- * console.log(`${item.domain}: similarity=${item.similarity.toFixed(2)}`);
113
- * }
114
- * ```
115
- */
116
- async search(query, options = {}) {
117
- const { limit = 20, minScore = 50, category, country, tlds } = options;
118
- const body = {
119
- query,
120
- limit,
121
- min_score: minScore
122
- };
123
- const filters = {};
124
- if (category) filters.category = category;
125
- if (country) filters.country = country;
126
- if (tlds) filters.tlds = tlds;
127
- if (Object.keys(filters).length > 0) body.filters = filters;
128
- return this.postJson(
129
- "/api/v1/agent-data/search/semantic",
130
- body
131
- );
132
- }
133
- /**
134
- * Get full details for a specific signal.
135
- */
136
- async signalDetail(signalId) {
137
- return this.getJson(
138
- `/api/v1/agent-data/signals/${encodeURIComponent(signalId)}`
139
- );
140
- }
141
- /**
142
- * Get API usage information for your account.
143
- */
144
- async usage() {
145
- return this.getJson("/api/v1/agent-data/usage");
146
- }
147
- // stream() method removed - streaming endpoint deprecated
148
- // See https://gitlab.pounce.ch/pounce/pounce/-/issues/829
149
- parseSignal(raw) {
150
- return {
151
- signalId: raw.signal_id ?? String(raw.id),
152
- domain: raw.domain,
153
- companyName: raw.title,
154
- category: raw.category,
155
- subcategory: raw.subcategory,
156
- signalScore: raw.signal_score,
157
- intentTags: raw.intent_tags,
158
- techStack: raw.tech_stack,
159
- country: raw.country,
160
- description: raw.description,
161
- detectedAt: raw.discovered_at ?? raw.scanned_at,
162
- uiUrl: raw.ui_url
163
- };
164
- }
165
- };
166
- var PounceClient = PounceAgentDataClient;
167
- // Annotate the CommonJS export names for ESM import in node:
168
- 0 && (module.exports = {
169
- PounceAgentDataClient,
170
- PounceClient
171
- });
91
+ /** AI semantic search by natural language (2 credits). */
92
+ async semanticSearch(query, options) {
93
+ return this.request('POST', '/entities/search/semantic', {
94
+ body: {
95
+ query,
96
+ country: options?.country?.toUpperCase(),
97
+ limit: options?.limit || 25,
98
+ },
99
+ });
100
+ }
101
+ /** Look up a company by domain (1 credit). */
102
+ async lookup(domain) {
103
+ return this.request('GET', '/entities/lookup', {
104
+ params: { domain },
105
+ });
106
+ }
107
+ /** Get full company profile by ID (1 credit). */
108
+ async detail(entityId) {
109
+ return this.request('GET', `/entities/${entityId}`);
110
+ }
111
+ /** Bulk lookup by domains, max 100 (1 credit per found). */
112
+ async bulkLookup(domains) {
113
+ return this.request('POST', '/entities/bulk', {
114
+ body: { domains: domains.slice(0, 100) },
115
+ });
116
+ }
117
+ /** Compute match score between two companies (3 credits, Business+). */
118
+ async matchScore(entityAId, entityBId) {
119
+ return this.request('POST', '/matching/score', {
120
+ body: { entity_a_id: entityAId, entity_b_id: entityBId },
121
+ });
122
+ }
123
+ /** Get public platform statistics (free, no auth). */
124
+ async stats() {
125
+ return this.request('GET', '/stats');
126
+ }
127
+ }
package/package.json CHANGED
@@ -1,46 +1,37 @@
1
1
  {
2
2
  "name": "pounce-agent-data",
3
- "version": "1.1.0",
4
- "description": "TypeScript SDK for the Pounce Agent Data API - B2B company signals for AI agents",
3
+ "version": "2.0.0",
4
+ "description": "TypeScript SDK for the Pounce v2 Entity API search, look up, and enrich 59M+ verified B2B companies.",
5
5
  "main": "dist/index.js",
6
- "module": "dist/index.mjs",
7
6
  "types": "dist/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "import": "./dist/index.mjs",
11
- "require": "./dist/index.js",
12
- "types": "./dist/index.d.ts"
13
- }
14
- },
15
7
  "files": [
16
8
  "dist"
17
9
  ],
18
10
  "scripts": {
19
- "build": "tsup src/index.ts --format cjs,esm --dts",
11
+ "build": "tsc",
20
12
  "prepublishOnly": "npm run build"
21
13
  },
22
14
  "keywords": [
23
15
  "pounce",
24
16
  "b2b",
25
- "signals",
26
- "ai",
27
- "agents",
17
+ "companies",
28
18
  "api",
29
- "sdk"
19
+ "sdk",
20
+ "ai",
21
+ "agents"
30
22
  ],
31
- "author": "Pounce Signal Intelligence <hello@pounce.ch>",
23
+ "author": "Pounce",
32
24
  "license": "MIT",
33
- "repository": {
34
- "type": "git",
35
- "url": "https://gitlab.pounce.ch/pounce/pounce.git",
36
- "directory": "sdk/ts"
37
- },
38
- "homepage": "https://pounce.ch/developers",
39
25
  "devDependencies": {
40
- "tsup": "^8.0.0",
26
+ "@types/node": "^25.3.0",
41
27
  "typescript": "^5.0.0"
42
28
  },
43
29
  "engines": {
44
30
  "node": ">=18.0.0"
45
- }
31
+ },
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "https://gitlab.pounce.ch/pounce/pounce.git"
35
+ },
36
+ "homepage": "https://pounce.ch/developers"
46
37
  }
package/README.md DELETED
@@ -1,62 +0,0 @@
1
- # Pounce Agent Data SDK
2
-
3
- TypeScript SDK for the [Pounce Agent Data API](https://pounce.ch/developers) - Connect your AI agents to 500k+ B2B company signals.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- npm install pounce-agent-data
9
- ```
10
-
11
- ## Quick Start
12
-
13
- ```typescript
14
- import { PounceClient } from 'pounce-agent-data';
15
-
16
- const client = new PounceClient({ apiKey: 'pounce_live_xxx' });
17
-
18
- // Recent signals
19
- const { json } = await client.recentSignals({ limit: 10, category: 'saas' });
20
- for (const item of json.items) {
21
- console.log(`${item.domain}: ${item.signal_score}`);
22
- }
23
-
24
- // Semantic search
25
- const results = await client.search('AI startups in healthcare', { limit: 20 });
26
- for (const item of results.json.items) {
27
- console.log(`${item.domain}: similarity=${item.similarity.toFixed(2)}`);
28
- }
29
-
30
- // Stream new signals (real-time)
31
- for await (const signal of client.stream({ minScore: 70 })) {
32
- console.log(`New: ${signal.domain} (score=${signal.signalScore})`);
33
- }
34
- ```
35
-
36
- ## API Key
37
-
38
- Get your API key:
39
- 1. Sign up at [pounce.ch](https://pounce.ch)
40
- 2. Subscribe to Pro ($49/month) or Business ($149/month)
41
- 3. Generate API key in **Settings → API Access**
42
-
43
- ## Rate Limits
44
-
45
- | Tier | Requests/month |
46
- |------|----------------|
47
- | Pro | 1,000 |
48
- | Business | 10,000 |
49
-
50
- ## Documentation
51
-
52
- - [API Documentation](https://pounce.ch/developers)
53
- - [Skill File](https://pounce.ch/skill.md)
54
- - [API Reference](https://api.pounce.ch/docs#/agent-data)
55
-
56
- ## Support
57
-
58
- - Email: hello@pounce.ch
59
-
60
- ## License
61
-
62
- MIT
package/dist/index.d.mts DELETED
@@ -1,183 +0,0 @@
1
- /**
2
- * Pounce Agent Data SDK - TypeScript Client
3
- *
4
- * Minimal client for the Pounce Agent Data API.
5
- * Supports recent signals, semantic search, signal details, and SSE streaming.
6
- *
7
- * @example
8
- * ```typescript
9
- * import { PounceAgentDataClient } from '@pounce/agent-data';
10
- *
11
- * const client = new PounceAgentDataClient({ apiKey: 'pounce_live_xxx' });
12
- *
13
- * // Recent signals
14
- * const { json, rateLimit } = await client.recentSignals({ limit: 10, category: 'saas' });
15
- *
16
- * // Semantic search
17
- * const results = await client.search('AI companies in healthcare', { limit: 20 });
18
- *
19
- * // Use search for targeted queries
20
- * const results = await client.search('AI healthcare');
21
- * results.json.items.forEach(r => console.log(r.domain));
22
- * ```
23
- */
24
- type RateLimitInfo = {
25
- limit?: number;
26
- remaining?: number;
27
- resetUnix?: number;
28
- };
29
- type Signal = {
30
- signalId: string;
31
- domain: string;
32
- companyName?: string | null;
33
- category?: string | null;
34
- subcategory?: string | null;
35
- signalScore: number;
36
- trustScore?: number | null;
37
- intentTags?: string[] | null;
38
- techStack?: string[] | null;
39
- country?: string | null;
40
- description?: string | null;
41
- detectedAt?: string | null;
42
- uiUrl?: string | null;
43
- };
44
- type AgentDataRecentSignal = {
45
- id: number;
46
- signal_id?: string;
47
- domain: string;
48
- tld: string;
49
- title?: string | null;
50
- description?: string | null;
51
- h1?: string | null;
52
- category?: string | null;
53
- subcategory?: string | null;
54
- business_type?: string | null;
55
- signal_score: number;
56
- signal_grade?: string | null;
57
- tech_stack?: string[] | null;
58
- intent_tags?: string[] | null;
59
- hosting_provider?: string | null;
60
- country?: string | null;
61
- has_real_content: boolean;
62
- scanned_at?: string | null;
63
- discovered_at: string;
64
- ui_url?: string | null;
65
- };
66
- type RecentSignalsResponse = {
67
- items: AgentDataRecentSignal[];
68
- count: number;
69
- has_more?: boolean;
70
- };
71
- type SemanticSearchItem = {
72
- signal_id: string;
73
- domain: string;
74
- company_name?: string | null;
75
- category?: string | null;
76
- signal_score: number;
77
- similarity: number;
78
- snippet?: string | null;
79
- intent_tags?: string[] | null;
80
- country?: string | null;
81
- ui_url?: string | null;
82
- };
83
- type SemanticSearchResponse = {
84
- items: SemanticSearchItem[];
85
- count: number;
86
- query_tokens?: number;
87
- };
88
- type SignalDetailResponse = {
89
- signal_id: string;
90
- domain: string;
91
- company_name?: string | null;
92
- category?: string | null;
93
- subcategory?: string | null;
94
- signal_score: number;
95
- trust_score?: number | null;
96
- intent_tags?: string[] | null;
97
- tech_stack?: string[] | null;
98
- country?: string | null;
99
- description?: string | null;
100
- social_links?: Record<string, string> | null;
101
- detected_at?: string | null;
102
- ui_url?: string | null;
103
- };
104
- type AgentDataUsageResponse = {
105
- api_key_prefix: string;
106
- usage: {
107
- period_start: string;
108
- period_end: string;
109
- used: number;
110
- limit: number;
111
- remaining: number;
112
- reset_at: string;
113
- };
114
- };
115
- type RecentSignalsOptions = {
116
- hours?: number;
117
- limit?: number;
118
- minScore?: number;
119
- category?: string;
120
- country?: string;
121
- tlds?: string[];
122
- };
123
- type SemanticSearchOptions = {
124
- limit?: number;
125
- minScore?: number;
126
- category?: string;
127
- country?: string;
128
- tlds?: string[];
129
- };
130
- declare class PounceAgentDataClient {
131
- private readonly apiKey;
132
- private readonly baseUrl;
133
- constructor(options: {
134
- apiKey: string;
135
- baseUrl?: string;
136
- });
137
- private extractRateLimit;
138
- private getJson;
139
- private postJson;
140
- /**
141
- * Get recent B2B signals.
142
- */
143
- recentSignals(options?: RecentSignalsOptions): Promise<{
144
- json: RecentSignalsResponse;
145
- rateLimit: RateLimitInfo;
146
- }>;
147
- /**
148
- * Semantic search for signals using natural language.
149
- *
150
- * @param query - Natural language search query
151
- * @param options - Search options
152
- *
153
- * @example
154
- * ```typescript
155
- * const { json } = await client.search('AI startups in healthcare', { limit: 10 });
156
- * for (const item of json.items) {
157
- * console.log(`${item.domain}: similarity=${item.similarity.toFixed(2)}`);
158
- * }
159
- * ```
160
- */
161
- search(query: string, options?: SemanticSearchOptions): Promise<{
162
- json: SemanticSearchResponse;
163
- rateLimit: RateLimitInfo;
164
- }>;
165
- /**
166
- * Get full details for a specific signal.
167
- */
168
- signalDetail(signalId: string): Promise<{
169
- json: SignalDetailResponse;
170
- rateLimit: RateLimitInfo;
171
- }>;
172
- /**
173
- * Get API usage information for your account.
174
- */
175
- usage(): Promise<{
176
- json: AgentDataUsageResponse;
177
- rateLimit: RateLimitInfo;
178
- }>;
179
- private parseSignal;
180
- }
181
- declare const PounceClient: typeof PounceAgentDataClient;
182
-
183
- export { type AgentDataRecentSignal, type AgentDataUsageResponse, PounceAgentDataClient, PounceClient, type RateLimitInfo, type RecentSignalsOptions, type RecentSignalsResponse, type SemanticSearchItem, type SemanticSearchOptions, type SemanticSearchResponse, type Signal, type SignalDetailResponse };
package/dist/index.mjs DELETED
@@ -1,145 +0,0 @@
1
- // src/index.ts
2
- var PounceAgentDataClient = class {
3
- apiKey;
4
- baseUrl;
5
- constructor(options) {
6
- this.apiKey = options.apiKey;
7
- this.baseUrl = (options.baseUrl ?? "https://api.pounce.ch").replace(/\/$/, "");
8
- if (!this.apiKey.startsWith("pounce_live_")) {
9
- throw new Error("Invalid API key format (expected pounce_live_...)");
10
- }
11
- }
12
- extractRateLimit(res) {
13
- return {
14
- limit: res.headers.get("X-RateLimit-Limit") ? Number(res.headers.get("X-RateLimit-Limit")) : void 0,
15
- remaining: res.headers.get("X-RateLimit-Remaining") ? Number(res.headers.get("X-RateLimit-Remaining")) : void 0,
16
- resetUnix: res.headers.get("X-RateLimit-Reset") ? Number(res.headers.get("X-RateLimit-Reset")) : void 0
17
- };
18
- }
19
- async getJson(path, params) {
20
- const url = new URL(this.baseUrl + path);
21
- if (params) {
22
- for (const [k, v] of Object.entries(params)) {
23
- if (v !== void 0) url.searchParams.set(k, String(v));
24
- }
25
- }
26
- const res = await fetch(url.toString(), {
27
- method: "GET",
28
- headers: {
29
- Authorization: `Bearer ${this.apiKey}`,
30
- Accept: "application/json"
31
- }
32
- });
33
- const rateLimit = this.extractRateLimit(res);
34
- if (!res.ok) {
35
- const text = await res.text();
36
- throw new Error(`HTTP ${res.status}: ${text}`);
37
- }
38
- const json = await res.json();
39
- return { json, rateLimit };
40
- }
41
- async postJson(path, body) {
42
- const url = new URL(this.baseUrl + path);
43
- const res = await fetch(url.toString(), {
44
- method: "POST",
45
- headers: {
46
- Authorization: `Bearer ${this.apiKey}`,
47
- Accept: "application/json",
48
- "Content-Type": "application/json"
49
- },
50
- body: JSON.stringify(body)
51
- });
52
- const rateLimit = this.extractRateLimit(res);
53
- if (!res.ok) {
54
- const text = await res.text();
55
- throw new Error(`HTTP ${res.status}: ${text}`);
56
- }
57
- const json = await res.json();
58
- return { json, rateLimit };
59
- }
60
- // ---------------------------------------------------------------------------
61
- // Public API Methods
62
- // ---------------------------------------------------------------------------
63
- /**
64
- * Get recent B2B signals.
65
- */
66
- async recentSignals(options = {}) {
67
- const { hours = 24, limit = 100, minScore = 50, category, country, tlds } = options;
68
- return this.getJson("/api/v1/agent-data/signals/recent", {
69
- hours,
70
- limit,
71
- min_score: minScore,
72
- category,
73
- country,
74
- tlds: tlds?.join(",")
75
- });
76
- }
77
- /**
78
- * Semantic search for signals using natural language.
79
- *
80
- * @param query - Natural language search query
81
- * @param options - Search options
82
- *
83
- * @example
84
- * ```typescript
85
- * const { json } = await client.search('AI startups in healthcare', { limit: 10 });
86
- * for (const item of json.items) {
87
- * console.log(`${item.domain}: similarity=${item.similarity.toFixed(2)}`);
88
- * }
89
- * ```
90
- */
91
- async search(query, options = {}) {
92
- const { limit = 20, minScore = 50, category, country, tlds } = options;
93
- const body = {
94
- query,
95
- limit,
96
- min_score: minScore
97
- };
98
- const filters = {};
99
- if (category) filters.category = category;
100
- if (country) filters.country = country;
101
- if (tlds) filters.tlds = tlds;
102
- if (Object.keys(filters).length > 0) body.filters = filters;
103
- return this.postJson(
104
- "/api/v1/agent-data/search/semantic",
105
- body
106
- );
107
- }
108
- /**
109
- * Get full details for a specific signal.
110
- */
111
- async signalDetail(signalId) {
112
- return this.getJson(
113
- `/api/v1/agent-data/signals/${encodeURIComponent(signalId)}`
114
- );
115
- }
116
- /**
117
- * Get API usage information for your account.
118
- */
119
- async usage() {
120
- return this.getJson("/api/v1/agent-data/usage");
121
- }
122
- // stream() method removed - streaming endpoint deprecated
123
- // See https://gitlab.pounce.ch/pounce/pounce/-/issues/829
124
- parseSignal(raw) {
125
- return {
126
- signalId: raw.signal_id ?? String(raw.id),
127
- domain: raw.domain,
128
- companyName: raw.title,
129
- category: raw.category,
130
- subcategory: raw.subcategory,
131
- signalScore: raw.signal_score,
132
- intentTags: raw.intent_tags,
133
- techStack: raw.tech_stack,
134
- country: raw.country,
135
- description: raw.description,
136
- detectedAt: raw.discovered_at ?? raw.scanned_at,
137
- uiUrl: raw.ui_url
138
- };
139
- }
140
- };
141
- var PounceClient = PounceAgentDataClient;
142
- export {
143
- PounceAgentDataClient,
144
- PounceClient
145
- };