Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
degiro-api
Advanced tools
Unofficial DeGiro API for Javascript. Buy and sell in the stock market. See your portfolio and much more
This is an unofficial Node.js API client for DeGiro's trading platform. Using this module you can easily automate your orders (buy and sell) and get information about orders, funds or products.
DeGiro is Europe's fastest growing online stockbroker. DeGiro distinguishes itself by offering institutional fees to retail investors.
⚠️ DeGiro could change their API at any moment, if something is not working, please open an issue.
# using npm
npm install --save degiro-api
# using yarn
yarn add degiro-api
Basic log in DeGiro Platform. All endpoint needs a session key before those can be call.
const DeGiro = require('degiro-api')
const degiro = new DeGiro({
username: 'username',
pwd: '*****'
})
degiro.login()
.then(() => console.log('Log in success'))
.catch(console.error)
Get account info using await
:
import DeGiro from 'degiro-api'
(async () => {
const degiro = new DeGiro({
username: 'username',
pwd: '*****'
})
await degiro.login()
const accountData = await degiro.getAccountData()
// console.log(accountData)
})()
getPortfolio
params are:
type: set the types or positions you want to fetch. Could be:
getProductDetails: if is set to true the positions results will have a productData
field with all the product details.
Get all open positions:
import DeGiro from 'degiro-api'
import { PORTFOLIO_POSITIONS_TYPE_ENUM } from 'degiro-api/enums'
(async () => {
const degiro: DeGiro = new DeGiro({
username: 'your_username_here',
pwd: '**********',
})
await degiro.login()
const portfolio = await degiro.getPortfolio({
type: PORTFOLIO_POSITIONS_TYPE_ENUM.ALL,
getProductDetails: true,
})
console.log(JSON.stringify(portfolio, null, 2))
})()
Also you can fetch your portfolio data this way:
import DeGiro from 'degiro-api'
import { PORTFOLIO_POSITIONS_TYPE_ENUM } from 'degiro-api/enums'
(async () => {
const degiro: DeGiro = new DeGiro({
username: 'your_username_here',
pwd: '**********',
})
await degiro.login()
const portfolio = await degiro.getPortfolio({ type: PORTFOLIO_POSITIONS_TYPE_ENUM.ALL })
console.log(JSON.stringify(portfolio, null, 2))
})()
And getting product details too
import DeGiro from 'degiro-api'
import { PORTFOLIO_POSITIONS_TYPE_ENUM } from 'degiro-api/enums'
(async () => {
const degiro: DeGiro = new DeGiro({
username: 'your_username_here',
pwd: '**********',
})
await degiro.login()
const portfolio = await degiro.getPortfolio({
type: PORTFOLIO_POSITIONS_TYPE_ENUM.ALL,
getProductDetails: true,
})
console.log(JSON.stringify(portfolio, null, 2))
})()
degiro.searchProduct(options): Promise<SearchProductResultType[]>
DeGiroProducTypes
Search the text "AAPL" without any limitation
import DeGiro from 'degiro-api'
(async () => {
const degiro: DeGiro = new DeGiro({
username: 'your_username_here',
pwd: '***********',
})
await degiro.login()
const result = await degiro.searchProduct({ text: 'AAPL' })
console.log(JSON.stringify(result, null, 2))
})()
Search TSLA stock
import DeGiro from 'degiro-api'
import { DeGiroProducTypes } from 'degiro-api/enums'
(async () => {
const degiro: DeGiro = new DeGiro({
username: 'your_username_here',
pwd: '***********',
})
await degiro.login()
const result = await degiro.searchProduct({
text: 'TSLA',
type: DeGiroProducTypes.shares,
limit: 1,
})
console.log(JSON.stringify(result, null, 2))
})()
import DeGiro from 'degiro-api'
import { DeGiroActions, DeGiroMarketOrderTypes, DeGiroTimeTypes } from 'degiro-api/enums'
import { OrderType } from 'degiro-api/types' // should not work??
(async () => {
const degiro: DeGiro = new DeGiro({
username: 'your_username_here',
pwd: '************'
})
await degiro.login()
const order: OrderType = {
buySell: DeGiroActions.BUY,
orderType: DeGiroMarketOrderTypes.LIMITED,
productId: '331868', // $AAPL - Apple Inc
size: 1,
timeType: DeGiroTimeTypes.DAY,
price: 272, // limit price [Degiro could reject this value]
// stopPrice: 2,
}
const { confirmationId, freeSpaceNew, transactionFees } = await degiro.createOrder(order)
console.log(JSON.stringify({ confirmationId, freeSpaceNew, transactionFees }, null, 2))
})()
See the repo degiro-cli.
MIT
FAQs
Unofficial DeGiro API for Javascript. Buy and sell in the stock market. See your portfolio and much more
The npm package degiro-api receives a total of 24 weekly downloads. As such, degiro-api popularity was classified as not popular.
We found that degiro-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.