Math and Text OCR

Digitize an image containing math and text content. The output is a LaTeX expression by default (other formats coming soon).

Get started with Solvio's Math and Text OCR API easily by downloading the Postman Collection attached below. To learn more about Postman Collections click here.

post
Math and Text OCR

https://developer.trysolvio.ai/api/ocr
Simply pass the image represented as a base64 encoded string as the body parameter, src.
Request
Response
Request
Headers
Authentication
required
string
Pass token in the format Bearer <Token>. Check out Authentication for more.
Body Parameters
src
required
string
Image in base64 encoded format data:image/png;base64,iVBO
Response
200: OK
Success
{
"data" : {
"latex" : "\\int \\frac { x ... "
},
"requestId" : "11",
// Error will only present if any error is there
// otherwise it will be null
"error": {
"id": "image_decode_error",
"description": "Cannot read image"
}
}

Code Samples

JavaScript
Python
Java
JavaScript
const headers = {
'content-type': 'application/json',
// Paste your token here
'authorization': 'Bearer eyJhbGciOiJSUzI1...'
}
const body = {
src: "data:image/png;base64,iVBOR..."
}
fetch("https://developer.trysolvio.ai/api/text/digital", {
method: 'POST',
headers,
body: JSON.stringify(body)
}).then(res => {
return res.json()
}).then(data => {
console.log(data);
})
Python
import requests
import json
url = "https://developer.trysolvio.ai/api/text/digital"
payload = json.dumps({
src : "data:image/png;base64,iVBOR..."
})
headers = {
'content-type' : 'application/json',
# Add your token here
'authorization' : 'Bearer eyJhbGciOiJSUzI1...'
}
response = requests.post(url, headers=headers, data=payload)
print(response.json())
Java
JSONObject obj = new JSONObject();
// Put your base64 encoded image here
obj.put("src", "data:image/png;base64,iVBOR...");
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json; charset=utf-8");
String body = obj.toString().toRequestBody(mediaType);
// Make sure to put the correct token in the Authorization header
Request request: Request = Request.Builder()
.url("https://developer.trysolvio.ai/api/text/digital")
.addHeader("Authorization", "Bearer eyJhbGciOiJSUzI1...")
.post(body)
.build();
Response response = client.newCall(request).execute();
// You can convert the string to JSONObject if needed
System.out.println(response.body().string());

If you have a feature request, please write to us at [email protected].