@chmouel/bourso-api-js
v1.0.0
Published
A simple, modern, and lightweight unofficial Boursorama API client for Node.js.
Downloads
6
Maintainers
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.
