Home
Math Tools
>Web API<
Feedback
|
Calculator - Web API
This API calculates a provided math expression and returns a calculated numerical value.
» Check the function of this API: go to
Calculator
page (math tool).
To use this API, access to the URLs listed below.
Each Web API returns XML / JSON (JSONP) / CSV data.
XML |
http://www.rurihabachi.com/web/webapi/calculator/xml
|
JSON/JSONP |
http://www.rurihabachi.com/web/webapi/calculator/json
|
CSV |
http://www.rurihabachi.com/web/webapi/calculator/csv
|
» See also
How to use Web API
page.
Parameters:
(*required)
exp *
|
string
|
a numerical expression (e.g. 2000+2)
- valid characters: 1234567890+-*/()^,pi,e,sqrt,log,abs,sin,cos,tan
|
callback
|
string
|
a callback function name (e.g. setResult)
- valid only JSONP
|
|
Return values:
expression
|
string
|
a recognized numerical expression (might have a different form from the submited expression).
e.g. 2000+2, 6400000*800000
|
status
|
integer
|
0:OK(calculated), 1-999:error
|
message
|
string
|
an error message etc.
|
count
|
integer
|
the number of the result value set (0 or 1)
|
value
|
-
|
a result value set
|
calculatedvalue
|
string
|
a calculated value (empty if status is not 0)
e.g. 2002.0, 5.12*10^12
|
|
* * *
Return data samples:
XML
<?xml version="1.0" encoding="UTF-8"?>
<result function="calculate">
<expression>2+20</expression>
<status>0</status>
<message>OK</message>
<count>1</count>
<value>
<calculatedvalue>22.0</calculatedvalue>
</value>
</result>
|
JSON(JSONP)
{"expression":"2+20","status":0,"message":"OK","count":1,"value":[{"calculatedvalue":"22.0"}]}
|
CSV
Copyright (C) 2011-2024 rurihabachi. All rights reserved.
|