Tickers

Learn to get details about the available tickers.

Tickers are a unique combination of letters used to represent securities. Every security has a ticker associated with it. The following table gives examples of some of the more common ones:

A List of Tickers

Security

Market

Ticker

Nike Inc.

Stock

NKE

Asia Broadband Inc.

OTC

AABB

Argentine Peso - US Dollar

Forex

C:ARSUSD

Bitcoin - Japanese Yen

Cryptocurrency

X:BTCJPY

Polygon API provides various endpoints to get information about tickers. Let’s discuss them in this lesson.

The ticker symbols endpoint

The ticker symbols endpoint returns a list of all available ticker symbols and their details on Polygon, which are used as an input parameter in various other endpoints.

Press + to interact
The ticker symbols endpoint
The ticker symbols endpoint

The base URL for the tickers endpoint is given below:

https://api.polygon.io/v3/reference/tickers

By default, the ticker symbols endpoint lists all the available tickers. However, we can limit the response by providing some optional parameters.

The table below gives an overview of request parameters for the ticker symbols endpoint.

Request Parameters

Name

Type

Category

Description

ticker

String

Optional

This gets details about a specific ticker.

type

String

Optional

This specifies the type of tickers.

Accepted input: CS, ADRC, ADRP, ADRR, UNIT, RIGHT, PFD, FUND, SP, WARRANT, INDEX, EFT, ETN, OS, GDR, OTHER, NYRS, AGEN, EQLK, BOND, ADRW, BASKET, or LT.

market

String

Optional

This specifies the market.

Accepted input: stocks, otc, crypto, or fx.

exchange

String

Optional

This specifies the primary exchange of the security in ISO format.

date

String

Optional

This gets tickers available on a specified date. By default, it is set to the latest date available.

search

String

Optional

This searches for tickers by providing a keyword

active

Boolean

Optional

If this is true, only active tickers are included in the response.

sort

String

Optional

The field orders the results.

Accepted input: ticker, name, market, locale, primary_exchange, type, currency_symbol, currency_name, base_currency_symbol, base_currency_name, composite_figi, share_class_figi, last_updated_utc, or delisted_utc.

order

String

Optional

This field orders the results based on the sort field. Accepted input: asc and desc for ascending and descending, respectively.

limit

Integer

Optional

This is the limit of results required. By default, it is set to 100 and the maximum value is 1000.

Following are some additional filters provided by Polygon, which can be applied to ticker:

  • .lt: Less than

  • .gt: Greater than

  • .lte: Less than equal to

  • .gte: Greater than equal to

To apply the less-than filter on ticker, we’ll pass ticker.lt in our query parameters. In return, we’ll get a list of results where the value of ticker is less than the value defined in the query. For example, if we want results in which the value of ticker is less than B, we can write the following in our query parameters:

const queryParameters = new URLSearchParams({
"ticker.lt" : 'B',
});

Let’s try to call this endpoint in the following code:

Press + to interact
// Importing libraries here
import fetch from "node-fetch";
// Define API key here
const apiKey = '{{API_KEY}}';
// Define endpoint URL here
const endpointUrl = new URL('https://api.polygon.io/v3/reference/tickers');
// Define Header Parameters here
const headerParameters = {
authorization: `Bearer ${apiKey}`
};
// Define Query Parameters here
const queryParameters = new URLSearchParams({
market: 'fx',
limit: 10
});
// Setting API call options
const options = {
method: 'GET',
headers: headerParameters,
};
// Function to make API call
async function Ticker() {
try {
endpointUrl.search = queryParameters;
const response = await fetch(endpointUrl, options);
// Custom function for printing the API response
printResponse(response);
}
catch (error) {
// Custom function for printing the error message
printError(error);
}
}
// Calling function to make API call
Ticker();

Here’s an explanation for the above code:

  • Line 8: We define the endpoint URL.

  • Lines 11–13: We define the API key in the header parameter.

  • Lines 16–19: We define the query parameters, set the limit to 10, and only fetch results related to forex.

  • Lines 22–25: We define the options parameters and set the request type as GET.

  • Lines 28–40: We define the Ticker function, which calls the endpoint.

    • Lines 29–35: We call the API in a try block and print the response.

    • Lines 36–39: We define a catch block to catch all errors and exceptions and print them.

  • Line 43: We call the Ticker function.

Response Fields

Name

Type

Description

results

Object

This contains details about the ticker.

results.ticker

String

The ticker associated with the asset.

results.name

String

The name of the asset.

results.market

Enum

The market the asset belongs to.

Possible output: stocks, otc, forex, or crypto.

results.locale

Enum

The location of the asset.

Possible output: us or global.

results.primary_exchange

String

The code of the primary exchange of the asset.

results.type

String

The type of asset.

results.active

Boolean

This is true if the asset is currently active. It is false otherwise.

results.currency_name

String

The name of the currency the asset is traded under.

results.last_updated_utc

String

This represents the last time the ticker was updated.

status

String

The response status to our query.

request_id

String

The ID associated with our query.

count

Integer

The number of results returned.

next_url

String

The URL to the next page in case the response spans multiple pages.

The ticker details endpoint

Fetching details about a specific ticker and its parent organization is often required. These details can be accessed through the ticker details endpoint available in the Polygon API.

Press + to interact
The ticker details endpoint
The ticker details endpoint

The base URL for the ticker details endpoint is as follows:

https://api.polygon.io/v3/reference/tickers/{Ticker}

The following table gives an overview of request parameters given to the ticker details endpoint.

Request Parameters

Name

Type

Category

Description

ticker

String

Mandatory

The ticker whose details we want.

date

String

Optional

This gets information about a ticker for a specific date given in the YYYY-MM-DD format.

Let’s try to call this endpoint in the following code. Try to change the value of the ticker by clicking the “Edit” button. Click “Run” to see the output of this endpoint.

Press + to interact
// Importing libraries here
import fetch from "node-fetch";
// Define API key here
const apiKey = '{{API_KEY}}';
// Define endpoint URL here
const endpointUrl = new URL(`https://api.polygon.io/v3/reference/tickers/{{TICKER}}`);
// Define Header Parameters here
const headerParameters = {
authorization: `Bearer ${apiKey}`
};
// Setting API call options
const options = {
method: 'GET',
headers: headerParameters,
};
// Function to make API call
async function TickerDetails() {
try {
const response = await fetch(endpointUrl, options);
// Custom function for printing the API response
printResponse(response);
}
catch (error) {
// Custom function for printing the error message
printError(error);
}
}
// Calling function to make API call
TickerDetails();

Here’s an explanation for the above code:

  • Line 8: We define the endpoint URL.

  • Lines 22–33: We define the TickerDetails function, which calls the endpoint.

  • Line 36: We call the TickerDetails function.

The details of the attributes found in the response object are given in the table below:

Response Fields

Name

Type

Description

results

Object

This contains details about tickers.

results.ticker

String

The ticker associated with the asset.

results.name

String

The name of the asset.

results.market

Enum

The market the asset belongs to.

Possible output: stocks, otc, forex, or crypto.

results.locale

Enum

The location of the asset.

Possible output: us or global.

results.type

String

The type of asset.

results.active

String

This is true if the asset is currently active. It is false otherwise.

results.currency_name

Boolean

The name of the currency the asset is traded under.

results.market_cap

String

The most recent close price of the asset multiplied by weighted outstanding shares.

results.phone_number

String

The phone number of the ticker's company.

results.address

Object

The company's address.

results.description

String

The description of the company.

results.sic_code

String

The standard industrial classification code for this ticker.

results.sic_description

String

The description of the standard industrial classification code for this ticker.

results.delisted_utc

String

The last date the asset was traded.

results.ticker_root

String

The primary root of the ticker.

results.homepage_url

String

The URL to the company's homepage.

results.total_employees


The total number of employees in the ticker's company.

results.list_date

String

The date (in the YYYY-MM-DD format) the ticker was made public.

results.branding

Object

This includes the URLs to the company's logo and icon.

status

String

The response status to our query.

request_id

String

The ID associated with our query.

The ticker news endpoint

While trading securities, keeping ourselves up-to-date with the news is crucial. The ticker news endpoint gives the latest news articles about tickers.

Press + to interact
The ticker news endpoint
The ticker news endpoint

The base URL for this endpoint is as follows:

https://api.polygon.io/v2/reference/news

By default, the ticker news endpoint returns all available articles related to tickers in Polygon. However, we can provide some request parameters to filter our results.

The following table gives details about the available request parameters:

Request Parameters

Name

Type

Category

Description

ticker

String

Optional

The ticker whose details we want.

published_utc

String

Optional

This fetches news articles published on the date specified in the format YYYY-MM-DD.

sort

String

Optional

The field used to order the results.

Accepted input:published_utc.

order

String

Optional

This field orders the results based on the sort field. Accepted input: asc and desc for ascending and descending, respectively.

limit

Integer

Optional

This defines the number of news articles to return. By default, it is set to 10 and the maximum value is 1000.

Note: Additional filters, such as, .lt (less than), .gt (greater than), .lte (less than equal to), and .gte (greater than equal to), can be applied to the ticker and published_utc fields.

Let’s call the ticker news endpoint in the following code:

Press + to interact
// Importing libraries here
import fetch from "node-fetch";
// Define API key here
const apiKey = '{{API_KEY}}';
// Define endpoint URL here
const endpointUrl = new URL('https://api.polygon.io/v2/reference/news');
// Define Header Parameters here
const headerParameters = {
authorization: `Bearer ${apiKey}`,
contentType: 'application/json',
};
// Setting API call options
const options = {
method: 'GET',
headers: headerParameters,
};
// Function to make API call
async function TickerNews() {
try {
const response = await fetch(endpointUrl, options);
// Custom function for printing the API response
printResponse(response);
}
catch (error) {
// Custom function for printing the error message
printError(error);
}
}
// Calling function to make API call
TickerNews();

Here’s an explanation for the above code:

  • Line 8: We define the endpoint URL.

  • Lines 23–34: We define the function TickerNews, which calls the endpoint.

  • Line 37: We call the TickerNews function.

The following table details the attributes given in the response object.

Response Fields

Name

Type

Description

results

Object

This contains details about the news article, including a description, URL link, image URL, publisher information, author information, and so on.

results.id

String

The ID associated with the article.

results.publisher

Object

This contains information about the publisher of the news article.

results.title

String

The title of the news article.

results.author

String

The name of the author of this article.

results.published_utc

String

The date the news article was published.

results.article_url

String

The URL of the news article.

results.tickers

Array

This includes all the tickers associated with the ticker.

results.amp_url

String

The amp URL of the news article—used to access the article on a mobile device.

results.image_url

String

The URL of the image in the article.

results.description

String

This is a description of the news article.

results.keywords

Array

This contains the keywords associated with the news article.

count

Integer

The number of results returned.

status

String

The response status to our query.

request_id

String

The ID associated with our query.

next_url

String

If the news article spans multiple pages, this provides the URL of the next page.