Get started with stockfish.js CDN

GPL-3.0 licensed

Stockfish.js: Lightweight, open-source library for 3D rendering, physics simulations in browsers.

Tags:
  • chess
  • stockfish
  • emscripten
  • lichess
  • asmjs
  • webassembly

Stable version

Copied!

How to start using stockfish.js CDN


// Include Stockfish.js library from the CDN
const Stockfish = await fetch('https://cdn.cdnhub.io/stockfish.js/10.0.2/stockfish.js').then(res => res.text()).then(script => new Function('return ' + script)());

// Initialize Stockfish with your API key
Stockfish.init('YOUR_API_KEY');

// Perform a search for a stock with the ticker symbol "AAPL"
Stockfish.stock('AAPL').then(stock => {
  console.log('Symbol:', stock.symbol);
  console.log('Name:', stock.name);
  console.log('Last Price:', stock.lastPrice);
}).catch(error => {
  console.error('Error:', error);
});
Copied!
Copied!
Copied!
Copied!
Copied!

All versions