For example XLM = $0.3537 now
Is there any option or API&SDK script for it?
or Do I have get it from other website?
Stellar Stack Exchange is a question and answer site for developers and users of Stellar and the Stellar Distributed Exchange. It only takes a minute to sign up.
Sign up to join this communityThere is a build in DEX in Stellar and you can query the orderbooks for other assets but I guess you will find APIs by coingecko.com, coinmarketcap.com or others more convenient.
USD is external to Stellar, so enquiring Stellar will not work. But from the Stellar network you can get XLM/USDC rate, which you can retrieve / calculate from the order book (assuming USDC == USD)
or using https://ticker.stellar.org/ (https://www.stellar.org/developers-blog/a-new-ticker-for-the-stellar-community?locale=en) I don't know how reliable is the ticker page, I would rather use orderbook.
Or use API for coingecko.com or coinmarketcap.com, as @alpe1 advised.