# Markets Search

> Use the following API endpoints to search for market data.

Source: https://docs.tradingeconomics.com/markets/search/

The search will look into the categories: Indexes, markets (stocks), bonds, and commodities.

## Search by country

**PYTHON**
*Using Requests:*
```python
import requests
your_api_key = 'your_api_key'
url = f'https://api.tradingeconomics.com/markets/search/united%20states?c={your_api_key}'
data = requests.get(url).json()
print(data)
```
*Or using our package:*
```python
import tradingeconomics as te
te.login('your_api_key')
te.getMarketsSearch(country='united states')
```

**JS**
*Using Requests:*
```js
const axios = require('axios');
(async () => {
    const your_api_key = 'your_api_key'
    const response = await axios.get(`https://api.tradingeconomics.com/markets/search/united%20states?c=${your_api_key}`)
    console.log(response.data)
})()
```
*Or using our package:*
```javascript
const te = require('tradingeconomics');
te.login('your_api_key');
data = te.getMarketSnap(search_term = 'united states').then(function(data){
  console.log(data)     
});
```

**C#**
*Using Requests:*
```c#
using (var httpClient = new HttpClient())
{
    using (var request = new HttpRequestMessage(new HttpMethod("GET"), "https://api.tradingeconomics.com/markets/search/united%20states?c=your_api_key"))
    {
        request.Headers.TryAddWithoutValidation("Upgrade-Insecure-Requests", "1");
        var response = await httpClient.SendAsync(request);
        if (response.IsSuccessStatusCode)
        {
            var content = await response.Content.ReadAsStringAsync(); 
            Console.WriteLine(content);
        }
    }
}
```

The response data format can be configured by appending the **&f=** parameter to the URL request.

**JSON**
```text
https://api.tradingeconomics.com/markets/search/{country}?c={your_api_key}&f=json
```
```json
[
  {
    "Symbol": "USGG10YR:IND",
    "Ticker": "USGG10YR",
    "Name": "US 10Y",
    "Country": "United States",
    "Date": "2023-10-11T12:13:47",
    "Type": "bond",
    "decimals": null,
    "state": null,
    "Last": null,
    "Close": null,
    "CloseDate": null,
    "MarketCap": null,
    "URL": "/united-states/government-bond-yield",
    "Importance": null,
    "DailyChange": null,
    "DailyPercentualChange": null,
    "WeeklyChange": null,
    "WeeklyPercentualChange": null,
    "MonthlyChange": null,
    "MonthlyPercentualChange": null,
    "YearlyChange": null,
    "YearlyPercentualChange": null,
    "YTDChange": null,
    "YTDPercentualChange": null,
    "day_high": null,
    "day_low": null,
    "yesterday": null,
    "lastWeek": null,
    "lastMonth": null,
    "lastYear": null,
    "startYear": null,
    "ISIN": "",
    "unit": null,
    "frequency": "Delayed",
    "LastUpdate": null
  },
  {
    "Symbol": "USGG1M:IND",
    "Ticker": "UNITEDSTA4WEEBILYIE",
    "Name": "US 4W",
    "Country": "United States",
    "Date": "2023-10-11T11:29:18",
    "Type": "bond",
    "decimals": null,
    "state": null,
    "Last": null,
    "Close": null,
    "CloseDate": null,
    "MarketCap": null,
    "URL": "/united-states/4-week-bill-yield",
    "Importance": null,
    "DailyChange": null,
    "DailyPercentualChange": null,
    "WeeklyChange": null,
    "WeeklyPercentualChange": null,
    "MonthlyChange": null,
    "MonthlyPercentualChange": null,
    "YearlyChange": null,
    "YearlyPercentualChange": null,
    "YTDChange": null,
    "YTDPercentualChange": null,
    "day_high": null,
    "day_low": null,
    "yesterday": null,
    "lastWeek": null,
    "lastMonth": null,
    "lastYear": null,
    "startYear": null,
    "ISIN": "",
    "unit": null,
    "frequency": "Delayed",
    "LastUpdate": null
  },
  {
    "Symbol": "USGG3M:IND",
    "Ticker": "UNITEDSTA3MONBILYIE",
    "Name": "US 3M",
    "Country": "United States",
    "Date": "2023-10-11T11:59:51",
    "Type": "bond",
    "decimals": null,
    "state": null,
    "Last": null,
    "Close": null,
    "CloseDate": null,
    "MarketCap": null,
    "URL": "/united-states/3-month-bill-yield",
    "Importance": null,
    "DailyChange": null,
    "DailyPercentualChange": null,
    "WeeklyChange": null,
    "WeeklyPercentualChange": null,
    "MonthlyChange": null,
    "MonthlyPercentualChange": null,
    "YearlyChange": null,
    "YearlyPercentualChange": null,
    "YTDChange": null,
    "YTDPercentualChange": null,
    "day_high": null,
    "day_low": null,
    "yesterday": null,
    "lastWeek": null,
    "lastMonth": null,
    "lastYear": null,
    "startYear": null,
    "ISIN": "",
    "unit": null,
    "frequency": "Delayed",
    "LastUpdate": null
  }
]
```

**CSV**
```text
https://api.tradingeconomics.com/markets/search/{country}?c={your_api_key}&f=csv
```
```bash
USGG10YR:IND,USGG10YR,US 10Y,United States,10/11/2023 12:14:48 PM,bond,,,,,,,/united-states/government-bond-yield,,,,,,,,,,,,,,,,,,,,,Delayed,
USGG1M:IND,UNITEDSTA4WEEBILYIE,US 4W,United States,10/11/2023 11:29:18 AM,bond,,,,,,,/united-states/4-week-bill-yield,,,,,,,,,,,,,,,,,,,,,Delayed,
USGG3M:IND,UNITEDSTA3MONBILYIE,US 3M,United States,10/11/2023 11:59:51 AM,bond,,,,,,,/united-states/3-month-bill-yield,,,,,,,,,,,,,,,,,,,,,Delayed,
```

**HTML**
```text
https://api.tradingeconomics.com/markets/search/{country}?c={your_api_key}
```

| Symbol | Ticker	| Name | Country | Date	| Type | decimals | state | Last | Close | CloseDate | MarketCap | URL | Importance | DailyChange | DailyPercentualChange | WeeklyChange | WeeklyPercentualChange | MonthlyChange | MonthlyPercentualChange | YearlyChange | YearlyPercentualChange | YTDChange | YTDPercentualChange | day_high | day_low | yesterday | lastWeek | lastMonth | lastYear | startYear | ISIN | unit | frequency | LastUpdate |
|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|
| USGG10YR:IND | USGG10YR | US 10Y | United States | 7/12/2023 4:43:28 PM | bond | | | | | | | /united-states/government-bond-yield | | | | | | | | | | | | | | | | | | | | | Delayed	|
| USGG1M:IND | UNITEDSTA4WEEBILYIE | US 4W | United States | 7/12/2023 4:04:33 PM	| bond | | | | | | | /united-states/4-week-bill-yield| | | | | | | | | | | | | | | | | | | | | Delayed	|
| USGG3M:IND | UNITEDSTA3MONBILYIE | US 3M | United States | 7/12/2023 4:10:35 PM | bond | | | | | | | /united-states/3-month-bill-yield | | | | | | | | | | | | | | | | | | | | | Delayed	|

## Search by country and category

category = (index, markets, forex, bond and commodity).

**PYTHON**
*Using Requests:*
```python
import requests
your_api_key = 'your_api_key'
url = f'https://api.tradingeconomics.com/markets/search/united%20states?c={your_api_key}&category=index,markets'
data = requests.get(url).json()
print(data)
```
*Or using our package:*
```python
te.getMarketsSearch(country='united states', category = 'index')
```

*With multi categories:*
```python
te.getMarketsSearch(country='united states', category = ['index', 'markets'])
```

**JS**
*Using Requests:*
```js
const axios = require('axios');
(async () => {
    const your_api_key = 'your_api_key'
    const response = await axios.get(`https://api.tradingeconomics.com/markets/search/united%20states?c=${your_api_key}&category=index,markets`)
    console.log(response.data)
})()
```
*Or using our package:*
```javascript
data = te.getMarketSnap(search_term = 'united states',
 category = 'index').then(function(data){
  console.log(data)     
});
```

*With multi categories:*
```javascript
data = te.getMarketSnap(search_term = 'united states',
 category = ['index', 'markets']).then(function(data){
  console.log(data)     
});
```

**C#**
*Using Requests:*
```c#
new HttpRequestMessage(new HttpMethod("GET"), "https://api.tradingeconomics.com/markets/search/united%20states?c=your_api_key&category=index");
```

*With multi categories:*
```c#
new HttpRequestMessage(new HttpMethod("GET"), "https://api.tradingeconomics.com/markets/search/united%20states?c=your_api_key&category=index,markets");
```

**JSON**
```text
https://api.tradingeconomics.com/markets/search/{country}?c={your_api_key}&category={category}&f=json
```
```json
[
  {
    "Symbol": "SPX:IND",
    "Ticker": "SPX",
    "Name": "US500",
    "Country": "United States",
    "Date": "2026-07-08T08:03:40.743",
    "Type": "index",
    "decimals": 2,
    "state": "CLOSED",
    "Last": 7488.48,
    "Close": 7503.84502,
    "CloseDate": "2026-07-07T00:00:00",
    "MarketCap": 64458066329059,
    "URL": "/united-states/stock-market",
    "Importance": 1,
    "DailyChange": -33.58688,
    "DailyPercentualChange": -0.4456,
    "WeeklyChange": 5.2451,
    "WeeklyPercentualChange": 0.0701,
    "MonthlyChange": 101.8285,
    "MonthlyPercentualChange": 1.3785,
    "YearlyChange": 1225.2156,
    "YearlyPercentualChange": 19.5619,
    "YTDChange": 642.98,
    "YTDPercentualChange": 9.3927,
    "day_high": 7536.06,
    "day_low": 7478.63,
    "yesterday": 7503.845,
    "lastWeek": 7483.2349,
    "lastMonth": 7386.6515,
    "lastYear": 6263.2644,
    "startYear": 6845.5,
    "allTimeHigh": 7620.9,
    "allTimeHighDate": "2026-06-02T00:00:00",
    "allTimeLow": 4.4,
    "allTimeLowDate": "1932-06-01T00:00:00",
    "ISIN": "",
    "unit": "Index Points",
    "frequency": "Live",
    "LastUpdate": "2026-07-08T08:04:00"
  },
  {
    "Symbol": "VIX:IND",
    "Ticker": "VIX",
    "Name": "USVIX",
    "Country": "United States",
    "Date": "2023-10-11T12:16:31.383",
    "Type": "index",
    "decimals": null,
    "state": null,
    "Last": null,
    "Close": null,
    "CloseDate": null,
    "MarketCap": null,
    "URL": "/vix:ind",
    "Importance": null,
    "DailyChange": null,
    "DailyPercentualChange": null,
    "WeeklyChange": null,
    "WeeklyPercentualChange": null,
    "MonthlyChange": null,
    "MonthlyPercentualChange": null,
    "YearlyChange": null,
    "YearlyPercentualChange": null,
    "YTDChange": null,
    "YTDPercentualChange": null,
    "day_high": null,
    "day_low": null,
    "yesterday": null,
    "lastWeek": null,
    "lastMonth": null,
    "lastYear": null,
    "startYear": null,
    "ISIN": "",
    "unit": null,
    "frequency": "Delayed",
    "LastUpdate": null
  },
  {
    "Symbol": "W5000:IND",
    "Ticker": "W5000",
    "Name": "US5000",
    "Country": "United States",
    "Date": "2023-10-10T19:46:00",
    "Type": "index",
    "decimals": null,
    "state": null,
    "Last": null,
    "Close": null,
    "CloseDate": null,
    "MarketCap": null,
    "URL": "/w5000:ind",
    "Importance": null,
    "DailyChange": null,
    "DailyPercentualChange": null,
    "WeeklyChange": null,
    "WeeklyPercentualChange": null,
    "MonthlyChange": null,
    "MonthlyPercentualChange": null,
    "YearlyChange": null,
    "YearlyPercentualChange": null,
    "YTDChange": null,
    "YTDPercentualChange": null,
    "day_high": null,
    "day_low": null,
    "yesterday": null,
    "lastWeek": null,
    "lastMonth": null,
    "lastYear": null,
    "startYear": null,
    "ISIN": "",
    "unit": null,
    "frequency": "Delayed",
    "LastUpdate": null
  }
]
```

**CSV**
```text
https://api.tradingeconomics.com/markets/search/{country}?c={your_api_key}&category={category}&f=csv
```
```bash
SPX:IND,SPX,US500,United States,7/8/2026 8:05:47 AM,index,2,CLOSED,7487.49000,7503.84502,7/7/2026 12:00:00 AM,64458066329059,/united-states/stock-market,1,-33.58688,-0.4456,4.25510,0.0569,100.83850,1.3651,1224.22560,19.5461,641.99000,9.3783,7536.06000,7478.63000,7503.84500,7483.23490,7386.65150,6263.26440,6845.50000,7620.90000,6/2/2026 12:00:00 AM,4.40000,6/1/1932 12:00:00 AM,,Index Points,Live,7/8/2026 8:06:00 AM
VIX:IND,VIX,USVIX,United States,10/11/2023 12:16:31 PM,index,,,,,,,/vix:ind,,,,,,,,,,,,,,,,,,,,,Delayed,
W5000:IND,W5000,US5000,United States,10/10/2023 7:46:00 PM,index,,,,,,,/w5000:ind,,,,,,,,,,,,,,,,,,,,,Delayed,
```

**HTML**
```text
https://api.tradingeconomics.com/markets/search/{country}?c={your_api_key}&category={category}
```

| Symbol | Ticker	| Name | Country | Date	| Type | decimals | state | Last | Close | CloseDate | MarketCap | URL | Importance | DailyChange | DailyPercentualChange | WeeklyChange | WeeklyPercentualChange | MonthlyChange | MonthlyPercentualChange | YearlyChange | YearlyPercentualChange | YTDChange | YTDPercentualChange | day_high | day_low | yesterday | lastWeek | lastMonth | lastYear | startYear | ISIN | unit | frequency | LastUpdate |
|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|
| INDU:IND | INDU | US30 | United States | 7/12/2023 4:52:34 PM | index | | | | | | | /united-states/stock-market | | | | | | | | | | | | | | | | | | | | | Live |
| VIX:IND | VIX | USVIX | United States | 7/12/2023 5:07:16 PM | index | | | | | | | /vix:ind | | | | | | | | | | | | | | | | | | | | | Delayed	|
| W5000:IND | W5000 | US5000 | United States | 7/12/2023 4:52:00 PM | index | | | | | | | /w5000:ind | | | | | | | | | | | | | | | | | | | | | Delayed	|

## Search by term

**PYTHON**
*Using Requests:*
```python
import requests
your_api_key = 'your_api_key'
url = f'https://api.tradingeconomics.com/markets/search/msft?c={your_api_key}'
data = requests.get(url).json()
print(data)
```
*Or using our package:*
```python
te.getMarketsSearch(country ='msft')
```

**JS**
*Using Requests:*
```js
const axios = require('axios');
(async () => {
    const your_api_key = 'your_api_key'
    const response = await axios.get(`https://api.tradingeconomics.com/markets/search/msft?c=${your_api_key}`)
    console.log(response.data)
})()
```
*Or using our package:*
```javascript
data = te.getMarketSnap(search_term = 'msft').then(function(data){
  console.log(data)     
});
```

**C#**
*Using Requests:*
```c#
new HttpRequestMessage(new HttpMethod("GET"), "https://api.tradingeconomics.com/markets/search/msft?c=your_api_key");
```

**JSON**
```text
https://api.tradingeconomics.com/markets/search/{term}?c={your_api_key}&f=json
```
```json
[
  {
    "Symbol": "MSFT:US",
    "Ticker": "MSFT",
    "Name": "Microsoft",
    "Country": "United States",
    "Date": "2023-10-10T19:59:11.157",
    "Type": "stocks",
    "decimals": null,
    "state": null,
    "Last": null,
    "Close": null,
    "CloseDate": null,
    "MarketCap": null,
    "URL": "/msft:us",
    "Importance": null,
    "DailyChange": null,
    "DailyPercentualChange": null,
    "WeeklyChange": null,
    "WeeklyPercentualChange": null,
    "MonthlyChange": null,
    "MonthlyPercentualChange": null,
    "YearlyChange": null,
    "YearlyPercentualChange": null,
    "YTDChange": null,
    "YTDPercentualChange": null,
    "day_high": null,
    "day_low": null,
    "yesterday": null,
    "lastWeek": null,
    "lastMonth": null,
    "lastYear": null,
    "startYear": null,
    "ISIN": "US5949181045",
    "unit": null,
    "frequency": "Live",
    "LastUpdate": null
  }
]
```

**CSV**
```text
https://api.tradingeconomics.com/markets/search/{term}?c={your_api_key}&f=csv
```
```bash
MSFT:US,MSFT,Microsoft,United States,10/10/2023 7:59:11 PM,stocks,,,,,,,/msft:us,,,,,,,,,,,,,,,,,,,US5949181045,,Live,
```

**HTML**
```text
https://api.tradingeconomics.com/markets/search/{term}?c={your_api_key}
```

| Symbol | Ticker	| Name | Country | Date	| Type | decimals | state | Last | Close | CloseDate | MarketCap | URL | Importance | DailyChange | DailyPercentualChange | WeeklyChange | WeeklyPercentualChange | MonthlyChange | MonthlyPercentualChange | YearlyChange | YearlyPercentualChange | YTDChange | YTDPercentualChange | day_high | day_low | yesterday | lastWeek | lastMonth | lastYear | startYear | ISIN | unit | frequency | LastUpdate |
|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|
| MSFT:US | MSFT | Microsoft | United States | 7/12/2023 5:09:46 PM | stocks | | | | | | | /msft:us | | | | | | | | | | | | | | | | | | | US5949181045 | | Live |

## Response fields

| Field                   | Type   | Description                                                             | Example               |
| ------------------------| -------|-------------------------------------------------------------------------|-----------------------|
| Symbol                  | string | Unique symbol used by Trading Economics                                      | "6758:JP"             |
| Ticker                  | string | Unique ticker code used by Trading Economics                                 | "6758"                |
| Name                    | string | Full name of the company or indicator                                        | "Sony"                |
| Country                 | string | Country associated with the instrument                                       | "Japan"               |
| Date                    | string | Date and time of the latest release in UTC (ISO 8601 format)                 | "2023-04-13T00:00:00" |
| Type                    | string | Market type                                                                  | "stocks"              |
| Decimals                | number | Number of decimal places used in reported values                             | 2.0                   |
| State                   | string | Current market state                                                         | "CLOSED"              |
| Last                    | number | Most recent trading value or price                                           | 11900.0000            |
| Close                   | number | Last recorded value before the market closed                                 | 11900.0000            |
| CloseDate               | string | Date and time of the last closing price (ISO 8601 format)                    | "2023-04-13T00:00:00" |
| MarketCap               | number | Market capitalization                                                        | 14684155308900.0      |
| URL                     | string | Trading Economics link to the instrument’s detail page                       | "/commodity/eggs-ch"  |
| Importance              | number | Indicator importance score ranging from 0 (lowest) to 1000 (highest)         | 1000                  |
| DailyChange             | number | Absolute difference between previous close and current price                 | -8.0000               |
| DailyPercentualChange   | number | Percentage difference between previous close and current price               | -0.1801               |
| WeeklyChange            | number | Absolute difference between last week’s close and current price              | 56.0000               |
| WeeklyPercentualChange  | number | Percentage difference between last week’s close and current price            | 1.2788                |
| MonthlyChange           | number | Absolute difference between last month’s close and current price             | -139.0000             |
| MonthlyPercentualChange | number | Percentage difference between last month’s close and current price           | -3.0389               |
| YearlyChange            | number | Absolute difference between last year’s close and current price              | -15.0000              |
| YearlyPercentualChange  | number | Percentage difference between last year’s close and current price            | -0.3371               |
| YTDChange               | number | Absolute difference between last year’s final close and current price (YTD)  | 525.0000              |
| YTDPercentualChange     | number | Percentage difference between last year’s final close and current price (YTD)| 13.4271               |
| day_high                | number | Highest trading value of the current day                                     | 4460.0000             |
| day_low                 | number | Lowest trading value of the current day                                      | 4410.0000             |
| Yesterday               | number | Previous day’s closing price                                                 | 4443.0000             |
| LastWeek                | number | Closing price from the previous week                                         | 4379.0000             |
| LastMonth               | number | Closing price from the previous month                                        | 4574.0000             |
| LastYear                | number | Closing price from the previous year                                         | 4450.0000             |
| StartYear               | number | Closing price at the start of the current year                               | 3910.0000             |
| ISIN                    | string | International Securities Identification Number                                | "US0378331005"        |
| Unit                    | string | Unit of measurement for the value                                            | "CNY/T"               |
| Frequency               | string | Reporting frequency of the market data                                       | "Daily"               |
| LastUpdate              | string | Timestamp of the most recent data update (ISO 8601 format)                   | "2023-04-13T18:24:00" |

