Earlier this was done through Solana token registry, although since its shut down what is the new way of fetching the latest tokens
- Aggregate mint accounts from onchain.
- Get metadata from onchain for aggregated mint accounts.
- Keep track of token program transaction history and parse create_token transactions to get newly created mint addresses seamlessly.
However, the easist way to get available tokens is to use 3rd party apis. https://api.cryptorank.io/v0/coins?platformKeys=solana