WolframAlpha

WolframAlpha["query"]

sends query to Wolfram|Alpha and imports the output.

WolframAlpha["query",format]

imports the output according to the specified format.

Details and Options

  • Using WolframAlpha requires internet connectivity.
  • The following formats are supported:
  • "FullOutput"a fully formatted version of Wolfram|Alpha output
    "Image"a single image of the Wolfram|Alpha output
    "WolframParse"a Wolfram Language expression corresponding to the query
    "WolframResult"pure standard Wolfram Language result (if any)
    "Result"result in the form generated by =
    "SpokenResult"result in a speakable form
    "ShortAnswer"result in a short human-readable form
    "URL"Wolfram|Alpha API URL for the query
    "XML"raw XML data
    "WolframForms"list of Wolfram Language expressions in the output, in held form
    "PodInformation"a list of all known information about each pod
    "PodCells"a list of pod contents, rendered as Wolfram Language cells
    "PodImages"a list of pod contents, rendered as bitmaps
    "PodPlaintext"a list of pod contents, as plain text
    "PodTitles"a list of available pod titles
    "PodIDs"a list of available pod IDs
    "PodStates"a list of available pod states
    "SessionInfo"a list of session values that may be sent to the Wolfram|Alpha server to compute the result
    "DataRules"a list of available exposed data
    "Validate"whether the query can be interpreted by Wolfram|Alpha
    {"podid"}a list of available properties for a given pod
    {{"podid",subpodid}}a list of available properties for the given pod and subpod
    {"podid","property"}the values of a given property for the given pod
    {{"podid",subpodid},"property"}the value of a given property for the given pod and subpod
  • The pod ID in WolframAlpha[query,{podid,elems}] can be any string returned by WolframAlpha[query,"PodIDs"].
  • When the second argument is a list, any element of that list can itself be a list, or All, indicating that all matching properties should be returned.
  • WolframAlpha[query] is equivalent to WolframAlpha[query,"FullOutput"] in a notebook front end, and WolframAlpha[query,{ All,{"Plaintext","Input"}}] otherwise.
  • The following options can be given:
  • AppearanceElements Automaticelements to include in the displayed results
    Asynchronous Falsewhether to use asynchronous features of the API
    ExcludePods Nonespecific pod IDs to exclude from the results
    IncludePods Allspecific pod IDs to include in the results
    InputAssumptions {}assumptions to include in the API call
    PodStates {}information about the state of pods
    PodWidth Automaticthe width parameters of content returned by the API
    TimeConstraint20how many seconds to allow for the API call
  • AppearanceElements only affects results that are returned with structured formatting, such as WolframAlpha[string,"FullOutput"].
  • Possible AppearanceElements include "Warnings", "Assumptions", "Pods", and "Sources".
  • Asynchronous->True sets the "async = true" flag in the API, but then automatically resolves asynchronous content with subsequent calls to Import.
  • Asynchronous->All will set the "async = true" flag, and leave any asynchronous content unresolved.
  • When the second argument is a list, any settings for IncludePods and ExcludePods are ignored.
  • If IncludePods and ExcludePods are both set to non-empty lists of pod IDs, ExcludePods will be ignored.
  • PodWidth->w sets the API's "width" parameter to w.
  • PodWidth can be set to a list of up to four numbers, corresponding to the API parameters "width", "maxwidth", "plotwidth", and "infowidth".
  • WolframAlpha[args,TimeConstraint->t] is effectively equivalent to TimeConstrained[WolframAlpha[args],t].
  • TimeConstraint->t does not constrain the time spent for asynchronous downloads.
  • If TimeConstraint is set to a list of values, the second element is used for the API's "scantimeout" setting, the third for "podtimeout", and the fourth for "formattimeout".

Examples

open allclose all

Basic Examples  (6)

Get the results from a simple Wolfram|Alpha query:

Get just the content of the results, formatted as Wolfram System cells:

Get the results as a single image:

Get the result as a sentence:

Get the result as a textual answer:

Get a particular piece of information from a particular pod and subpod:

Scope  (1)

You can use the "PodIDs" element to get a list of available pods for a given query:

A particular pod ID can then be used to drill down into that pod, to see what pieces of data are available:

Summon content containing a single 3D graphic:

Options  (7)

AppearanceElements  (1)

The default AppearanceElements setting includes "PodMenus":

Prevent the use input links from appearing by changing the AppearanceElements setting:

Asynchronous  (1)

By default, WolframAlpha[query] makes a synchronous query:

Asynchronous->True uses asynchronous features of the API, but still resolves all content before displaying:

Asynchronous->All may cause some content to resolve after it is displayed:

ExcludePods  (1)

Give specific pod IDs to exclude from the results:

Use "PodIDs" to query the available values that can be given to ExcludePods:

IncludePods  (1)

Give specific pod IDs to include in the results:

Use "PodIDs" to query the available values that can be given to IncludePods:

InputAssumptions  (1)

Specify assumptions about formula values:

PodStates  (1)

The default return value may have modifiable states:

The setting for PodStates typically includes the full history of all states that have been set:

PodWidth  (1)

By default, WolframAlpha returns content that is sized as it would be on the web:

When PodWidth specifies wider content, more content can fit on a default line:

Applications  (1)

Time series data, such as that used for a stock's closing price, is returned by Wolfram|Alpha as a list of pairs of dates and values:

The second column of this data contains the actual prices:

Use any of the Wolfram Language's built-in functions to do arbitrary data analysis:

Interactive Examples  (2)

Display Wolfram|Alpha results in a MenuView:

Use several calls to WolframAlpha to get a sequence of images, and animate the result:

Wolfram Research (2010), WolframAlpha, Wolfram Language function, https://reference.wolfram.com/language/ref/WolframAlpha.html (updated 2017).

Text

Wolfram Research (2010), WolframAlpha, Wolfram Language function, https://reference.wolfram.com/language/ref/WolframAlpha.html (updated 2017).

CMS

Wolfram Language. 2010. "WolframAlpha." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2017. https://reference.wolfram.com/language/ref/WolframAlpha.html.

APA

Wolfram Language. (2010). WolframAlpha. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/WolframAlpha.html

BibTeX

@misc{reference.wolfram_2024_wolframalpha, author="Wolfram Research", title="{WolframAlpha}", year="2017", howpublished="\url{https://reference.wolfram.com/language/ref/WolframAlpha.html}", note=[Accessed: 10-October-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_wolframalpha, organization={Wolfram Research}, title={WolframAlpha}, year={2017}, url={https://reference.wolfram.com/language/ref/WolframAlpha.html}, note=[Accessed: 10-October-2024 ]}