@pdfvector/instance-client 0.0.27 → 0.0.29
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/CHANGELOG.md +13 -0
- package/README.md +115 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @pdfvector/instance-client
|
|
2
2
|
|
|
3
|
+
## 0.0.29
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
- [#151](https://github.com/phuctm97/pdfvector/pull/151) [`0deb0b8`](https://github.com/phuctm97/pdfvector/commit/0deb0b8d0219a55a75ab5698a2190bb7e6c6d422) Thanks [@khanhduyvt0101](https://github.com/khanhduyvt0101)! - Update instance-client README with grant search, paper graph, similar papers, and crossref provider
|
|
9
|
+
|
|
10
|
+
## 0.0.28
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [[`aaf8ba1`](https://github.com/phuctm97/pdfvector/commit/aaf8ba1a73c4076cc63c17fcd47e463b05d7db2a)]:
|
|
14
|
+
- @pdfvector/instance-contract@0.0.30
|
|
15
|
+
|
|
3
16
|
## 0.0.27
|
|
4
17
|
### Patch Changes
|
|
5
18
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# PDFVector TypeScript/JavaScript SDK
|
|
2
2
|
|
|
3
|
-
The official TypeScript/JavaScript SDK for the [PDFVector](https://www.pdfvector.com) API: Parse PDF, Word, Image, and Excel documents to clean, structured markdown format, ask questions about documents using AI, extract structured data from documents with JSON Schema, search across multiple academic databases with a unified API, fetch specific publications by DOI, PubMed ID, ArXiv ID, and more,
|
|
3
|
+
The official TypeScript/JavaScript SDK for the [PDFVector](https://www.pdfvector.com) API: Parse PDF, Word, Image, and Excel documents to clean, structured markdown format, ask questions about documents using AI, extract structured data from documents with JSON Schema, search across multiple academic databases with a unified API, fetch specific publications by DOI, PubMed ID, ArXiv ID, and more, find relevant academic citations for paragraphs of text, explore paper citation graphs, find similar papers, and search for research grants across US, EU, and UK funding databases.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -337,12 +337,13 @@ result.results.forEach((publication) => {
|
|
|
337
337
|
**Supported Providers:**
|
|
338
338
|
|
|
339
339
|
- `"semantic-scholar"` (default) - [Semantic Scholar](https://www.semanticscholar.org/)
|
|
340
|
-
- `"arxiv"` - [ArXiv](https://arxiv.org/)
|
|
341
340
|
- `"pubmed"` - [PubMed](https://pubmed.ncbi.nlm.nih.gov/)
|
|
341
|
+
- `"arxiv"` - [ArXiv](https://arxiv.org/)
|
|
342
342
|
- `"google-scholar"` - [Google Scholar](https://scholar.google.com/)
|
|
343
343
|
- `"eric"` - [ERIC](https://eric.ed.gov/)
|
|
344
344
|
- `"europe-pmc"` - [Europe PMC](https://europepmc.org/)
|
|
345
345
|
- `"openalex"` - [OpenAlex](https://openalex.org/)
|
|
346
|
+
- `"crossref"` - [Crossref](https://www.crossref.org/)
|
|
346
347
|
|
|
347
348
|
**Search Parameters:**
|
|
348
349
|
|
|
@@ -402,6 +403,115 @@ for (const item of result.results) {
|
|
|
402
403
|
}
|
|
403
404
|
```
|
|
404
405
|
|
|
406
|
+
### Paper Citation Graph
|
|
407
|
+
|
|
408
|
+
Retrieve a paper's citing papers and referenced papers with pagination support. Costs 2+ credits per request (scales with result count).
|
|
409
|
+
|
|
410
|
+
```typescript
|
|
411
|
+
const result = await client.academic.paperGraph({
|
|
412
|
+
id: "10.1038/nature12373", // DOI, ArXiv ID, Semantic Scholar ID, OpenAlex ID, or URL
|
|
413
|
+
citationsLimit: 20,
|
|
414
|
+
referencesLimit: 20,
|
|
415
|
+
citationsOffset: 0,
|
|
416
|
+
referencesOffset: 0,
|
|
417
|
+
fields: ["title", "authors", "year", "doi"],
|
|
418
|
+
});
|
|
419
|
+
|
|
420
|
+
console.log(`Paper: ${result.paper.title}`);
|
|
421
|
+
console.log(`Total Citations: ${result.totalCitations}`);
|
|
422
|
+
console.log(`Total References: ${result.totalReferences}`);
|
|
423
|
+
|
|
424
|
+
for (const citation of result.citations) {
|
|
425
|
+
console.log(` Cited by: ${citation.title} (${citation.year})`);
|
|
426
|
+
}
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
**Parameters:**
|
|
430
|
+
|
|
431
|
+
- `id` (required): Paper identifier (DOI, ArXiv ID, Semantic Scholar ID, OpenAlex ID, or URL)
|
|
432
|
+
- `citationsLimit`: Max citing papers to return, 0-1000 (default: 100)
|
|
433
|
+
- `referencesLimit`: Max referenced papers to return, 0-1000 (default: 100)
|
|
434
|
+
- `citationsOffset` / `referencesOffset`: Pagination offsets (default: 0)
|
|
435
|
+
- `fields`: Specific fields to return
|
|
436
|
+
|
|
437
|
+
### Find Similar Papers
|
|
438
|
+
|
|
439
|
+
Find papers similar to a seed paper using citation network analysis. Costs 3 credits per request.
|
|
440
|
+
|
|
441
|
+
```typescript
|
|
442
|
+
const result = await client.academic.similarPapers({
|
|
443
|
+
id: "10.1038/nature12373",
|
|
444
|
+
limit: 10,
|
|
445
|
+
includeEdges: true, // include citation graph edges for visualization
|
|
446
|
+
fields: ["title", "year", "doi"],
|
|
447
|
+
});
|
|
448
|
+
|
|
449
|
+
console.log(`Seed: ${result.seed.title}`);
|
|
450
|
+
|
|
451
|
+
for (const item of result.results) {
|
|
452
|
+
console.log(` [Similarity: ${item.similarity.toFixed(2)}] ${item.publication.title}`);
|
|
453
|
+
if (item.citingIds) {
|
|
454
|
+
console.log(` Citing: ${item.citingIds.length} papers in result set`);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
**Parameters:**
|
|
460
|
+
|
|
461
|
+
- `id` (required): Seed paper identifier
|
|
462
|
+
- `limit`: Max similar papers, 1-100 (default: 30)
|
|
463
|
+
- `includeEdges`: Include `citingIds`/`citedByIds` for graph construction (default: false)
|
|
464
|
+
- `fields`: Specific fields to return
|
|
465
|
+
|
|
466
|
+
### Search Grants
|
|
467
|
+
|
|
468
|
+
Search for research grants and funding opportunities across multiple databases with a unified API. Costs 2 credits per request.
|
|
469
|
+
|
|
470
|
+
```typescript
|
|
471
|
+
const result = await client.academic.searchGrants({
|
|
472
|
+
query: "machine learning healthcare",
|
|
473
|
+
providers: ["grants-gov", "nih-reporter", "cordis", "ukri"],
|
|
474
|
+
limit: 10,
|
|
475
|
+
fundingMin: 100000,
|
|
476
|
+
fundingMax: 1000000,
|
|
477
|
+
deadlineFrom: "2026-01-01",
|
|
478
|
+
deadlineTo: "2026-12-31",
|
|
479
|
+
});
|
|
480
|
+
|
|
481
|
+
console.log(`Found ${result.estimatedTotalResults} grants`);
|
|
482
|
+
|
|
483
|
+
for (const grant of result.results) {
|
|
484
|
+
console.log(`Title: ${grant.title}`);
|
|
485
|
+
console.log(`Agency: ${grant.agency} (${grant.region})`);
|
|
486
|
+
console.log(`Funding: ${grant.currency} ${grant.fundingAmountMin}-${grant.fundingAmountMax}`);
|
|
487
|
+
console.log(`Deadline: ${grant.deadlineDate ?? grant.closeDate ?? "N/A"}`);
|
|
488
|
+
console.log(`URL: ${grant.url}`);
|
|
489
|
+
console.log("---");
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
// Partial provider failures are reported in errors array
|
|
493
|
+
result.errors?.forEach((error) => {
|
|
494
|
+
console.log(`Provider ${error.provider} failed: ${error.message}`);
|
|
495
|
+
});
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
**Supported Grant Providers:**
|
|
499
|
+
|
|
500
|
+
- `"grants-gov"` - [Grants.gov](https://www.grants.gov/) (US federal grants — NIH, NSF, DOE, DOD, etc.)
|
|
501
|
+
- `"nih-reporter"` - [NIH RePORTER](https://reporter.nih.gov/) (NIH-funded research projects)
|
|
502
|
+
- `"cordis"` - [CORDIS](https://cordis.europa.eu/) (EU-funded projects — Horizon Europe, ERC, etc.)
|
|
503
|
+
- `"ukri"` - [UKRI](https://www.ukri.org/) (UK-funded projects — EPSRC, BBSRC, MRC, etc.)
|
|
504
|
+
|
|
505
|
+
**Search Parameters:**
|
|
506
|
+
|
|
507
|
+
- `query` (required): 1-400 characters
|
|
508
|
+
- `providers`: Array of grant provider names (default: all 4 providers)
|
|
509
|
+
- `offset`: Pagination offset (default: 0)
|
|
510
|
+
- `limit`: Results per provider, 1-50 (default: 10)
|
|
511
|
+
- `fundingMin` / `fundingMax`: Filter by funding amount
|
|
512
|
+
- `deadlineFrom` / `deadlineTo`: Filter by deadline date (ISO format, e.g. `"2026-01-01"`)
|
|
513
|
+
- `fields`: Specific fields to return (`"sourceId"`, `"title"`, `"url"`, `"agency"`, `"program"`, `"description"`, `"eligibility"`, `"fundingAmountMin"`, `"fundingAmountMax"`, `"currency"`, `"deadlineDate"`, `"openDate"`, `"closeDate"`, `"grantType"`, `"region"`, `"keywords"`, `"piName"`, `"organizationName"`, `"provider"`, `"providerData"`)
|
|
514
|
+
|
|
405
515
|
## Document ID Tracking
|
|
406
516
|
|
|
407
517
|
Pass a `documentId` per request to track API usage. The ID is sent as a header and returned in responses for document, identity, invoice, and bank statement endpoints. Academic endpoints do not use `documentId`.
|
|
@@ -464,6 +574,9 @@ console.log(resultB.documentId); // "doc-b"
|
|
|
464
574
|
| Academic Search | 2 | 2 | 2 | 2 | /request |
|
|
465
575
|
| Academic Fetch | 2 | 2 | 2 | 2 | /request |
|
|
466
576
|
| Academic Find Citations | 2 | 2 | 2 | 2 | /sentence |
|
|
577
|
+
| Academic Paper Graph | 2+ | 2+ | 2+ | 2+ | /request |
|
|
578
|
+
| Academic Similar Papers | 3 | 3 | 3 | 3 | /request |
|
|
579
|
+
| Grant Search | 2 | 2 | 2 | 2 | /request |
|
|
467
580
|
|
|
468
581
|
## Error Handling
|
|
469
582
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pdfvector/instance-client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.29",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Official TypeScript/JavaScript SDK for PDFVector API - Parse PDF/Word/Image/Excel documents to clean, structured markdown format and search academic publications across multiple databases",
|
|
6
6
|
"license": "MIT",
|