degiro-api
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -40,2 +40,3 @@ "use strict"; | ||
var main_1 = require("./../main"); | ||
var DeGiroEnums_1 = require("../lib/enums/DeGiroEnums"); | ||
(function () { return __awaiter(void 0, void 0, void 0, function () { | ||
@@ -53,3 +54,7 @@ var degiro, result; | ||
_a.sent(); | ||
return [4 /*yield*/, degiro.searchProduct({ text: 'DDOG' })]; | ||
return [4 /*yield*/, degiro.searchProduct({ | ||
text: 'TSLA', | ||
type: DeGiroEnums_1.DeGiroProducTypes.shares, | ||
limit: 1, | ||
})]; | ||
case 2: | ||
@@ -56,0 +61,0 @@ result = _a.sent(); |
{ | ||
"name": "degiro-api", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"public": true, | ||
@@ -5,0 +5,0 @@ "description": "Unofficial DeGiro API for Javascript. Buy and sell in the stock market. See your portfolio and much more", |
@@ -137,2 +137,67 @@ # Unofficial DeGiro API | ||
### Search product, stock and much more in broker | ||
`degiro.searchProduct(options): Promise<SearchProductResultType[]>` | ||
* **options**: | ||
* **text**: *required* string, | ||
* **type**: *optional* DeGiroProducTypes | ||
* **limit**: *optional* number default=10, | ||
* **offset**: *optional* number default=0, | ||
`DeGiroProducTypes` | ||
* *shares*: 1 | ||
* *bonds*: 2 | ||
* *futures*: 7 | ||
* *options*: 8 | ||
* *investmendFunds*: 13 | ||
* *leveragedProducts*: 14 | ||
* *etfs*: 131 | ||
* *cfds*: 535 | ||
* *warrants*: 536 | ||
Search the text "AAPL" without any limitation | ||
```js | ||
import DeGiro from './../main' | ||
(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 | ||
```js | ||
import DeGiro from './../main' | ||
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)) | ||
})() | ||
``` | ||
## License | ||
@@ -139,0 +204,0 @@ |
import DeGiro from './../main' | ||
import { DeGiroProducTypes } from '../lib/enums/DeGiroEnums' | ||
@@ -12,4 +13,8 @@ (async () => { | ||
const result = await degiro.searchProduct({ text: 'DDOG' }) | ||
const result = await degiro.searchProduct({ | ||
text: 'TSLA', | ||
type: DeGiroProducTypes.shares, | ||
limit: 1, | ||
}) | ||
console.log(JSON.stringify(result, null, 2)) | ||
})() |
Sorry, the diff of this file is not supported yet
291024
6190
206