Photomath

FREEMIUM
By Api Dojo | Updated a month ago | Education
Popularity

9.6 / 10

Latency

1,501ms

Service Level

100%

Health Check

N/A

Back to All Discussions

HTTP Response: 204

Rapid account: Berrtado
Berrtado
9 months ago

Hi, i get 204 as the HTTP Response and several data parameters such as: Server = (
“RapidAPI-1.2.8”
);
“access-control-allow-credentials” = (
true
);
“access-control-allow-headers” = (
ver
);

	and so on. Why dont I get the step by step soltuion or at least the data for it?
	Regards
Rapid account: Apidojo
apidojo Commented 8 months ago

Hello,

To keep to simple, this API is not for you.

Regards.

Rapid account: Berrtado
Berrtado Commented 8 months ago

Hi,
perhaps, I have misunderstood the whole thing, does this API allow me to show/display a step-by-step solution of a captured image but the only condition is that i need to extract the response of the API response by JSON in order to retrieve the step-by-step solution? I’ve tried for a very long time now and I seem to fail to extract the JSON response properly. Maybe i have misinterpreted the procedure of the this API. Please help me be understand the case.
Best Regards.

Rapid account: Apidojo
apidojo Commented 9 months ago

Hello,

The best bet is to use the Photomath app to solve the same problem and see how it renders the result.

Regards.

Rapid account: Berrtado
Berrtado Commented 9 months ago

Yes, just one last question, what is the String Name for the “actions” that relates to “step-by-step solution”. Currently i’m using “simplify_wrapper” but it doesn’t seems to work.

Rapid account: Apidojo
apidojo Commented 9 months ago

Hello,

I am sorry but you have to learn the response on your own. Photomath has its own library to render the response data and display it to end user.
The IT team has plan to make an endpoint to convert the response data to image for you but they are too busy on making other APIs currently.

Regards.

Rapid account: Berrtado
Berrtado Commented 9 months ago

Thank you, I was reading the documentation more carefully. Currently, I do get this response: HTTP Response: 200
Response Data: {“info”:{“imageToMath”:{“version”:“2.11.1+Perseus_fp16+Spark_fp16”,“commandNodeHash”:“f7d80fe0135ba48690cf9817f41e5856”,“contentType”:“junk”,“fineGrainedContentType”:“reject/math/rotation”,“actions”:[{“name”:“no_context”,“probability”:0.99609375},{“name”:“simplify_wrapper”,“probability”:0.00646209716796875},{“name”:“animation_mul_us”,“probability”:2.434253692626953E-4},{“name”:“det_calc”,“probability”:1.2636184692382812E-4},{“name”:“convert”,“probability”:1.1414289474487303E-4},{“name”:“derive”,“probability”:1.132488250732422E-4},{“name”:“slope_points”,“probability”:

It works kind of, but I haven’t understood the part to extract it properly. I’ve created the JSON extraction:
if let json = try JSONSerialization.jsonObject(with: data, options: []) as? [String: Any] {
if let info = json[“info”] as? [String: Any],
let imageToMath = info[“imageToMath”] as? [String: Any],
let actions = imageToMath[“actions”] as? [[String: Any]] {

                    // Now 'actions' contains an array of dictionaries, each representing an action

                    for action in actions {
                        if let name = action["name"] as? String,
                           let probability = action["probability"] as? Double {
                            print("Action: \(name), Probability: \(probability)")
                        }
                    }
											
											but i dont see what do to next in order to display the step-bystep solution. 
Rapid account: Apidojo
apidojo Commented 9 months ago

Hello,

In short, your body request is invalid or empty.
1/ You should manually test the endpoint with an HTTP client such as postman.com with the provided sample images and see how it works. You may use https://webhook.site/ to analyze the difference between the postman body and your application’s request
2/ You should spend time and read parameter description with CARE.
3/ You should spend time and read other discussions that would help.

Regards.

Join in the discussion - add comment below:

Login / Signup to post new comments