getMomentum API

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.

All APIs

Contact Us to Get Access

Inputs

country required

A country code identifying a group of stocks listed in a country.

Type
string (A sequence of characters. (example: GOOG)) 
Example
US 

exchanges optional

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

Name / Requirement
Description
Type
country
always returned
A country code identifying a group of stocks listed in a country.
string
A sequence of characters. (example: GOOG)
advancesToday
always returned
The total number of advancing stocks for the current day.
int
A numeric type defining a whole number. (example: 2)
advancesYesterday
always returned
The total number of advancing stocks for yesterday.
int
A numeric type defining a whole number. (example: 2)
advancesLastWeek
always returned
The total number of advancing stocks last week.
int
A numeric type defining a whole number. (example: 2)
advancesLastMonth
always returned
The total number of advancing stocks last month.
int
A numeric type defining a whole number. (example: 2)
unchgToday
always returned
The total number of unchanged stocks for the current day.
int
A numeric type defining a whole number. (example: 2)
unchgYesterday
always returned
The total number of unchanged stocks for yesterday.
int
A numeric type defining a whole number. (example: 2)
unchgLastWeek
always returned
The total number of unchanged stocks last week.
int
A numeric type defining a whole number. (example: 2)
unchgLastMonth
always returned
The total number of unchanged stocks last month.
int
A numeric type defining a whole number. (example: 2)
declinesToday
always returned
The total number of declining stocks for the current day.
int
A numeric type defining a whole number. (example: 2)
declinesYesterday
always returned
The total number of declining stocks for yesterday.
int
A numeric type defining a whole number. (example: 2)
declinesLastWeek
always returned
The total number of declining stocks last week.
int
A numeric type defining a whole number. (example: 2)
declinesLastMonth
always returned
The total number of declining stocks last month.
int
A numeric type defining a whole number. (example: 2)
percentAbove20dMAtoday
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)
percentAbove20dMAyesterday
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)
percentAbove20dMALastWeek
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)
percentAbove20dMALastMonth
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)
percentAbove50dMAtoday
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)
percentAbove50dMAyesterday
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)
percentAbove50dMALastWeek
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)
percentAbove50dMALastMonth
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)
percentAbove100dMAtoday
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)
percentAbove100dMAyesterday
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)
percentAbove100dMALastWeek
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)
percentAbove100dMALastMonth
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)
percentAbove150dMAtoday
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)
percentAbove150dMAyesterday
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)
percentAbove150dMALastWeek
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)
percentAbove150dMALastMonth
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)
percentAbove200dMAtoday
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)
percentAbove200dMAyesterday
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)
percentAbove200dMALastWeek
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)
percentAbove200dMALastMonth
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)
exchange
as requested
The code for the exchange a group of financial instruments are listed on.
string
A sequence of characters. (example: GOOG)
advancingIssues
as requested
The total number of advancing issues for the current day.
int
A numeric type defining a whole number. (example: 2)
decliningIssues
as requested
The total number of declining issues for the current day.
int
A numeric type defining a whole number. (example: 2)
unchangedIssues
as requested
The total number of unchanged issues for the current day.
int
A numeric type defining a whole number. (example: 2)
advancingIssuesPct
as requested
The percentage of advancing issues for the current day.
double
A numeric type defining a number with fractional parts. (example: 2.14)
decliningIssuesPct
as requested
The percentage of declining issues for the current day.
double
A numeric type defining a number with fractional parts. (example: 2.14)
unchangedIssuesPct
as requested
The percentage of unchanged issues for the current day.
double
A numeric type defining a number with fractional parts. (example: 2.14)
advancingShares
as requested
The total number of advancing shares for the current day.
int
A numeric type defining a whole number. (example: 2)
decliningShares
as requested
The total number of declining shares for the current day.
int
A numeric type defining a whole number. (example: 2)
unchangedShares
as requested
The total number of unchanged shares for the current day.
int
A numeric type defining a whole number. (example: 2)
newHighs
as requested
The number of new 52-week highs for the current day.
int
A numeric type defining a whole number. (example: 2)
newLows
as requested
The number of new 52-week highs for the current day.
int
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": 2333,
            "advancesYesterday": 3003,
            "advancesLastWeek": 2807,
            "advancesLastMonth": 2863,
            "unchgToday": 196,
            "unchgYesterday": 216,
            "unchgLastWeek": 223,
            "unchgLastMonth": 200,
            "declinesToday": 2229,
            "declinesYesterday": 1564,
            "declinesLastWeek": 1743,
            "declinesLastMonth": 1719,
            "percentAbove20dMAtoday": 62.61,
            "percentAbove20dMAyesterday": 61.64,
            "percentAbove20dMALastWeek": 49.62,
            "percentAbove20dMALastMonth": 45.39,
            "percentAbove50dMAtoday": 56.87,
            "percentAbove50dMAyesterday": 56.51,
            "percentAbove50dMALastWeek": 52.03,
            "percentAbove50dMALastMonth": 62.89,
            "percentAbove100dMAtoday": 63.95,
            "percentAbove100dMAyesterday": 63.42,
            "percentAbove100dMALastWeek": 60.32,
            "percentAbove100dMALastMonth": 64.5,
            "percentAbove150dMAtoday": 64.82,
            "percentAbove150dMAyesterday": 64.05,
            "percentAbove150dMALastWeek": 61.1,
            "percentAbove150dMALastMonth": 64.23,
            "percentAbove200dMAtoday": 63.75,
            "percentAbove200dMAyesterday": 63.12,
            "percentAbove200dMALastWeek": 61.19,
            "percentAbove200dMALastMonth": 63.4
        }
    ]
}

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>2333</advancesToday>
   <advancesYesterday>3003</advancesYesterday>
   <advancesLastWeek>2807</advancesLastWeek>
   <advancesLastMonth>2863</advancesLastMonth>
   <unchgToday>196</unchgToday>
   <unchgYesterday>216</unchgYesterday>
   <unchgLastWeek>223</unchgLastWeek>
   <unchgLastMonth>200</unchgLastMonth>
   <declinesToday>2229</declinesToday>
   <declinesYesterday>1564</declinesYesterday>
   <declinesLastWeek>1743</declinesLastWeek>
   <declinesLastMonth>1719</declinesLastMonth>
   <percentAbove20dMAtoday>62.61</percentAbove20dMAtoday>
   <percentAbove20dMAyesterday>61.64</percentAbove20dMAyesterday>
   <percentAbove20dMALastWeek>49.62</percentAbove20dMALastWeek>
   <percentAbove20dMALastMonth>45.39</percentAbove20dMALastMonth>
   <percentAbove50dMAtoday>56.87</percentAbove50dMAtoday>
   <percentAbove50dMAyesterday>56.51</percentAbove50dMAyesterday>
   <percentAbove50dMALastWeek>52.03</percentAbove50dMALastWeek>
   <percentAbove50dMALastMonth>62.89</percentAbove50dMALastMonth>
   <percentAbove100dMAtoday>63.95</percentAbove100dMAtoday>
   <percentAbove100dMAyesterday>63.42</percentAbove100dMAyesterday>
   <percentAbove100dMALastWeek>60.32</percentAbove100dMALastWeek>
   <percentAbove100dMALastMonth>64.5</percentAbove100dMALastMonth>
   <percentAbove150dMAtoday>64.82</percentAbove150dMAtoday>
   <percentAbove150dMAyesterday>64.05</percentAbove150dMAyesterday>
   <percentAbove150dMALastWeek>61.1</percentAbove150dMALastWeek>
   <percentAbove150dMALastMonth>64.23</percentAbove150dMALastMonth>
   <percentAbove200dMAtoday>63.75</percentAbove200dMAtoday>
   <percentAbove200dMAyesterday>63.12</percentAbove200dMAyesterday>
   <percentAbove200dMALastWeek>61.19</percentAbove200dMALastWeek>
   <percentAbove200dMALastMonth>63.4</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","2333","3003","2807","2863","196","216","223","200","2229","1564","1743","1719","62.61","61.64","49.62","45.39","56.87","56.51","52.03","62.89","63.95","63.42","60.32","64.5","64.82","64.05","61.1","64.23","63.75","63.12","61.19","63.4"


PHP

<?php

$ondemand = new SoapClient('https://ondemand.websol.barchart.com/service?wsdl');

$params = [
    '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("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('US', 'NASDAQ');

print $result;

Python

from suds.client import Client
ondemand = Client('https://ondemand.websol.barchart.com/service?wsdl')

result = client.service.getMomentum('US', 'NASDAQ')

print result

Ruby

require 'savon'

ondemand = Savon.client(wsdl: 'https://ondemand.websol.barchart.com/service?wsdl')

response = ondemand.call(
    :getMomentum,
    message: {
        country: 'US',
        exchanges: 'NASDAQ',
    }
)

response.body