Message Boards Message Boards

0
|
14095 Views
|
7 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Return Wikipedia Summary

Posted 9 years ago

Hello, I would like to create a wolfram application that returns only the Wikipedia summary. Is this possible with the Wolfram Alpha API? I am using Python.

Any help is appreciated.

POSTED BY: Glenn Cameron
7 Replies

This looks a lot like a bug in W|A API. You should contact Wolfram support. Alternatively, you could download the summary using one of the Python modules for accessing Wikipedia, or just use the plain old urllib2.

No, you wouldn't use the Wolfram|Alpha API for this. You would use Mathematica or Mathematica online to make an API.

The code to do this in the WolframLanguage is :

WikipediaData["Elephant", "SummaryPlaintext"]

This returns the summary for the wikipedia article on "Elephant". We can create an API to do this with just one line:

CloudDeploy[APIFunction[{"Title" -> "String"}, WikipediaData[#Title, "SummaryPlaintext"] &], Permissions -> "Public"]

There is also a function called EmbedCode which produces Python code that will call an automatically generated API. You can learn more about these functions in the Wolfram Language documentation:

http://reference.wolfram.com/language/ref/EmbedCode.html

POSTED BY: Sean Clarke
Posted 9 years ago
POSTED BY: Glenn Cameron
POSTED BY: Sean Clarke
Posted 9 years ago
POSTED BY: Glenn Cameron

What query are you using to get the wikipedia summary? What does your API query look like?

Have you tried using the API explorer? http://products.wolframalpha.com/api/explorer.html

POSTED BY: Sean Clarke
Posted 9 years ago
POSTED BY: Glenn Cameron
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract