Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

trading212-unofficial-api

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trading212-unofficial-api

An unofficial trading212 API written in typescript.

  • 0.0.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by200%
Maintainers
1
Weekly downloads
 
Created
Source

Unofficial Trading212 API - Data Fetching

How to use ?

Initialize Class
const trading212 = new Trading212();
Companies/Tickers API

This method is used to retrieve a list of companies available for trading on the Trading 212 platform.

import Trading212 from 'trading212-unofficial-api';
// ...
const data =  await trading212.companies().select();
Candles API

Current methods for candles :

  • timeframe
  • limit (size) number of candles.
const data = await trading212.from(['MSFT','AAPL']).candles().select();
const data2 = await trading212.from(['MSFT','AAPL']).candles().limit(100).select();
const data3 = await trading212.from(['MSFT','AAPL']).candles().timeframe('ONE_DAY').limit(50).select()
Current Candle API

showPreviousPrice (optional) : boolean

The showPreviousPrice property is a boolean that indicates whether the previous price for the financial instrument should be included in the returned data. The default value for this property is false.

Returns

The method returns a Promise that resolves to an object containing the current candle data for each financial instrument specified in the input array.

const data = await trading212.from(['EURUSD','USDJPY']).currentCandle().select();

Get Current Weekly Price Candles

currentWeekCandles

Setting up timeframe is optional, default is Daily.

const data = await trading212.from(['EURUSD','USDJPY']).currentWeekCandles().timeframe('FIFTEEN_MINUTES').select()

SVG

Currently we are working to improve this function.

const data = await trading212.from('MSFT']).currentWeekCandles().timeframe('ONE_HOUR').svg();
//or 
const data = await trading212.from(['MSFT','AAPL']).currentWeekCandles().timeframe('ONE_HOUR').svg();
//or
const data = await trading212.from(['MSFT','AAPL']).candles().svg();

Disclaimer

This code is work in progress. I am in no way affiliated with trading212 and trading212 does not endorse this project. Use this code at your own risk. I afford no guarantee that the code is stable or error free.

Keywords

FAQs

Package last updated on 10 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc