@hydrafetch/node-sdk 0.5.0 → 0.6.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/README.md +27 -0
- package/dist/index.cjs +10 -0
- package/dist/index.d.cts +74 -1
- package/dist/index.d.ts +74 -1
- package/dist/index.js +10 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -166,6 +166,31 @@ const { results } = await hf.search('post-quantum TLS adoption', {
|
|
|
166
166
|
results.forEach((r) => console.log(r.title, r.url, r.data?.markdown));
|
|
167
167
|
```
|
|
168
168
|
|
|
169
|
+
## Jobs
|
|
170
|
+
|
|
171
|
+
Search open jobs collected from company career sites and hiring platforms, by the words in the job title:
|
|
172
|
+
|
|
173
|
+
```ts
|
|
174
|
+
const jobs = await hf.searchJobs('data engineer', {
|
|
175
|
+
location: 'Berlin',
|
|
176
|
+
postedWithinDays: 14,
|
|
177
|
+
limit: 20,
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
jobs.forEach((j) => console.log(j.title, j.company, j.location, j.url));
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
See what changed in a company's hiring since a date: what is open now, what opened and what closed, by department, seniority and location, with the jobs themselves:
|
|
184
|
+
|
|
185
|
+
```ts
|
|
186
|
+
const [acme] = await hf.hiringChanges('acme.com', '2026-10-01');
|
|
187
|
+
|
|
188
|
+
console.log(acme.totals); // { open: 42, opened: 6, closed: 3 }
|
|
189
|
+
acme.opened.forEach((j) => console.log(j.title, j.seniority, j.firstSeenAt));
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
A search costs 1 credit per 10 jobs returned, and an empty one is free. Hiring changes cost 1 credit per company we have jobs for; companies we do not track yet come back empty and are free.
|
|
193
|
+
|
|
169
194
|
## Brand data
|
|
170
195
|
|
|
171
196
|
```ts
|
|
@@ -251,6 +276,8 @@ const hf = new Hydrafetch({
|
|
|
251
276
|
| `markdown(url, options?)` | `string` | 1 |
|
|
252
277
|
| `map(url, options?)` | `MapResult` | 1 |
|
|
253
278
|
| `search(query, options?)` | `SearchResult` | 1 + 1 per scraped result |
|
|
279
|
+
| `searchJobs(query, options?)` | `OpenJob[]` | 1 per 10 jobs |
|
|
280
|
+
| `hiringChanges(domains, since, options?)` | `CompanyHiringChanges[]` | 1 per company with jobs |
|
|
254
281
|
| `extract(urls, options?)` | `ExtractResult<T>` | 5 per URL |
|
|
255
282
|
| `brand(domain)` | `BrandResult` | 5 |
|
|
256
283
|
| `logo(domain, options?)` | `LogoResult` | 1 |
|
package/dist/index.cjs
CHANGED
|
@@ -235,6 +235,16 @@ var Hydrafetch = class {
|
|
|
235
235
|
search(query, options = {}) {
|
|
236
236
|
return this.request("POST", "/v1/web/search", { query, ...options });
|
|
237
237
|
}
|
|
238
|
+
searchJobs(query, options = {}) {
|
|
239
|
+
return this.request("POST", "/v1/web/index/jobs/search", { query, ...options });
|
|
240
|
+
}
|
|
241
|
+
hiringChanges(domains, since, options = {}) {
|
|
242
|
+
return this.request("POST", "/v1/web/index/jobs/changes", {
|
|
243
|
+
domains: Array.isArray(domains) ? domains : [domains],
|
|
244
|
+
since: since instanceof Date ? since.toISOString() : since,
|
|
245
|
+
...options
|
|
246
|
+
});
|
|
247
|
+
}
|
|
238
248
|
async extract(urls, options = {}) {
|
|
239
249
|
const { schema, ...rest } = options;
|
|
240
250
|
return this.request("POST", "/v1/web/extract", {
|
package/dist/index.d.cts
CHANGED
|
@@ -252,6 +252,77 @@ interface RateResultResponse {
|
|
|
252
252
|
requestId: string;
|
|
253
253
|
rating: ResultRating;
|
|
254
254
|
}
|
|
255
|
+
interface SearchJobsOptions {
|
|
256
|
+
/** A city, region or country to match, like "Berlin". */
|
|
257
|
+
location?: string;
|
|
258
|
+
/** Only jobs marked remote. */
|
|
259
|
+
remoteOnly?: boolean;
|
|
260
|
+
/** Only jobs posted in the last N days (1 to 365). */
|
|
261
|
+
postedWithinDays?: number;
|
|
262
|
+
/** Max jobs to return, 1 to 100 (default 10). Each 10 jobs returned cost 1 credit. */
|
|
263
|
+
limit?: number;
|
|
264
|
+
/** Include each job's description text when we hold it. */
|
|
265
|
+
includeDescriptions?: boolean;
|
|
266
|
+
}
|
|
267
|
+
interface JobPay {
|
|
268
|
+
min: number | null;
|
|
269
|
+
max: number | null;
|
|
270
|
+
currency: string | null;
|
|
271
|
+
interval: string | null;
|
|
272
|
+
}
|
|
273
|
+
interface OpenJob {
|
|
274
|
+
title: string;
|
|
275
|
+
company: string | null;
|
|
276
|
+
/** The company's website. */
|
|
277
|
+
domain: string;
|
|
278
|
+
/** The hiring platform the job is posted on. */
|
|
279
|
+
board: string;
|
|
280
|
+
department: string | null;
|
|
281
|
+
location: string | null;
|
|
282
|
+
remote: boolean | null;
|
|
283
|
+
employmentType: string | null;
|
|
284
|
+
postedAt: string | null;
|
|
285
|
+
/** When the job was first seen open. */
|
|
286
|
+
firstSeenAt: string;
|
|
287
|
+
url: string | null;
|
|
288
|
+
applyUrl: string | null;
|
|
289
|
+
pay: JobPay | null;
|
|
290
|
+
description?: string | null;
|
|
291
|
+
}
|
|
292
|
+
interface HiringChangesOptions {
|
|
293
|
+
/** Include each opened and closed job's description text when we hold it. */
|
|
294
|
+
includeDescriptions?: boolean;
|
|
295
|
+
}
|
|
296
|
+
interface HiringCounts {
|
|
297
|
+
open: number;
|
|
298
|
+
opened: number;
|
|
299
|
+
closed: number;
|
|
300
|
+
}
|
|
301
|
+
interface HiringChangePosting {
|
|
302
|
+
title: string;
|
|
303
|
+
department: string | null;
|
|
304
|
+
location: string | null;
|
|
305
|
+
seniority: string;
|
|
306
|
+
board: string;
|
|
307
|
+
url: string | null;
|
|
308
|
+
postedAt: string | null;
|
|
309
|
+
firstSeenAt: string;
|
|
310
|
+
closedAt: string | null;
|
|
311
|
+
description?: string | null;
|
|
312
|
+
}
|
|
313
|
+
interface CompanyHiringChanges {
|
|
314
|
+
domain: string;
|
|
315
|
+
company: string | null;
|
|
316
|
+
lastReadAt: string | null;
|
|
317
|
+
since: string;
|
|
318
|
+
totals: HiringCounts;
|
|
319
|
+
byDepartment: Record<string, HiringCounts>;
|
|
320
|
+
bySeniority: Record<string, HiringCounts>;
|
|
321
|
+
byLocation: Record<string, HiringCounts>;
|
|
322
|
+
opened: HiringChangePosting[];
|
|
323
|
+
closed: HiringChangePosting[];
|
|
324
|
+
truncated: boolean;
|
|
325
|
+
}
|
|
255
326
|
|
|
256
327
|
interface HydrafetchOptions {
|
|
257
328
|
apiKey?: string;
|
|
@@ -275,6 +346,8 @@ declare class Hydrafetch {
|
|
|
275
346
|
rateResult(input: RateResultInput): Promise<RateResultResponse>;
|
|
276
347
|
map(url: string, options?: MapOptions): Promise<MapResult>;
|
|
277
348
|
search(query: string, options?: SearchOptions): Promise<SearchResult>;
|
|
349
|
+
searchJobs(query: string, options?: SearchJobsOptions): Promise<OpenJob[]>;
|
|
350
|
+
hiringChanges(domains: string | string[], since: string | Date, options?: HiringChangesOptions): Promise<CompanyHiringChanges[]>;
|
|
278
351
|
extract<T = unknown>(urls: string | string[], options?: ExtractOptions): Promise<ExtractResult<T>>;
|
|
279
352
|
brand(domain: string): Promise<BrandResult>;
|
|
280
353
|
logo(domain: string, options?: BrandOptions): Promise<LogoResult>;
|
|
@@ -314,4 +387,4 @@ declare class HydrafetchTimeoutError extends HydrafetchError {
|
|
|
314
387
|
constructor(message: string);
|
|
315
388
|
}
|
|
316
389
|
|
|
317
|
-
export { type BatchOptions, type BrandOptions, type BrandResult, type CrawlOptions, type ExtractItem, type ExtractOptions, type ExtractResult, type ExtractSchema, type Format, Hydrafetch, HydrafetchError, type HydrafetchOptions, HydrafetchTimeoutError, type ImagesResult, type JobPage, type JobResult, type JobStatus, type Location, type LogoResult, type MapOptions, type MapResult, type PageImage, type PageMetadata, type RateResultInput, type RateResultResponse, type ResultFeedbackReason, type ResultRating, type ScrapeBase, type ScrapeContent, type ScrapeOptions, type ScrapeResult, type ScreenshotOptions, type ScreenshotResult, type SearchOptions, type SearchResult, type SearchResultItem, type StyleguideOptions, type StyleguideResult, type Usage, type WaitOptions, type ZodLike };
|
|
390
|
+
export { type BatchOptions, type BrandOptions, type BrandResult, type CompanyHiringChanges, type CrawlOptions, type ExtractItem, type ExtractOptions, type ExtractResult, type ExtractSchema, type Format, type HiringChangePosting, type HiringChangesOptions, type HiringCounts, Hydrafetch, HydrafetchError, type HydrafetchOptions, HydrafetchTimeoutError, type ImagesResult, type JobPage, type JobPay, type JobResult, type JobStatus, type Location, type LogoResult, type MapOptions, type MapResult, type OpenJob, type PageImage, type PageMetadata, type RateResultInput, type RateResultResponse, type ResultFeedbackReason, type ResultRating, type ScrapeBase, type ScrapeContent, type ScrapeOptions, type ScrapeResult, type ScreenshotOptions, type ScreenshotResult, type SearchJobsOptions, type SearchOptions, type SearchResult, type SearchResultItem, type StyleguideOptions, type StyleguideResult, type Usage, type WaitOptions, type ZodLike };
|
package/dist/index.d.ts
CHANGED
|
@@ -252,6 +252,77 @@ interface RateResultResponse {
|
|
|
252
252
|
requestId: string;
|
|
253
253
|
rating: ResultRating;
|
|
254
254
|
}
|
|
255
|
+
interface SearchJobsOptions {
|
|
256
|
+
/** A city, region or country to match, like "Berlin". */
|
|
257
|
+
location?: string;
|
|
258
|
+
/** Only jobs marked remote. */
|
|
259
|
+
remoteOnly?: boolean;
|
|
260
|
+
/** Only jobs posted in the last N days (1 to 365). */
|
|
261
|
+
postedWithinDays?: number;
|
|
262
|
+
/** Max jobs to return, 1 to 100 (default 10). Each 10 jobs returned cost 1 credit. */
|
|
263
|
+
limit?: number;
|
|
264
|
+
/** Include each job's description text when we hold it. */
|
|
265
|
+
includeDescriptions?: boolean;
|
|
266
|
+
}
|
|
267
|
+
interface JobPay {
|
|
268
|
+
min: number | null;
|
|
269
|
+
max: number | null;
|
|
270
|
+
currency: string | null;
|
|
271
|
+
interval: string | null;
|
|
272
|
+
}
|
|
273
|
+
interface OpenJob {
|
|
274
|
+
title: string;
|
|
275
|
+
company: string | null;
|
|
276
|
+
/** The company's website. */
|
|
277
|
+
domain: string;
|
|
278
|
+
/** The hiring platform the job is posted on. */
|
|
279
|
+
board: string;
|
|
280
|
+
department: string | null;
|
|
281
|
+
location: string | null;
|
|
282
|
+
remote: boolean | null;
|
|
283
|
+
employmentType: string | null;
|
|
284
|
+
postedAt: string | null;
|
|
285
|
+
/** When the job was first seen open. */
|
|
286
|
+
firstSeenAt: string;
|
|
287
|
+
url: string | null;
|
|
288
|
+
applyUrl: string | null;
|
|
289
|
+
pay: JobPay | null;
|
|
290
|
+
description?: string | null;
|
|
291
|
+
}
|
|
292
|
+
interface HiringChangesOptions {
|
|
293
|
+
/** Include each opened and closed job's description text when we hold it. */
|
|
294
|
+
includeDescriptions?: boolean;
|
|
295
|
+
}
|
|
296
|
+
interface HiringCounts {
|
|
297
|
+
open: number;
|
|
298
|
+
opened: number;
|
|
299
|
+
closed: number;
|
|
300
|
+
}
|
|
301
|
+
interface HiringChangePosting {
|
|
302
|
+
title: string;
|
|
303
|
+
department: string | null;
|
|
304
|
+
location: string | null;
|
|
305
|
+
seniority: string;
|
|
306
|
+
board: string;
|
|
307
|
+
url: string | null;
|
|
308
|
+
postedAt: string | null;
|
|
309
|
+
firstSeenAt: string;
|
|
310
|
+
closedAt: string | null;
|
|
311
|
+
description?: string | null;
|
|
312
|
+
}
|
|
313
|
+
interface CompanyHiringChanges {
|
|
314
|
+
domain: string;
|
|
315
|
+
company: string | null;
|
|
316
|
+
lastReadAt: string | null;
|
|
317
|
+
since: string;
|
|
318
|
+
totals: HiringCounts;
|
|
319
|
+
byDepartment: Record<string, HiringCounts>;
|
|
320
|
+
bySeniority: Record<string, HiringCounts>;
|
|
321
|
+
byLocation: Record<string, HiringCounts>;
|
|
322
|
+
opened: HiringChangePosting[];
|
|
323
|
+
closed: HiringChangePosting[];
|
|
324
|
+
truncated: boolean;
|
|
325
|
+
}
|
|
255
326
|
|
|
256
327
|
interface HydrafetchOptions {
|
|
257
328
|
apiKey?: string;
|
|
@@ -275,6 +346,8 @@ declare class Hydrafetch {
|
|
|
275
346
|
rateResult(input: RateResultInput): Promise<RateResultResponse>;
|
|
276
347
|
map(url: string, options?: MapOptions): Promise<MapResult>;
|
|
277
348
|
search(query: string, options?: SearchOptions): Promise<SearchResult>;
|
|
349
|
+
searchJobs(query: string, options?: SearchJobsOptions): Promise<OpenJob[]>;
|
|
350
|
+
hiringChanges(domains: string | string[], since: string | Date, options?: HiringChangesOptions): Promise<CompanyHiringChanges[]>;
|
|
278
351
|
extract<T = unknown>(urls: string | string[], options?: ExtractOptions): Promise<ExtractResult<T>>;
|
|
279
352
|
brand(domain: string): Promise<BrandResult>;
|
|
280
353
|
logo(domain: string, options?: BrandOptions): Promise<LogoResult>;
|
|
@@ -314,4 +387,4 @@ declare class HydrafetchTimeoutError extends HydrafetchError {
|
|
|
314
387
|
constructor(message: string);
|
|
315
388
|
}
|
|
316
389
|
|
|
317
|
-
export { type BatchOptions, type BrandOptions, type BrandResult, type CrawlOptions, type ExtractItem, type ExtractOptions, type ExtractResult, type ExtractSchema, type Format, Hydrafetch, HydrafetchError, type HydrafetchOptions, HydrafetchTimeoutError, type ImagesResult, type JobPage, type JobResult, type JobStatus, type Location, type LogoResult, type MapOptions, type MapResult, type PageImage, type PageMetadata, type RateResultInput, type RateResultResponse, type ResultFeedbackReason, type ResultRating, type ScrapeBase, type ScrapeContent, type ScrapeOptions, type ScrapeResult, type ScreenshotOptions, type ScreenshotResult, type SearchOptions, type SearchResult, type SearchResultItem, type StyleguideOptions, type StyleguideResult, type Usage, type WaitOptions, type ZodLike };
|
|
390
|
+
export { type BatchOptions, type BrandOptions, type BrandResult, type CompanyHiringChanges, type CrawlOptions, type ExtractItem, type ExtractOptions, type ExtractResult, type ExtractSchema, type Format, type HiringChangePosting, type HiringChangesOptions, type HiringCounts, Hydrafetch, HydrafetchError, type HydrafetchOptions, HydrafetchTimeoutError, type ImagesResult, type JobPage, type JobPay, type JobResult, type JobStatus, type Location, type LogoResult, type MapOptions, type MapResult, type OpenJob, type PageImage, type PageMetadata, type RateResultInput, type RateResultResponse, type ResultFeedbackReason, type ResultRating, type ScrapeBase, type ScrapeContent, type ScrapeOptions, type ScrapeResult, type ScreenshotOptions, type ScreenshotResult, type SearchJobsOptions, type SearchOptions, type SearchResult, type SearchResultItem, type StyleguideOptions, type StyleguideResult, type Usage, type WaitOptions, type ZodLike };
|
package/dist/index.js
CHANGED
|
@@ -207,6 +207,16 @@ var Hydrafetch = class {
|
|
|
207
207
|
search(query, options = {}) {
|
|
208
208
|
return this.request("POST", "/v1/web/search", { query, ...options });
|
|
209
209
|
}
|
|
210
|
+
searchJobs(query, options = {}) {
|
|
211
|
+
return this.request("POST", "/v1/web/index/jobs/search", { query, ...options });
|
|
212
|
+
}
|
|
213
|
+
hiringChanges(domains, since, options = {}) {
|
|
214
|
+
return this.request("POST", "/v1/web/index/jobs/changes", {
|
|
215
|
+
domains: Array.isArray(domains) ? domains : [domains],
|
|
216
|
+
since: since instanceof Date ? since.toISOString() : since,
|
|
217
|
+
...options
|
|
218
|
+
});
|
|
219
|
+
}
|
|
210
220
|
async extract(urls, options = {}) {
|
|
211
221
|
const { schema, ...rest } = options;
|
|
212
222
|
return this.request("POST", "/v1/web/extract", {
|
package/package.json
CHANGED