@pdfvector/client 0.0.28 → 0.0.30

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +32 -1
  3. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @pdfvector/client
2
2
 
3
+ ## 0.0.30
4
+ ### Patch Changes
5
+
6
+
7
+
8
+ - [#240](https://github.com/phuctm97/pdfvector/pull/240) [`2c8691c`](https://github.com/phuctm97/pdfvector/commit/2c8691c9bbd251ff7b7a153fd4254d9360c11c08) Thanks [@khanhduyvt0101](https://github.com/khanhduyvt0101)! - Add academic.parse to resolve academic paper IDs or provider URLs to public PDFs and parse them to markdown.
9
+
10
+ - Updated dependencies []:
11
+ - @pdfvector/instance-client@0.0.50
12
+
13
+ ## 0.0.29
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies []:
17
+ - @pdfvector/instance-client@0.0.49
18
+
3
19
  ## 0.0.28
4
20
  ### Patch Changes
5
21
 
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # PDF Vector TypeScript/JavaScript SDK
2
2
 
3
- The official TypeScript/JavaScript SDK for the [PDF Vector](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.
3
+ The official TypeScript/JavaScript SDK for the [PDF Vector](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, convert academic paper IDs or provider URLs to markdown, 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
 
@@ -380,6 +380,36 @@ result.errors?.forEach((error) => {
380
380
 
381
381
  **Supported ID types:** DOI, PubMed ID, ArXiv ID, Semantic Scholar ID, ERIC ID, Europe PMC ID, OpenAlex ID.
382
382
 
383
+ ### Parse Academic Paper to Markdown
384
+
385
+ Resolve a paper ID or provider URL to its public PDF and parse it into markdown. Uses the same per-page model pricing as Document Parse.
386
+
387
+ ```typescript
388
+ const result = await client.academic.parse({
389
+ id: "1706.03762", // DOI, PubMed ID, ArXiv ID, Semantic Scholar ID, or provider URL
390
+ model: "auto", // "auto" | "nano" | "mini" | "pro" | "max"
391
+ });
392
+
393
+ console.log(`Title: ${result.title}`);
394
+ console.log(`Provider: ${result.detectedProvider}`);
395
+ console.log(`PDF: ${result.pdfURL}`);
396
+ console.log(result.markdown);
397
+ console.log(`Pages: ${result.pageCount}, Credits: ${result.credits}`);
398
+ ```
399
+
400
+ You can pass a provider URL instead of an ID:
401
+
402
+ ```typescript
403
+ const result = await client.academic.parse({
404
+ url: "https://arxiv.org/abs/1706.03762",
405
+ model: "nano",
406
+ });
407
+
408
+ console.log(result.markdown);
409
+ ```
410
+
411
+ Provide exactly one of `id` or `url`. If the paper cannot be found, has no public PDF, or the resolved PDF cannot be fetched, the API returns a typed `PDFVectorError` with a clear message and no parse credits are charged.
412
+
383
413
  ### Find Citations for a Paragraph
384
414
 
385
415
  Find relevant academic citations for each sentence in a paragraph using semantic similarity. Costs 2 credits per sentence analyzed.
@@ -573,6 +603,7 @@ console.log(resultB.documentId); // "doc-b"
573
603
  | Bank Statement Extract | 6 | 10 | 14 | 18 | /page |
574
604
  | Academic Search | 2 | 2 | 2 | 2 | /request |
575
605
  | Academic Fetch | 2 | 2 | 2 | 2 | /request |
606
+ | Academic Parse | 1 | 2 | 4 | 8 | /page |
576
607
  | Academic Find Citations | 2 | 2 | 2 | 2 | /sentence |
577
608
  | Academic Paper Graph | 2+ | 2+ | 2+ | 2+ | /request |
578
609
  | Academic Similar Papers | 3 | 3 | 3 | 3 | /request |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pdfvector/client",
3
- "version": "0.0.28",
3
+ "version": "0.0.30",
4
4
  "type": "module",
5
5
  "description": "Official TypeScript/JavaScript SDK for PDF Vector API",
6
6
  "license": "MIT",
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "main": ".tsc/lib/index.js",
25
25
  "dependencies": {
26
- "@pdfvector/instance-client": "^0.0.48"
26
+ "@pdfvector/instance-client": "^0.0.50"
27
27
  },
28
28
  "files": [
29
29
  ".tsc",