World Trading Data

Finance

Introduction to World Trading Data API

Are you an individual or a business looking for a reliable source of stock market information, including live quotes, historical data, and news? Look no further! World Trading Data API is here to serve all your stock market data needs.

World Trading Data is a data provider of stock market data with real-time and historical prices for stocks, exchange-traded funds (ETFs), mutual funds, currencies, commodities, and cryptocurrencies. The API is free to use with a maximum of 60 API requests per minute.

How to Use World Trading Data API

Using World Trading Data API is easy and seamless. Simply follow the steps below:

  1. Create an account with World Trading Data API
  2. Obtain an API key from the User Dashboard
  3. Read the API documentation and choose the API endpoint that serves your needs
  4. Use the API endpoint to get your desired data

API Endpoints

The World Trading Data API has various endpoints for fetching different types of data.

Stock Prices

To fetch stock prices, use the /stock endpoint. The example JavaScript code for this endpoint is as follows:

const apiKey = "Your API Key Here";
const symbol = "AAPL"; // The stock symbol you want to fetch

fetch(`https://api.worldtradingdata.com/api/v1/stock?symbol=${symbol}&api_token=${apiKey}`)
  .then((response) => response.json())
  .then((data) => console.log(data))
  .catch((error) => console.log(error));

Historical Prices

To fetch historical prices, use the /history endpoint. The example JavaScript code for this endpoint is as follows:

const apiKey = "Your API Key Here";
const symbol = "AAPL"; // The stock symbol you want to fetch historical data for
const dateFrom = "2022-01-01"; // The starting date for the historical time series
const dateTo = "2022-01-31"; // The ending date for the historical time series

fetch(`https://api.worldtradingdata.com/api/v1/history?symbol=${symbol}&date_from=${dateFrom}&date_to=${dateTo}&api_token=${apiKey}`)
  .then((response) => response.json())
  .then((data) => console.log(data))
  .catch((error) => console.log(error));

Currency Conversion

To convert one currency to another, use the /forex endpoint. The example JavaScript code for this endpoint is as follows:

const apiKey = "Your API Key Here";
const fromCurrency = "USD"; // The currency you want to convert from
const toCurrency = "EUR"; // The currency you want to convert to

fetch(`https://api.worldtradingdata.com/api/v1/forex?base=${fromCurrency}&convert_to=${toCurrency}&api_token=${apiKey}`)
  .then((response) => response.json())
  .then((data) => console.log(data))
  .catch((error) => console.log(error));

Crypto Prices

To fetch cryptocurrency prices, use the /crypto endpoint. The example JavaScript code for this endpoint is as follows:

const apiKey = "Your API Key Here";
const symbol = "BTC"; // The cryptocurrency symbol you want to fetch

fetch(`https://api.worldtradingdata.com/api/v1/crypto?symbol=${symbol}&api_token=${apiKey}`)
  .then((response) => response.json())
  .then((data) => console.log(data))
  .catch((error) => console.log(error));

Conclusion

World Trading Data API is a valuable and free resource for fetching up-to-date and historical stock market data, including pricing, currency conversions, and cryptocurrency prices. With the endpoints provided, you can easily fetch the data you need to make informed investment decisions. Happy coding!

Related APIs in Finance