What's the API endpoint for Starknet?

What’s the root API URL being used by the Starknet CLI? Can we call it ourselves directly?

10 Likes

And is there a documentation somewhere of all the API endpoints that are available?

4 Likes

I don’t think there’s any public documentation about the StarkNet API endpoint. I believe the best place to look for this information at the moment is the starknet.js repo, specifically the default provider.

9 Likes

I see the API documentation in Starknet.js. The code is quite good, seems we can figure it out easily from there.

Is there a base URL defined somewhere? That’s the one thing I couldn’t find.

5 Likes

Here ya go: starknet.js/default.ts at 0a302e1eac60d9dd1f8442efd51fc8244ebdf5be · seanjameshan/starknet.js · GitHub

https://alpha4.starknet.io

Note that this url often changes with new Cairo releases

9 Likes

Hello,

Using the current sequencer as an API endpoint is temporary, and will be deprecated in the future; this is why we did not take much time to document it.
In the future you’ll query an RPC endpoint through a library, ala web3 .
Let me see if I can find more info in the meanwhile

5 Likes

The URL is documented here -
https://starknet.io/docs/hello_starknet/index.html#starknet-alpha-on-mainnet

12 Likes