# Gemini API with PDF file

**URL:** <https://discuss.ai.google.dev/t/gemini-api-with-pdf-file/85976>\
**Category:** Gemini API\
**Tags:** api, help\_request\
**Created:** [May 29, 2025, 12:12pm UTC](https://discuss.ai.google.dev/t/gemini-api-with-pdf-file/85976 "2025-05-29T12:12:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tomasz\_Swiercz](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/tomasz_swiercz/32/22588_2.png) [@Tomasz\_Swiercz](https://discuss.ai.google.dev/u/Tomasz_Swiercz)\
**Post date:** [May 29, 2025, 12:12pm UTC](https://discuss.ai.google.dev/t/gemini-api-with-pdf-file/85976/1 "2025-05-29T12:12:05Z")

</div>

Hello,

I would like to know if it is possible to send queries using API to gemini, while adding a link to a pdf file. Gemini would be tasked with downloading the pdf file from the link and giving me the answer to my question by searching for this information in the pdf file.

Best regards

---

<div class="post-metadata">

**Author:** ![Richard\_Davey](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/richard_davey/32/50664_2.png) [@Richard\_Davey](https://discuss.ai.google.dev/u/Richard_Davey)\
**Post date:** [May 29, 2025, 3:12pm UTC](https://discuss.ai.google.dev/t/gemini-api-with-pdf-file/85976/3 "2025-05-29T15:12:08Z")

</div>

You can _sort of_ do this. You cannot get Gemini to download and parse a PDF from a link. But you can use their File API to upload your PDF there and pass that to Gemini to then inspect it. If the PDF is less than 20MB in size, you can send the PDF as inline data directly to the API.

Details on both are in their docs: [Document understanding &nbsp;|&nbsp; Gemini API &nbsp;|&nbsp; Google AI for Developers](https://ai.google.dev/gemini-api/docs/document-processing?authuser=1&lang=node)
