Package Exports
- @chmouel/bourso-api-js
- @chmouel/bourso-api-js/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@chmouel/bourso-api-js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Bourso API JS
A simple, modern, and lightweight unofficial Boursorama API client for Node.js.
This library is a TypeScript rewrite of the public, unauthenticated parts of the bourso-api Rust library.
Installation
npm install @chmouel/bourso-api-jsUsage
import { BoursoClient } from '@chmouel/bourso-api-js';
const client = new BoursoClient();
async function getQuote() {
try {
const quote = await client.getQuote('1rTCW8'); // Example symbol for 'AMUNDI ETF MSCI WORLD UCITS ETF'
console.log(quote);
} catch (error) {
console.error(error);
}
}
getQuote();API
getQuote(symbol: string): Promise<InstrumentQuoteResponse>
Retrieves the quote for a given symbol.
symbol(string): The symbol of the instrument (e.g., '1rTCW8').- Returns: A
Promisethat resolves to anInstrumentQuoteResponseobject.
search(query: string): Promise<SearchResponse>
Searches for stocks.
query(string): The search query.- Returns: A
Promisethat resolves to aSearchResponseobject.
License
This project is licensed under the MIT License.