Wolfram|Alpha Show Steps API Reference

Get step-by-step solutions to all kinds of computational problems with the Show Steps API.

An extension of the Full Results API, the Show Steps API gives direct access to Wolfram|Alpha's full step-by-step solutions for queries in a variety of mathematical and scientific subjects. These explanations of computed answers are designed to provide clarity and understanding to the end user and are especially useful in educational and training applications. The Show Steps API is implemented in a standard REST protocol using HTTP GET requests.

Although the majority of data available through the Wolfram|Alpha website is also available through this API, certain subjects may be restricted by default. To request access to additional topics, contact us. Use of the Show Steps API is subject to the API Terms of Use and Commercial Terms of Use.

Getting Started

Signup and Login

To get started, you must register a Wolfram ID and sign in to the Wolfram|Alpha Developer Portal. Upon logging in, go to the My Apps tab to start creating your first app.

Obtaining an AppID

Click the Sign up to get your first AppID button to start the app creation process. After a one-time survey about intended usage, the AppID creation dialog will appear. Give your application a name and a simple description to register an AppID. Each application must have its own unique AppID.

Using the Show Steps API

Sample Query

Now that you have an AppID, you can make your first query. The base URL for queries using the Full Results API is:

http://api.wolframalpha.com/v2/query

Every query requires two pieces of information—an AppID and an input value—in order to be processed correctly. The appid parameter tells your query which AppID to use:

http://api.wolframalpha.com/v2/query?appid=DEMO

Next, use the input parameter to specify the URL-encoded input for your query. In this example, the query is the algebra problem "solve 3x-7=11":

http://api.wolframalpha.com/v2/query?appid=DEMO&input=solve+3x-7%3D11

The rest of the URL uses specific parameters to extract the desired step-by-step solution. For instance, here is the query to show the steps for "solve 3x-7=11" in a plain text format:

http://api.wolframalpha.com/v2/query?appid=DEMO&input=solve+3x-7%3D11&podstate=Result__Step-by-step+solution&format=plaintext

When executed with a valid AppID, this URL will return an XML result with the full solution:

<queryresult success="true" error="false" numpods="4" datatypes="Solve" timedout="" timedoutpods="" timing="1.2770000000000001" parsetiming="0.41500000000000004" parsetimedout="false" recalculate="" id="MSPa1074519d49ide6f930bcd000066b5bd1icf12idfh" host="http://www4b.wolframalpha.com" server="10" related="http://www4b.wolframalpha.com/api/v2/relatedQueries.jsp?id=MSPa1074619d49ide6f930bcd0000298e3aa6fa1ih9306568059217232548068" version="2.6">
  <pod title="Input interpretation" scanner="Identity" id="Input" position="100" error="false" numsubpods="1">
  <subpod title="">
    <plaintext>solve 3 x - 7 = 11</plaintext>
  </subpod>
  </pod>
  <pod title="Results" scanner="Solve" id="Result" position="200" error="false" numsubpods="2" primary="true">
  <subpod title="">
    <plaintext>x = 6</plaintext>
  </subpod>
  <subpod title="Possible intermediate steps">
    <plaintext>Solve for x:
3 x - 7 = 11
Add 7 to both sides:
3 x + (7 - 7) = 7 + 11
7 - 7 = 0:
3 x = 11 + 7
11 + 7 = 18:
3 x = 18
Divide both sides of 3 x = 18 by 3:
(3 x)/3 = 18/3
3/3 = 1:
x = 18/3
The gcd of 18 and 3 is 3, so 18/3 = (3×6)/(3×1) = 3/3×6 = 6:
Answer: |  
 | x = 6</plaintext>
  </subpod>
  <states count="1">
    <state name="Hide steps" input="Result__Hide steps" />
  </states>
  </pod>
</queryresult>

Show Steps Overview

Many Wolfram|Alpha web results include a button labeled "Step-by-step solution":

Screenshot of Wolfram|Alpha website with labeled 'Step-by-Step Solution' button.

Clicking this button brings up an interactive dialog that allows the user to view the computational steps that lead to the displayed result:

Screenshot of dialog that shows Step-by-step solutions.

The Show Steps API provides programmatic access to these step-by-step solutions using a small subset of parameters available through the Full Results API. Parameter options for the Show Steps API will vary depending upon the type and subject of the query. The best way to determine what is needed for a particular query is to first perform a Full Results API query and inspect the XML results for the desired elements. For example, here is the URL and full output for the "solve 3x-7=11" query:

http://api.wolframalpha.com/v2/query?appid=DEMO&input=solve+3x-7%3D11
<queryresult success="true" error="false" numpods="4" datatypes="Solve" timedout="" timedoutpods="" timing="1.135" parsetiming="0.43" parsetimedout="false" recalculate="" id="MSPa275316db5fa7g8a57531000039110ae0c5h41g4d" host="http://www4b.wolframalpha.com" server="41" related="http://www4b.wolframalpha.com/api/v2/relatedQueries.jsp?id=MSPa275416db5fa7g8a57531000029461hicfh43435h7565264462549653373" version="2.6">
  <pod title="Input interpretation" scanner="Identity" id="Input" position="100" error="false" numsubpods="1">
    <subpod title="">
      <img src="http://www4b.wolframalpha.com/Calculate/MSP/MSP275516db5fa7g8a5753100006255hi8e8d99025f?MSPStoreType=image/gif&s=41" alt="solve 3 x - 7 = 11" title="solve 3 x - 7 = 11" width="165" height="32" />
      <plaintext>solve 3 x - 7 = 11</plaintext>
    </subpod>
  </pod>
  <pod title="Result" scanner="Solve" id="Result" position="200" error="false" numsubpods="1" primary="true">
    <subpod title="">
      <img src="http://www4b.wolframalpha.com/Calculate/MSP/MSP275616db5fa7g8a5753100003ab07d5328de0f62?MSPStoreType=image/gif&s=41" alt="x = 6" title="x = 6" width="34" height="18" />
      <plaintext>x = 6</plaintext>
    </subpod>
    <states count="1">
      <state name="Step-by-step solution" input="Result__Step-by-step solution" />
    </states>
  </pod>
  <pod title="Plot" scanner="Solve" id="RootPlot" position="300" error="false" numsubpods="1">
    <subpod title="">
      <img src="http://www4b.wolframalpha.com/Calculate/MSP/MSP275716db5fa7g8a57531000051bd35e9382gb85e?MSPStoreType=image/gif&s=41" alt="" title="" width="363" height="188" />
      <plaintext/>
    </subpod>
  </pod>
  <pod title="Number line" scanner="Solve" id="NumberLine" position="400" error="false" numsubpods="1">
    <subpod title="">
      <img src="http://www4b.wolframalpha.com/Calculate/MSP/MSP275816db5fa7g8a57531000046fb6912765b3b84?MSPStoreType=image/gif&s=41" alt="" title="" width="300" height="56" />
      <plaintext/>
    </subpod>
  </pod>
</queryresult>

Examining this XML, you can see that the Result pod has a <state> element named "Step-by-step solution". Any pod containing such an element can be altered to show the steps for computing the answer. The next section describes how to use these result elements in conjunction with basic URL parameters to get step-by-step solutions. (For more on pods, see this in-depth explanation.)

URL Parameters and Options

This list includes only the parameters relevant to generating, selecting and formatting step-by-step solutions. The Parameter Reference Chart has a complete list of Full Results API parameters.

podstate

To show the steps for a result, pass the name value from the <state> element—usually "Step-by-step%20solution" or just "Step-by-step"—to the podstate parameter. This converts all eligible result pods to their step-by-step forms. Here is the result from above, but with a "Possible intermediate steps" subpod contained in the Result pod:

http://api.wolframalpha.com/v2/query?appid=DEMO&input=solve+3x-7%3D11&podstate=Step-by-step%20solution
<pod title="Results" scanner="Solve" id="Result" position="200" error="false" numsubpods="2" primary="true">
  <subpod title="">
    <img ... />
    <plaintext>x = 6</plaintext>
  </subpod>
  <subpod title="Possible intermediate steps">
    <img src="http://www4c.wolframalpha.com/Calculate/MSP/MSP549422f4ffc9576hiie400000h0541df5g7f7a42?MSPStoreType=image/gif&s=11"
      alt="Solve for x:
3 x - 7 = 11
Add 7 to both sides:
3 x + (7 - 7) = 7 + 11
7 - 7 = 0:
3 x = 11 + 7
11 + 7 = 18:
3 x = 18
Divide both sides of 3 x = 18 by 3:
(3 x)/3 = 18/3
3/3 = 1:
x = 18/3
The gcd of 18 and 3 is 3, so 18/3 = (3×6)/(3×1) = 3/3×6 = 6:
Answer: |  
 | x = 6"
      title=" ... "
      width="330" height="629" />
    <plaintext>Solve for x:
3 x - 7 = 11
Add 7 to both sides:
3 x + (7 - 7) = 7 + 11
7 - 7 = 0:
3 x = 11 + 7
11 + 7 = 18:
3 x = 18
Divide both sides of 3 x = 18 by 3:
(3 x)/3 = 18/3
3/3 = 1:
x = 18/3
The gcd of 18 and 3 is 3, so 18/3 = (3×6)/(3×1) = 3/3×6 = 6:
Answer: |  
 | x = 6</plaintext>
  </subpod>
  <states count="1">
    <state name="Hide steps" input="Result__Hide steps" />
  </states>
</pod>

In some cases, the API may generate additional pod states to show further steps in a process. For instance, the result for the "water molecule" query contains a "Structure diagram" pod with a step-by-step explanation of the chemical structure diagram:

http://api.wolframalpha.com/v2/query?appid=DEMO&input=water%20molecule
<pod title="Structure diagram" scanner="Data" id="StructureDiagramPod:ChemicalData" position="300" error="false" numsubpods="1">
  <subpod title="">
    <img ... />
    <plaintext/>
  </subpod>
  <states count="4">
    <statelist count="2" value="Skeletal structure" delimiters="">
      <state name="Skeletal structure" input="StructureDiagramPod:ChemicalData__Skeletal structure" />
      <state name="Lewis structure" input="StructureDiagramPod:ChemicalData__Lewis structure" />
    </statelist>
    <state name="Show bond information" input="StructureDiagramPod:ChemicalData__Show bond information" />
    <state name="Show graph properties" input="StructureDiagramPod:ChemicalData__Show graph properties" />
    <state name="Step‐by‐step" input="StructureDiagramPod:ChemicalData__Step‐by‐step" stepbystep="true" />
  </states>
</pod>

Passing this input value into a new query generates a new version of the pod:

http://api.wolframalpha.com/v2/query?appid=DEMO&input=water%20molecule&podstate=Step‐by‐step
<pod title="Lewis structure" scanner="Data" id="StructureDiagramPod:ChemicalData" position="300" error="false" numsubpods="1">
  <subpod title="">
    <img ... />
    <plaintext>
      Draw the Lewis structure of water. Start by drawing the overall structure of the molecule:
    </plaintext>
  </subpod>
  <states count="2">
    <state name="Next step" input="StructureDiagramPod:ChemicalData__Next step" />
    <state name="Show all steps" input="StructureDiagramPod:ChemicalData__Show all steps" />
  </states>
</pod>

In this case, the API has generated an additional pod state to show further steps in the process. To access a subsequent state, append an additional instance of the podstate parameter:

http://api.wolframalpha.com/v2/query?appid=DEMO&input=water%20molecule&podstate=Step‐by‐step&podstate=Next%20step
<pod title="Lewis structure" scanner="Data" id="StructureDiagramPod:ChemicalData" position="300" error="false" numsubpods="1">
  <subpod title="">
    <img ... />
    <plaintext>Draw the Lewis structure of water. Start by drawing the overall structure of the molecule:

Count the total valence electrons of the hydrogen (n_H,val = 1) and oxygen (n_O,val = 6) atoms:
2 n_H,val + n_O,val = 8</plaintext>
  </subpod>
  <states count="3">
    <state name="Next step" input="StructureDiagramPod:ChemicalData__Next step" />
    <state name="Show all steps" input="StructureDiagramPod:ChemicalData__Show all steps" />
    <state name="Start over" input="StructureDiagramPod:ChemicalData__Start over" />
  </states>
</pod>

Note that the new <state> element named "Next step" is identical to the one in the previous step. In this situation, you can prepend "n@" to indicate multiple state changes in one podstate parameter. For example, this query would generate a Result pod with 3 additional steps:

http://api.wolframalpha.com/v2/query?appid=DEMO&input=water%20molecule&podstate=Step‐by‐step&podstate=3@Next%20step

This notation makes URLs substantially shorter and easier to parse in multi-step applications.

format

By default, results returned by the Show Steps API are presented both as a linked image and as a snippet of plain text. You can opt to return only one of these by specifying either image or plaintext with the format parameter. Here is the query to retrieve only the image portion of the "solve 3x-7=11" result from the above:

http://api.wolframalpha.com/v2/query?appid=DEMO&input=solve+3x-7%3D11&podstate=Result__Step-by-step%20solution&format=image
<pod title="Results" scanner="Solve" id="Result" position="200" error="false" numsubpods="2" primary="true">
  <subpod title="">
    <img ... />
  </subpod>
  <subpod title="Possible intermediate steps">
    <img src="http://www4b.wolframalpha.com/Calculate/MSP/MSP57421afg9472dd5aai92000033562g41525ebe51?MSPStoreType=image/gif&s=12"
      alt="Solve for x:
3 x - 7 = 11
Add 7 to both sides:
3 x + (7 - 7) = 7 + 11
7 - 7 = 0:
3 x = 11 + 7
11 + 7 = 18:
3 x = 18
Divide both sides of 3 x = 18 by 3:
(3 x)/3 = 18/3
3/3 = 1:
x = 18/3
The gcd of 18 and 3 is 3, so 18/3 = (3×6)/(3×1) = 3/3×6 = 6:
Answer: |  
 | x = 6"
      title=" ... "
      width="330" height="629" />
  </subpod>
  <states count="1">
    <state name="Hide steps" input="Result__Hide steps" />
  </states>
</pod>

The source link given in the <img> tag is a simplified version of the Wolfram|Alpha web output:

A complete, but simplified, image showing a Step-by-step solution.

The HTML alt text for the image is usually the same text returned by using the plaintext format option.

Errors

The following is a brief list of common errors and their recommended solutions. For detailed information on warnings and interpretation issues, see the Warnings section of the Full Results API documentation.

Input parameter not present in query (Error 1000)

This error indicates that the Full Results API did not find an input parameter while parsing. In most cases, this can be fixed by checking that you have used the correct syntax and have included a non-blank input parameter.

Invalid appid (Error 1)

This error is returned when a request contains an invalid option for the appid parameter. Double-check that your AppID is typed correctly and that your appid parameter is using the correct syntax.

Appid missing (Error 2)

This error is returned when a request does not contain any option for the appid parameter. Double-check that you have entered an AppID and that your appid parameter is using the correct syntax.