Wolfram Alpha‘s computational knowledge engine or answer engine developed by Wolfram Research, which can be consumed as a service as well. Users submit queries and computation requests. Wolfram Alpha then computes answers and relevant visualizations from a knowledge base of curated, structured data that come from other sites and books. 2000 non-commercial API calls per month are free.
They provide a nice set of API Language Libraries to get you started.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
<?php $appID = 'PLACE_YOUR_APP_ID_HERE'; if (!$queryIsSet) die(); $qArgs = array(); if (isset($_REQUEST['assumption'])) $qArgs['assumption'] = $_REQUEST['assumption']; // instantiate an engine object with your app id $engine = new WolframAlphaEngine( $appID ); // we will construct a basic query to the api with the input 'pi' // only the bare minimum will be used $response = $engine->getResults( $_REQUEST['q'], $qArgs); // getResults will send back a WAResponse object // this object has a parsed version of the wolfram alpha response // as well as the raw xml ($response->rawXML) // we can check if there was an error from the response object if ( $response->isError() ) { ?> <h1>There was an error in the request</h1> </body> </html> <?php die(); } ?> |
I am a full-stack developer. My expertise include:
I love programming, design and know my way around server architecture as well. I would never feel complete, with one of these missing.
I have a broad range of interests, that’s why I constantly dive into new technologies and expand my knowledge where ever required. Technologies are evolving fast and I enjoy using the latest.
Apart from that, I am a peace loving guy who tries to have people around him that think the same. I truly believe in the principle: “If you help someone, someone will help you, when you need it."