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": 1736,
"advancesYesterday": 1458,
"advancesLastWeek": 2782,
"advancesLastMonth": 3121,
"unchgToday": 144,
"unchgYesterday": 122,
"unchgLastWeek": 129,
"unchgLastMonth": 148,
"declinesToday": 3428,
"declinesYesterday": 3743,
"declinesLastWeek": 2415,
"declinesLastMonth": 2056,
"percentAbove20dMAtoday": 38.65,
"percentAbove20dMAyesterday": 44.2,
"percentAbove20dMALastWeek": 53.62,
"percentAbove20dMALastMonth": 72.09,
"percentAbove50dMAtoday": 53.93,
"percentAbove50dMAyesterday": 57.36,
"percentAbove50dMALastWeek": 61.45,
"percentAbove50dMALastMonth": 66.36,
"percentAbove100dMAtoday": 59.22,
"percentAbove100dMAyesterday": 61.28,
"percentAbove100dMALastWeek": 63.39,
"percentAbove100dMALastMonth": 66.08,
"percentAbove150dMAtoday": 60.01,
"percentAbove150dMAyesterday": 61.12,
"percentAbove150dMALastWeek": 63.06,
"percentAbove150dMALastMonth": 65.06,
"percentAbove200dMAtoday": 59.99,
"percentAbove200dMAyesterday": 60.98,
"percentAbove200dMALastWeek": 61.87,
"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>1736</advancesToday>
<advancesYesterday>1458</advancesYesterday>
<advancesLastWeek>2782</advancesLastWeek>
<advancesLastMonth>3121</advancesLastMonth>
<unchgToday>144</unchgToday>
<unchgYesterday>122</unchgYesterday>
<unchgLastWeek>129</unchgLastWeek>
<unchgLastMonth>148</unchgLastMonth>
<declinesToday>3428</declinesToday>
<declinesYesterday>3743</declinesYesterday>
<declinesLastWeek>2415</declinesLastWeek>
<declinesLastMonth>2056</declinesLastMonth>
<percentAbove20dMAtoday>38.65</percentAbove20dMAtoday>
<percentAbove20dMAyesterday>44.2</percentAbove20dMAyesterday>
<percentAbove20dMALastWeek>53.62</percentAbove20dMALastWeek>
<percentAbove20dMALastMonth>72.09</percentAbove20dMALastMonth>
<percentAbove50dMAtoday>53.93</percentAbove50dMAtoday>
<percentAbove50dMAyesterday>57.36</percentAbove50dMAyesterday>
<percentAbove50dMALastWeek>61.45</percentAbove50dMALastWeek>
<percentAbove50dMALastMonth>66.36</percentAbove50dMALastMonth>
<percentAbove100dMAtoday>59.22</percentAbove100dMAtoday>
<percentAbove100dMAyesterday>61.28</percentAbove100dMAyesterday>
<percentAbove100dMALastWeek>63.39</percentAbove100dMALastWeek>
<percentAbove100dMALastMonth>66.08</percentAbove100dMALastMonth>
<percentAbove150dMAtoday>60.01</percentAbove150dMAtoday>
<percentAbove150dMAyesterday>61.12</percentAbove150dMAyesterday>
<percentAbove150dMALastWeek>63.06</percentAbove150dMALastWeek>
<percentAbove150dMALastMonth>65.06</percentAbove150dMALastMonth>
<percentAbove200dMAtoday>59.99</percentAbove200dMAtoday>
<percentAbove200dMAyesterday>60.98</percentAbove200dMAyesterday>
<percentAbove200dMALastWeek>61.87</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","1736","1458","2782","3121","144","122","129","148","3428","3743","2415","2056","38.65","44.2","53.62","72.09","53.93","57.36","61.45","66.36","59.22","61.28","63.39","66.08","60.01","61.12","63.06","65.06","59.99","60.98","61.87","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