Page numbers returned in response #26

Closed
opened 2026-02-16 00:16:38 -05:00 by yindo · 10 comments
Owner

Originally created by @stevelizcano on GitHub (Mar 2, 2024).

Originally assigned to: @hexapode, @BinaryBrain on GitHub.

For some indexing into our VectorDB, it's very helpful to know the page numbers if possible.

Is this feature possible now, or to add?

Either way, love the library. Great work!

Originally created by @stevelizcano on GitHub (Mar 2, 2024). Originally assigned to: @hexapode, @BinaryBrain on GitHub. For some indexing into our VectorDB, it's very helpful to know the page numbers if possible. Is this feature possible now, or to add? Either way, love the library. Great work!
yindo added the enhancement label 2026-02-16 00:16:38 -05:00
yindo closed this issue 2026-02-16 00:16:38 -05:00
Author
Owner

@anoopshrma commented on GitHub (Mar 3, 2024):

Currently page number is not returned in the metadata. But page content is separated using "-----------". You can separate the text based on the string pattern and provide page number for that by yourself.

PS: Adding more info in metadata is being implemented and will be available soon.

@anoopshrma commented on GitHub (Mar 3, 2024): Currently page number is not returned in the metadata. But page content is separated using "-----------". You can separate the text based on the string pattern and provide page number for that by yourself. PS: Adding more info in metadata is being implemented and will be available soon.
Author
Owner

@hexapode commented on GitHub (Mar 4, 2024):

We will provide a more reliable way to get page number (JSON output) in a future release

@hexapode commented on GitHub (Mar 4, 2024): We will provide a more reliable way to get page number (JSON output) in a future release
Author
Owner

@Laktus commented on GitHub (Apr 25, 2024):

@hexapode When would such a release come? Until then is @anoopshrma suggestion a valid solution? Can we just replace each occurence of "-----------" with its respective page number?

Would be nice if you could approve this @hexapode

@Laktus commented on GitHub (Apr 25, 2024): @hexapode When would such a release come? Until then is @anoopshrma suggestion a valid solution? Can we just replace each occurence of "-----------" with its respective page number? Would be nice if you could approve this @hexapode
Author
Owner

@anoopshrma commented on GitHub (Apr 25, 2024):

Hey @Laktus , json mode is out for quite some time now.
You can give it a try: https://github.com/run-llama/llama_parse/blob/main/examples/demo_json_parsing.ipynb

@anoopshrma commented on GitHub (Apr 25, 2024): Hey @Laktus , json mode is out for quite some time now. You can give it a try: https://github.com/run-llama/llama_parse/blob/main/examples/demo_json_parsing.ipynb
Author
Owner

@Laktus commented on GitHub (Apr 26, 2024):

@anoopshrma Hi, is there also LlamaIndexTS support? Can i somewhere see a list of all supported modes? (Markdown, JSON, any more?). Thanks.

@Laktus commented on GitHub (Apr 26, 2024): @anoopshrma Hi, is there also LlamaIndexTS support? Can i somewhere see a list of all supported modes? (Markdown, JSON, any more?). Thanks.
Author
Owner

@salujav4 commented on GitHub (May 30, 2024):

Hey @Laktus, I am facing the same issue, I am using LlamaParseReader in typescript and I don't see the json format there, just text and markdown

@salujav4 commented on GitHub (May 30, 2024): Hey @Laktus, I am facing the same issue, I am using LlamaParseReader in typescript and I don't see the json format there, just text and markdown
Author
Owner

@BinaryBrain commented on GitHub (Jul 8, 2024):

You can now retrieve page numbers and other information using the Json output.

Using the API:

GET https://api.cloud.llamaindex.ai/api/parsing/job/<jobId>/result/json

Using the TS lib:

const reader = new LlamaParseReader({ resultType: "json" });
const json = await reader.loadJson(path);
@BinaryBrain commented on GitHub (Jul 8, 2024): You can now retrieve page numbers and other information using the Json output. Using the API: ``` GET https://api.cloud.llamaindex.ai/api/parsing/job/<jobId>/result/json ``` Using the TS lib: ```ts const reader = new LlamaParseReader({ resultType: "json" }); const json = await reader.loadJson(path); ```
Author
Owner

@thisadev commented on GitHub (Aug 13, 2024):

Hi, Can we get the page number using Python?

@thisadev commented on GitHub (Aug 13, 2024): Hi, Can we get the page number using Python?
Author
Owner

@aceci0127 commented on GitHub (Nov 1, 2024):

You can now retrieve page numbers and other information using the Json output.

Using the API:

GET https://api.cloud.llamaindex.ai/api/parsing/job/<jobId>/result/json

Using the TS lib:

const reader = new LlamaParseReader({ resultType: "json" });
const json = await reader.loadJson(path);

what is the JobID?

@aceci0127 commented on GitHub (Nov 1, 2024): > You can now retrieve page numbers and other information using the Json output. > > Using the API: > > ``` > GET https://api.cloud.llamaindex.ai/api/parsing/job/<jobId>/result/json > ``` > > Using the TS lib: > > ```ts > const reader = new LlamaParseReader({ resultType: "json" }); > const json = await reader.loadJson(path); > ``` what is the JobID?
Author
Owner

@BinaryBrain commented on GitHub (Nov 1, 2024):

Hi, Can we get the page number using Python?

Yes, if you get the Json results.

You can also use {pageNumber} in the page separator and page prefix and suffix

what is the JobID?

https://docs.cloud.llamaindex.ai/llamaparse/getting_started/api
Using the API, you first upload your file using https://api.cloud.llamaindex.ai/api/parsing/upload endpoint.
It'll return a jobID, and with the jobId, you can retrieve results.

@BinaryBrain commented on GitHub (Nov 1, 2024): > Hi, Can we get the page number using Python? Yes, if you get the Json results. You can also use `{pageNumber}` in the [page separator](https://docs.cloud.llamaindex.ai/llamaparse/features/parsing_options#page-separator) and [page prefix and suffix](https://docs.cloud.llamaindex.ai/llamaparse/features/parsing_options#page-prefix-and-suffix) > what is the JobID? https://docs.cloud.llamaindex.ai/llamaparse/getting_started/api Using the API, you first upload your file using `https://api.cloud.llamaindex.ai/api/parsing/upload` endpoint. It'll return a jobID, and with the jobId, you can retrieve results.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/llama_cloud_services#26