API support for .xlsx files

Is it possible to work with .xlsx files via the API?

They work pretty well in AI Studio but I haven’t figured out how to upload them effectively via the API. I’ve tried a few mime types, text/plain, text/csv, text/xml. None seem to work.

What is best practice for working with these file types?

Hi @eanna

Currently, Gemini cannot process .xlsx files directly using files API. If you’re working with Excel data, consider converting it to a pandas DataFrame. You can then provide the DataFrame as input to Gemini and extract the necessary information.

Thanks