> For the complete documentation index, see [llms.txt](https://docs.aibrary.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aibrary.dev/ocr-features/ocr.md).

# OCR

{% tabs %}
{% tab title="OCR" %}

```python
from aibrary import AiBrary
aibrary = AiBrary()
# 1
aibrary.ocr(
    providers="google",
    file=open("tests/assets/ocr-test.jpg", "rb").read(),
    file_name="test.jpg",
)
# 2
aibrary.ocr(
    providers="google",
    file_url="https://builtin.com/sites/www.builtin.com/files/styles/ckeditor_optimize/public/inline-images/5_python-ocr.jpg",
)
# 3
aibrary.ocr(
    providers="google", file="tests/assets/ocr-test.jpg"
)
```

{% endtab %}
{% endtabs %}

{% openapi src="/files/SvTOdACGGe9jzQ5PTqxO" path="/v0/ocr/ocr" method="post" %}
[openapi.json](https://2030775142-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fp4IwQOR0zSJQKAC7b7hY%2Fuploads%2FN0BKJWmuhheQibXu1qyL%2Fopenapi.json?alt=media\&token=6d4b78fc-cbe3-4d2b-a09b-b33082532146)
{% endopenapi %}
