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": 2532,
"advancesYesterday": 2759,
"advancesLastWeek": 1496,
"advancesLastMonth": 1176,
"unchgToday": 146,
"unchgYesterday": 134,
"unchgLastWeek": 114,
"unchgLastMonth": 114,
"declinesToday": 2606,
"declinesYesterday": 2391,
"declinesLastWeek": 3681,
"declinesLastMonth": 4013,
"percentAbove20dMAtoday": 51.41,
"percentAbove20dMAyesterday": 51.3,
"percentAbove20dMALastWeek": 49.83,
"percentAbove20dMALastMonth": 37.11,
"percentAbove50dMAtoday": 54.59,
"percentAbove50dMAyesterday": 54.11,
"percentAbove50dMALastWeek": 53.7,
"percentAbove50dMALastMonth": 47.07,
"percentAbove100dMAtoday": 57.28,
"percentAbove100dMAyesterday": 57.41,
"percentAbove100dMALastWeek": 56.65,
"percentAbove100dMALastMonth": 54.38,
"percentAbove150dMAtoday": 58.05,
"percentAbove150dMAyesterday": 58.17,
"percentAbove150dMALastWeek": 57.59,
"percentAbove150dMALastMonth": 55.55,
"percentAbove200dMAtoday": 57.55,
"percentAbove200dMAyesterday": 57.38,
"percentAbove200dMALastWeek": 56.82,
"percentAbove200dMALastMonth": 55.64
}
]
}
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>2532</advancesToday>
<advancesYesterday>2759</advancesYesterday>
<advancesLastWeek>1496</advancesLastWeek>
<advancesLastMonth>1176</advancesLastMonth>
<unchgToday>146</unchgToday>
<unchgYesterday>134</unchgYesterday>
<unchgLastWeek>114</unchgLastWeek>
<unchgLastMonth>114</unchgLastMonth>
<declinesToday>2606</declinesToday>
<declinesYesterday>2391</declinesYesterday>
<declinesLastWeek>3681</declinesLastWeek>
<declinesLastMonth>4013</declinesLastMonth>
<percentAbove20dMAtoday>51.41</percentAbove20dMAtoday>
<percentAbove20dMAyesterday>51.3</percentAbove20dMAyesterday>
<percentAbove20dMALastWeek>49.83</percentAbove20dMALastWeek>
<percentAbove20dMALastMonth>37.11</percentAbove20dMALastMonth>
<percentAbove50dMAtoday>54.59</percentAbove50dMAtoday>
<percentAbove50dMAyesterday>54.11</percentAbove50dMAyesterday>
<percentAbove50dMALastWeek>53.7</percentAbove50dMALastWeek>
<percentAbove50dMALastMonth>47.07</percentAbove50dMALastMonth>
<percentAbove100dMAtoday>57.28</percentAbove100dMAtoday>
<percentAbove100dMAyesterday>57.41</percentAbove100dMAyesterday>
<percentAbove100dMALastWeek>56.65</percentAbove100dMALastWeek>
<percentAbove100dMALastMonth>54.38</percentAbove100dMALastMonth>
<percentAbove150dMAtoday>58.05</percentAbove150dMAtoday>
<percentAbove150dMAyesterday>58.17</percentAbove150dMAyesterday>
<percentAbove150dMALastWeek>57.59</percentAbove150dMALastWeek>
<percentAbove150dMALastMonth>55.55</percentAbove150dMALastMonth>
<percentAbove200dMAtoday>57.55</percentAbove200dMAtoday>
<percentAbove200dMAyesterday>57.38</percentAbove200dMAyesterday>
<percentAbove200dMALastWeek>56.82</percentAbove200dMALastWeek>
<percentAbove200dMALastMonth>55.64</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","2532","2759","1496","1176","146","134","114","114","2606","2391","3681","4013","51.41","51.3","49.83","37.11","54.59","54.11","53.7","47.07","57.28","57.41","56.65","54.38","58.05","58.17","57.59","55.55","57.55","57.38","56.82","55.64"
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