Stock Momentum API
getMomentum
The getMomentum API provides a daily summary on the number of advancing, declining and unchanged stocks, as well as the percentage of stocks above moving averages of different lengths.
View All APIsContact Us to Get Access
Inputs
countryoptional
A country code identifying a group of stocks listed in a country.
Type
string (A sequence of characters. (example: GOOG))
Example
US
exchangesoptional
The code for the exchange a group of financial instruments are listed on.
Type
list (A comma or semi-colon delimited string.)
Example
NASDAQ
Outputs
country
always returned
always returned
A country code identifying a group of stocks listed in a country.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
advancesToday
always returned
always returned
The total number of advancing stocks for the current day.
int
A numeric type defining a whole number. (example: 2)
A numeric type defining a whole number. (example: 2)
advancesYesterday
always returned
always returned
The total number of advancing stocks for yesterday.
int
A numeric type defining a whole number. (example: 2)
A numeric type defining a whole number. (example: 2)
advancesLastWeek
always returned
always returned
The total number of advancing stocks last week.
int
A numeric type defining a whole number. (example: 2)
A numeric type defining a whole number. (example: 2)
advancesLastMonth
always returned
always returned
The total number of advancing stocks last month.
int
A numeric type defining a whole number. (example: 2)
A numeric type defining a whole number. (example: 2)
unchgToday
always returned
always returned
The total number of unchanged stocks for the current day.
int
A numeric type defining a whole number. (example: 2)
A numeric type defining a whole number. (example: 2)
unchgYesterday
always returned
always returned
The total number of unchanged stocks for yesterday.
int
A numeric type defining a whole number. (example: 2)
A numeric type defining a whole number. (example: 2)
unchgLastWeek
always returned
always returned
The total number of unchanged stocks last week.
int
A numeric type defining a whole number. (example: 2)
A numeric type defining a whole number. (example: 2)
unchgLastMonth
always returned
always returned
The total number of unchanged stocks last month.
int
A numeric type defining a whole number. (example: 2)
A numeric type defining a whole number. (example: 2)
declinesToday
always returned
always returned
The total number of declining stocks for the current day.
int
A numeric type defining a whole number. (example: 2)
A numeric type defining a whole number. (example: 2)
declinesYesterday
always returned
always returned
The total number of declining stocks for yesterday.
int
A numeric type defining a whole number. (example: 2)
A numeric type defining a whole number. (example: 2)
declinesLastWeek
always returned
always returned
The total number of declining stocks last week.
int
A numeric type defining a whole number. (example: 2)
A numeric type defining a whole number. (example: 2)
declinesLastMonth
always returned
always returned
The total number of declining stocks last month.
int
A numeric type defining a whole number. (example: 2)
A numeric type defining a whole number. (example: 2)
percentAbove20dMAtoday
always returned
always returned
The percentage of stocks above their 20-day moving average for the current day.
double
A numeric type defining a number with fractional parts. (example: 2.14)
A numeric type defining a number with fractional parts. (example: 2.14)
percentAbove20dMAyesterday
always returned
always returned
The percentage of stocks above their 20-day moving average yesterday.
double
A numeric type defining a number with fractional parts. (example: 2.14)
A numeric type defining a number with fractional parts. (example: 2.14)
percentAbove20dMALastWeek
always returned
always returned
The percentage of stocks above their 20-day moving average last week.
double
A numeric type defining a number with fractional parts. (example: 2.14)
A numeric type defining a number with fractional parts. (example: 2.14)
percentAbove20dMALastMonth
always returned
always returned
The percentage of stocks above their 20-day moving average last month.
double
A numeric type defining a number with fractional parts. (example: 2.14)
A numeric type defining a number with fractional parts. (example: 2.14)
percentAbove50dMAtoday
always returned
always returned
The percentage of stocks above their 50-day moving average for the current day.
double
A numeric type defining a number with fractional parts. (example: 2.14)
A numeric type defining a number with fractional parts. (example: 2.14)
percentAbove50dMAyesterday
always returned
always returned
The percentage of stocks above their 50-day moving average yesterday.
double
A numeric type defining a number with fractional parts. (example: 2.14)
A numeric type defining a number with fractional parts. (example: 2.14)
percentAbove50dMALastWeek
always returned
always returned
The percentage of stocks above their 50-day moving average last week.
double
A numeric type defining a number with fractional parts. (example: 2.14)
A numeric type defining a number with fractional parts. (example: 2.14)
percentAbove50dMALastMonth
always returned
always returned
The percentage of stocks above their 50-day moving average last month.
double
A numeric type defining a number with fractional parts. (example: 2.14)
A numeric type defining a number with fractional parts. (example: 2.14)
percentAbove100dMAtoday
always returned
always returned
The percentage of stocks above their 100-day moving average for the current day.
double
A numeric type defining a number with fractional parts. (example: 2.14)
A numeric type defining a number with fractional parts. (example: 2.14)
percentAbove100dMAyesterday
always returned
always returned
The percentage of stocks above their 100-day moving average yesterday.
double
A numeric type defining a number with fractional parts. (example: 2.14)
A numeric type defining a number with fractional parts. (example: 2.14)
percentAbove100dMALastWeek
always returned
always returned
The percentage of stocks above their 100-day moving average last week.
double
A numeric type defining a number with fractional parts. (example: 2.14)
A numeric type defining a number with fractional parts. (example: 2.14)
percentAbove100dMALastMonth
always returned
always returned
The percentage of stocks above their 100-day moving average last month.
double
A numeric type defining a number with fractional parts. (example: 2.14)
A numeric type defining a number with fractional parts. (example: 2.14)
percentAbove150dMAtoday
always returned
always returned
The percentage of stocks above their 150-day moving average for the current day.
double
A numeric type defining a number with fractional parts. (example: 2.14)
A numeric type defining a number with fractional parts. (example: 2.14)
percentAbove150dMAyesterday
always returned
always returned
The percentage of stocks above their 150-day moving average yesterday.
double
A numeric type defining a number with fractional parts. (example: 2.14)
A numeric type defining a number with fractional parts. (example: 2.14)
percentAbove150dMALastWeek
always returned
always returned
The percentage of stocks above their 150-day moving average last week.
double
A numeric type defining a number with fractional parts. (example: 2.14)
A numeric type defining a number with fractional parts. (example: 2.14)
percentAbove150dMALastMonth
always returned
always returned
The percentage of stocks above their 150-day moving average last month.
double
A numeric type defining a number with fractional parts. (example: 2.14)
A numeric type defining a number with fractional parts. (example: 2.14)
percentAbove200dMAtoday
always returned
always returned
The percentage of stocks above their 200-day moving average for the current day.
double
A numeric type defining a number with fractional parts. (example: 2.14)
A numeric type defining a number with fractional parts. (example: 2.14)
percentAbove200dMAyesterday
always returned
always returned
The percentage of stocks above their 200-day moving average yesterday.
double
A numeric type defining a number with fractional parts. (example: 2.14)
A numeric type defining a number with fractional parts. (example: 2.14)
percentAbove200dMALastWeek
always returned
always returned
The percentage of stocks above their 200-day moving average last week.
double
A numeric type defining a number with fractional parts. (example: 2.14)
A numeric type defining a number with fractional parts. (example: 2.14)
percentAbove200dMALastMonth
always returned
always returned
The percentage of stocks above their 200-day moving average last month.
double
A numeric type defining a number with fractional parts. (example: 2.14)
A numeric type defining a number with fractional parts. (example: 2.14)
exchange
as requested
as requested
The code for the exchange a group of financial instruments are listed on.
string
A sequence of characters. (example: GOOG)
A sequence of characters. (example: GOOG)
advancingIssues
as requested
as requested
The total number of advancing issues for the current day.
int
A numeric type defining a whole number. (example: 2)
A numeric type defining a whole number. (example: 2)
decliningIssues
as requested
as requested
The total number of declining issues for the current day.
int
A numeric type defining a whole number. (example: 2)
A numeric type defining a whole number. (example: 2)
unchangedIssues
as requested
as requested
The total number of unchanged issues for the current day.
int
A numeric type defining a whole number. (example: 2)
A numeric type defining a whole number. (example: 2)
advancingIssuesPct
as requested
as requested
The percentage of advancing issues for the current day.
double
A numeric type defining a number with fractional parts. (example: 2.14)
A numeric type defining a number with fractional parts. (example: 2.14)
decliningIssuesPct
as requested
as requested
The percentage of declining issues for the current day.
double
A numeric type defining a number with fractional parts. (example: 2.14)
A numeric type defining a number with fractional parts. (example: 2.14)
unchangedIssuesPct
as requested
as requested
The percentage of unchanged issues for the current day.
double
A numeric type defining a number with fractional parts. (example: 2.14)
A numeric type defining a number with fractional parts. (example: 2.14)
advancingShares
as requested
as requested
The total number of advancing shares for the current day.
int
A numeric type defining a whole number. (example: 2)
A numeric type defining a whole number. (example: 2)
decliningShares
as requested
as requested
The total number of declining shares for the current day.
int
A numeric type defining a whole number. (example: 2)
A numeric type defining a whole number. (example: 2)
unchangedShares
as requested
as requested
The total number of unchanged shares for the current day.
int
A numeric type defining a whole number. (example: 2)
A numeric type defining a whole number. (example: 2)
newHighs
as requested
as requested
The number of new 52-week highs for the current day.
int
A numeric type defining a whole number. (example: 2)
A numeric type defining a whole number. (example: 2)
newLows
as requested
as requested
The number of new 52-week highs for the current day.
int
A numeric type defining a whole number. (example: 2)
A numeric type defining a whole number. (example: 2)
Status Code Responses
200
OK
Success
400
Bad Request
The request was invalid, please see the message for more information.
500
Internal Server Error
Something is not working correctly, please contact support.
JSON
GET
GET https://ondemand.websol.barchart.com/getMomentum.json?apikey=YOUR_API_KEY&country=US&exchanges=NASDAQ
Host: ondemand.websol.barchart.com
POST
POST https://ondemand.websol.barchart.com/getMomentum.json
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
apikey=YOUR_API_KEY&country=US&exchanges=NASDAQ
Response
{
"status": {
"code": 200,
"message": "Success."
},
"results": [
{
"country": "US",
"advancesToday": 3552,
"advancesYesterday": 2215,
"advancesLastWeek": 1736,
"advancesLastMonth": 3121,
"unchgToday": 123,
"unchgYesterday": 128,
"unchgLastWeek": 142,
"unchgLastMonth": 148,
"declinesToday": 1628,
"declinesYesterday": 2959,
"declinesLastWeek": 3433,
"declinesLastMonth": 2056,
"percentAbove20dMAtoday": 18.75,
"percentAbove20dMAyesterday": 15.15,
"percentAbove20dMALastWeek": 38.65,
"percentAbove20dMALastMonth": 72.09,
"percentAbove50dMAtoday": 33.06,
"percentAbove50dMAyesterday": 30.16,
"percentAbove50dMALastWeek": 53.93,
"percentAbove50dMALastMonth": 66.36,
"percentAbove100dMAtoday": 47.46,
"percentAbove100dMAyesterday": 44.37,
"percentAbove100dMALastWeek": 59.22,
"percentAbove100dMALastMonth": 66.08,
"percentAbove150dMAtoday": 51.4,
"percentAbove150dMAyesterday": 49.04,
"percentAbove150dMALastWeek": 60.01,
"percentAbove150dMALastMonth": 65.06,
"percentAbove200dMAtoday": 52.34,
"percentAbove200dMAyesterday": 50.68,
"percentAbove200dMALastWeek": 59.99,
"percentAbove200dMALastMonth": 63.57
}
]
}
XML
GET
GET https://ondemand.websol.barchart.com/getMomentum.xml?apikey=YOUR_API_KEY&country=US&exchanges=NASDAQ
Host: ondemand.websol.barchart.com
POST
POST https://ondemand.websol.barchart.com/getMomentum.xml
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
apikey=YOUR_API_KEY&country=US&exchanges=NASDAQ
Response
<?xml version="1.0" encoding="utf-8"?>
<getMomentum>
<status>
<code>200</code>
<message>Success.</message>
</status>
<item>
<country>US</country>
<advancesToday>3552</advancesToday>
<advancesYesterday>2215</advancesYesterday>
<advancesLastWeek>1736</advancesLastWeek>
<advancesLastMonth>3121</advancesLastMonth>
<unchgToday>123</unchgToday>
<unchgYesterday>128</unchgYesterday>
<unchgLastWeek>142</unchgLastWeek>
<unchgLastMonth>148</unchgLastMonth>
<declinesToday>1628</declinesToday>
<declinesYesterday>2959</declinesYesterday>
<declinesLastWeek>3433</declinesLastWeek>
<declinesLastMonth>2056</declinesLastMonth>
<percentAbove20dMAtoday>18.75</percentAbove20dMAtoday>
<percentAbove20dMAyesterday>15.15</percentAbove20dMAyesterday>
<percentAbove20dMALastWeek>38.65</percentAbove20dMALastWeek>
<percentAbove20dMALastMonth>72.09</percentAbove20dMALastMonth>
<percentAbove50dMAtoday>33.06</percentAbove50dMAtoday>
<percentAbove50dMAyesterday>30.16</percentAbove50dMAyesterday>
<percentAbove50dMALastWeek>53.93</percentAbove50dMALastWeek>
<percentAbove50dMALastMonth>66.36</percentAbove50dMALastMonth>
<percentAbove100dMAtoday>47.46</percentAbove100dMAtoday>
<percentAbove100dMAyesterday>44.37</percentAbove100dMAyesterday>
<percentAbove100dMALastWeek>59.22</percentAbove100dMALastWeek>
<percentAbove100dMALastMonth>66.08</percentAbove100dMALastMonth>
<percentAbove150dMAtoday>51.4</percentAbove150dMAtoday>
<percentAbove150dMAyesterday>49.04</percentAbove150dMAyesterday>
<percentAbove150dMALastWeek>60.01</percentAbove150dMALastWeek>
<percentAbove150dMALastMonth>65.06</percentAbove150dMALastMonth>
<percentAbove200dMAtoday>52.34</percentAbove200dMAtoday>
<percentAbove200dMAyesterday>50.68</percentAbove200dMAyesterday>
<percentAbove200dMALastWeek>59.99</percentAbove200dMALastWeek>
<percentAbove200dMALastMonth>63.57</percentAbove200dMALastMonth>
</item>
</getMomentum>
CSV
GET
GET https://ondemand.websol.barchart.com/getMomentum.csv?apikey=YOUR_API_KEY&country=US&exchanges=NASDAQ
Host: ondemand.websol.barchart.com
POST
POST https://ondemand.websol.barchart.com/getMomentum.csv
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
apikey=YOUR_API_KEY&country=US&exchanges=NASDAQ
Response
country,advancesToday,advancesYesterday,advancesLastWeek,advancesLastMonth,unchgToday,unchgYesterday,unchgLastWeek,unchgLastMonth,declinesToday,declinesYesterday,declinesLastWeek,declinesLastMonth,percentAbove20dMAtoday,percentAbove20dMAyesterday,percentAbove20dMALastWeek,percentAbove20dMALastMonth,percentAbove50dMAtoday,percentAbove50dMAyesterday,percentAbove50dMALastWeek,percentAbove50dMALastMonth,percentAbove100dMAtoday,percentAbove100dMAyesterday,percentAbove100dMALastWeek,percentAbove100dMALastMonth,percentAbove150dMAtoday,percentAbove150dMAyesterday,percentAbove150dMALastWeek,percentAbove150dMALastMonth,percentAbove200dMAtoday,percentAbove200dMAyesterday,percentAbove200dMALastWeek,percentAbove200dMALastMonth
"US","3552","2215","1736","3121","123","128","142","148","1628","2959","3433","2056","18.75","15.15","38.65","72.09","33.06","30.16","53.93","66.36","47.46","44.37","59.22","66.08","51.4","49.04","60.01","65.06","52.34","50.68","59.99","63.57"
PHP
<?php
$ondemand = new SoapClient('https://ondemand.websol.barchart.com/service?wsdl');
$params = [
'apikey' => 'YOUR_API_KEY',
'country' => 'US',
'exchanges' => 'NASDAQ',
];
$result = $ondemand->getMomentum($params);
var_dump($result);
Classic ASP
Dim ondemand
Dim result
Set ondemand = Server.CreateObject("MSSOAP.SoapClient30")
ondemand.ClientProperty("ServerHTTPRequest") = True
ondemand.MSSoapInit("https://ondemand.websol.barchart.com/service?wsdl")
Set result = ondemand.getMomentum("YOUR_API_KEY", "US", "NASDAQ")
Perl
use SOAP::Lite;
use SOAP::WSDL;
my $ondemand = SOAP::Lite
-> service('https://ondemand.websol.barchart.com/service?wsdl');
my $result = $ondemand->getMomentum('YOUR_API_KEY', 'US', 'NASDAQ');
print $result;
Python
from suds.client import Client
ondemand = Client('https://ondemand.websol.barchart.com/service?wsdl')
result = ondemand.service.getMomentum('YOUR_API_KEY', 'US', 'NASDAQ')
print(result)
Ruby
require 'savon'
ondemand = Savon.client(wsdl: 'https://ondemand.websol.barchart.com/service?wsdl')
response = ondemand.call(
:getMomentum,
message: {
apikey: 'YOUR_API_KEY',
country: 'US',
exchanges: 'NASDAQ',
}
)
response.body