Graph Understanding

Understand hand-drawn and printed graphs. Currently, we support scatter plots and line charts (lines and parabolas).

Get started with Solvio's Graph Understanding API easily by downloading the Postman Collection attached below. To learn more about Postman Collections click here.

post
Graph Understanding

https://developer.trysolvio.ai/api/graph/understanding
Request
Response
Request
Headers
Authentication
required
string
Pass your token in format Bearer <Token> Check out Authentication for more
Body Parameters
src
required
string
Image encoded in base64 format. data:image/png;base64,iVBO..
handDrawn
optional
boolean
Graph is hand drawn or not
grid
optional
boolean
Whether graph contains grid
blank
optional
boolean
Whether graph is blank or not
ocr
optional
string
Should OCR be done for labels, coordinates. Default true
plotType
optional
string
scatterPlot or linePlot
leastCount
optional
number
Default 1
scaleY
optional
number
Scale of Image in Y direction. Default 1
scaleX
optional
number
Scale of Image in X direction. Default 1
function
optional
string
LINE or PARABOLAX or PARABOLAY
Response
200: OK
Request Completed Graph Characteristics blank: True, if the input request has no graph else False. grid: True, if the input request has a grid else False. title: String, if a title is detected in the graph else NA xLabel: String, if the X-axis is labelled else NA yLabel: String, if the Y-axis is labelled else NA scaleX: Int, X scale of the graph scaleY: Int, Y scale of the graph handDrawn: True, if the graph is hand-drawn else False plotType: If the graph is a SCATTER plot or a LINE plot. Function Characteristics function : LINE, PARABOLAX, PARABOLAY. xIntersection : True, if the function intersects the X-axis else False. yIntersection : True, if the function intersects the Y-axis else False. quadrants : List of quadrants the function passes through. equation: The ascii property is a human readable version of the estimated equation. The latex property represents the estimated equation as a latex formatted expression (fractions are prefered over decimals). The equation format is LINE [y=mx+c], PARABOLAX [x=ay^2+by+c] and PARABOLAY [y=ax^2+bx+c]. points: The coordinates of the points (just dots/crosses) marked on the graph. coordinates: List of (x, y) pairs explicitly marked on the graph. parameters: The unique parameters that represent the LINE (m, c) [ y = mx + c ] or PARABOLAX (a, h, k) [ (y-k)^2 = a(x-h) ] or PARABOLAY (a, h, k) [ (x-h)^2 = a(y-k) ]. (h, k) represent the coordinates of the vertex, a represents the length of the latus rectum and orientation of the parabola. Image Path imagePath : String, the image URI (uploaded to and served using Solvio's CDN)
{
"error": {
"id": "string",
"description": "string"
},
"imagePath": "string",
"graphCharacteristics": {
"blank": false,
"grid": false,
"title": "",
"xLabel": "",
"yLabel": "",
"scaleX": 1,
"scaleY": 1,
"handDrawn": false,
"plotType": "string"
},
"functionCharacteristics": {
"function": "string",
"xIntersection": false,
"yIntersection": false,
"quadrants": [],
"equation": {
"ascii" : "",
"latex" : ""
},
"points": [],
"coordinates": [],
"parameters": {}
}
}

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...",
// Add other parameters if needed
// scaleX : 0.5,
// plotType: 'linePlot'
}
fetch("https://developer.trysolvio.ai/api/graph/understanding", {
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/graph/understanding"
payload = json.dumps({
src : "data:image/png;base64,iVBOR...",
# Added other parameters if needed
# scaleX : 0.5,
# plotType : 'linePlot'
})
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...");
// You can put more parameters here
// obj.put("scaleX", 1);
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/graph/understanding")
.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].