Issue to get the parsing result when i use the API #238

Closed
opened 2026-02-16 00:17:14 -05:00 by yindo · 5 comments
Owner

Originally created by @hamzabchiri on GitHub (Aug 19, 2024).

Originally assigned to: @BinaryBrain on GitHub.

Hi,

I'm using the Lama parse API with some instructions, my objective is to parse a pdf and get some specific information.
however, when I use the preview page web or the colab code it's always working fine and I'm getting the correct information

but within the API I just get back the full PDF parsed text.

Could you please advise here, please note that I'm using the API for uploading the PDF with parsing instructions and then I use the API for getting the result on markdown type.

thank you!

Originally created by @hamzabchiri on GitHub (Aug 19, 2024). Originally assigned to: @BinaryBrain on GitHub. Hi, I'm using the Lama parse API with some instructions, my objective is to parse a pdf and get some specific information. however, when I use the preview page web or the colab code it's always working fine and I'm getting the correct information but within the API I just get back the full PDF parsed text. Could you please advise here, please note that I'm using the API for uploading the PDF with parsing instructions and then I use the API for getting the result on markdown type. thank you!
yindo added the help wanted label 2026-02-16 00:17:14 -05:00
yindo closed this issue 2026-02-16 00:17:14 -05:00
Author
Owner

@BinaryBrain commented on GitHub (Aug 21, 2024):

Hi @hamzabchiri, can you please provide the code calling our API?

@BinaryBrain commented on GitHub (Aug 21, 2024): Hi @hamzabchiri, can you please provide the code calling our API?
Author
Owner

@hamzabchiri commented on GitHub (Aug 21, 2024):

Hi @BinaryBrain ,
so I'm using an automation tool to automate the full process from getting the file and sending the HTTP request:

1- first I use this URL: "https://api.cloud.llamaindex.ai/api/v1/parsing/upload"
2- Headers : Accept: application/json & Authorization: APIKEY
3- Body: language : en & parsingInstruction: instruction as string & file : file_path
4 - "https://api.cloud.llamaindex.ai//api/v1/parsing/job/" +JOB_ID+"/result/markdown"
5- Same headers as the previous steps.
6- Results : {
"markdown": "# FACTURE – FAV20240045\n\nTo3s Date : 10/06/2024 N° FRS : 1047650000000 0000004765 Paiement : Comptant\n\nHUB'TOYS 71 rue de billancourt Adresse de facturation : Futura Finances 5 et 17 Rue de Corbusson ZA Le Châtellier II 53940 SAINT BERTHEVIN\n\nN°COMMANDES : 274490 - 274397 - BDC20240015\n\n|PRODUITS|PRIX HT|QUANTITES|TOTAL HT|\n|---|---|---|---|\n|376590.206 – DOCTEUR PILULE|0.87 €|4 000|3 480.00 €|\n|926297.006 – VOTRE PIRE CAUCHEMAR|1.00 €|1 600|1 600.00 €|\n|923187. 004 - 1 PUZZLR DE 1000 PIECES ET 1 PUZZLE DE 500 PIECES ISLAND ARCHWAY ET KANGOUROU (AUSTRALIE)|1.50 €|800|1 200 .00 €|\n|256698.106 - MON PREMIER KIT DE PEINTURE|2.14 €|3 680|7 875.20 €|\n|256416.109 - MON PREMIER PUPITRE EFFACABLE A SEC|1.43 €|3 000|4 290.00 €|\n|TOTAL HT| | |18 445.20 €|\n|TVA 20 %| | |3 689.04 €|\n|TOTAL TTC| | |22 134.24 €|\n\nIRAN (4 FR7G 3000 3031 1200 02041 1706 269 BIC +1 SOGEFRPP Code Code Banque ABence Numeto de compte Agcucede doriciation 3000 03112 00020417062 SG PaRIS NicolO Rib (1 (031121 (21 Bunt Ioert tier Code HUB'TOYS 71 rue de billancourt 92100 BOULOGNE BILLANCOURT Numéro de SIRET: 839 372 869 000 17 - Numéro de TVA: FR74839372869\n\nPage 1/1",
"job_metadata": {
"credits_used": 1.0,
"job_credits_usage": 0,
"job_pages": 0,
"job_is_cache_hit": true,
"credits_max": 1000
}
}

so in the end, he is just returning the fully parsed text even when I send the instructions he ignores, for my case it should return just the name of the supplier and the buyer.
and what I already observed that when I use the API the credit usage it's not changed.

thank you!

@hamzabchiri commented on GitHub (Aug 21, 2024): Hi @BinaryBrain , so I'm using an automation tool to automate the full process from getting the file and sending the HTTP request: 1- first I use this URL: "https://api.cloud.llamaindex.ai/api/v1/parsing/upload" 2- Headers : Accept: application/json & Authorization: APIKEY 3- Body: language : en & parsingInstruction: instruction as string & file : file_path 4 - "https://api.cloud.llamaindex.ai//api/v1/parsing/job/" +JOB_ID+"/result/markdown" 5- Same headers as the previous steps. 6- Results : { "markdown": "# FACTURE – FAV20240045\n\nTo3s Date : 10/06/2024 N° FRS : 1047650000000 0000004765 Paiement : Comptant\n\nHUB'TOYS 71 rue de billancourt Adresse de facturation : Futura Finances 5 et 17 Rue de Corbusson ZA Le Châtellier II 53940 SAINT BERTHEVIN\n\nN°COMMANDES : 274490 - 274397 - BDC20240015\n\n|PRODUITS|PRIX HT|QUANTITES|TOTAL HT|\n|---|---|---|---|\n|376590.206 – DOCTEUR PILULE|0.87 €|4 000|3 480.00 €|\n|926297.006 – VOTRE PIRE CAUCHEMAR|1.00 €|1 600|1 600.00 €|\n|923187. 004 - 1 PUZZLR DE 1000 PIECES ET 1 PUZZLE DE 500 PIECES ISLAND ARCHWAY ET KANGOUROU (AUSTRALIE)|1.50 €|800|1 200 .00 €|\n|256698.106 - MON PREMIER KIT DE PEINTURE|2.14 €|3 680|7 875.20 €|\n|256416.109 - MON PREMIER PUPITRE EFFACABLE A SEC|1.43 €|3 000|4 290.00 €|\n|TOTAL HT| | |18 445.20 €|\n|TVA 20 %| | |3 689.04 €|\n|TOTAL TTC| | |22 134.24 €|\n\nIRAN (4 FR7G 3000 3031 1200 02041 1706 269 BIC +1 SOGEFRPP Code Code Banque ABence Numeto de compte Agcucede doriciation 3000 03112 00020417062 SG PaRIS NicolO Rib (1 (031121 (21 Bunt Ioert tier Code HUB'TOYS 71 rue de billancourt 92100 BOULOGNE BILLANCOURT Numéro de SIRET: 839 372 869 000 17 - Numéro de TVA: FR74839372869\n\nPage 1/1", "job_metadata": { "credits_used": 1.0, "job_credits_usage": 0, "job_pages": 0, "job_is_cache_hit": true, "credits_max": 1000 } } so in the end, he is just returning the fully parsed text even when I send the instructions he ignores, for my case it should return just the name of the supplier and the buyer. and what I already observed that when I use the API the credit usage it's not changed. thank you!
Author
Owner

@BinaryBrain commented on GitHub (Aug 21, 2024):

On step 3, make sure you're using snake_case parameters: parsing_instruction instead of parsingInstruction: https://docs.cloud.llamaindex.ai/llamaparse/features/parsing_options#parsing-instructions

@BinaryBrain commented on GitHub (Aug 21, 2024): On step 3, make sure you're using snake_case parameters: `parsing_instruction` instead of `parsingInstruction`: https://docs.cloud.llamaindex.ai/llamaparse/features/parsing_options#parsing-instructions
Author
Owner

@hamzabchiri commented on GitHub (Aug 22, 2024):

Hi @BinaryBrain

the issue is solved.

thank you very much for the help

@hamzabchiri commented on GitHub (Aug 22, 2024): Hi @BinaryBrain the issue is solved. thank you very much for the help
Author
Owner

@BinaryBrain commented on GitHub (Aug 22, 2024):

With pleasure!

@BinaryBrain commented on GitHub (Aug 22, 2024): With pleasure!
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#238