Once you have trained a Nanonets OCR model or are using one of our Pretrained models (instructions to train your own OCR model can be found here https://nanonets.com/help/how-to-build-an-ocr-model-with-nanonets) you can query the API using the following instructions:
1. Find your model from My Models page:
Go to https://app.nanonets.com/#/models and select the model of your choice and click Go To Model
2. Go to the integrate page for your model
Got to the Integrate tab (found in the left hand sidebar). There you can go and select the language of your choice (Java, C#, Python, Nodejs, Javascript, Ruby etc). You can find the link to your model page by visiting https://app.nanonets.com/#/models
Here are the details for web request being sent (as a cURL command)
curl \ --request POST \ --url 'https://app.nanonets.com/api/v2/OCR/Model/replace-with-your-model-id-goes-here/LabelUrls/' \ --header 'accept: application/x-www-form-urlencoded' \ -d 'urls=https://replace.with.your/image/url.jpg' \ -u 'replace-with-your-api-key:'
2. Copy the code and run. The api response will look like:
{ "message": "Success", "result": [ { "message": "Success", "input": "https://url.to.file/223179695.jpeg", "prediction": [ { "label": "buyer_name", "xmin": 298, "ymin": 712, "xmax": 561, "ymax": 755, "score": 1, "ocr_text": "Unit4 N.V." }, { "label": "invoice_amount", "xmin": 1820, "ymin": 2241, "xmax": 2074, "ymax": 2291, "score": 1, "ocr_text": "$19.360.00" } ], "page": 0, "request_file_id": "629bb44b-39be-4b59-b504-18bfa7621bba", "filepath": "1382024497.jpeg" } ] }