Photomath

FREEMIUM
Por Api Dojo | Actualizada 2 месяца назад | Education
Popularidad

9.6 / 10

Latencia

1,761ms

Nivel de servicio

100%

Health Check

N/A

Volver a todas las conversaciones

HTTP Response: 204

Rapid account: Berrtado
Berrtado
9 месяцев назад

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 9 месяцев назад

Hello,

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

Regards.

Rapid account: Berrtado
Berrtado Commented 9 месяцев назад

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 месяцев назад

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 месяцев назад

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 месяцев назад

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 месяцев назад

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 месяцев назад

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.

Únase a la conversación, añada un comentario a continuación:

Inicie sesió/Regístrese para publicar nuevos comentarios