Ethereum API FAQ
Common questions about Ethereum JSON-RPC methods and best practices when building on Ethereum.

What testnet should developers use for Ethereum development?

All developers getting started on Alchemy should use Goerli as their testnet of choice for development!
The Ethereum Foundation will be winding down support for the Rinkeby, Ropsten, and Kovan networks after Ethereum's transition to a proof-of-stake model. To ensure that your testnet applications remain fully functional after the transition, we recommend using Goerli, which will remain unchanged. Learn more about Ethereum networks and testnets here.

What API does Ethereum use?

Ethereum uses the JSON-RPC API standard. The Ethereum JSON-RPC API serves as the backbone for the Ethereum network and powers any blockchain interaction. In aggregate, this API suite allows users to read block/transaction data, query chain information, execute smart contracts, store data on-chain etc. Developers and consumers alike interact with Ethereum’s base JSON-RPC APIs to communicate with its decentralized network of nodes.

What is an Ethereum API Key?

When accessing the Ethereum network via a node provider, API services like Alchemy require an API key, which allows developers to monitor personal apps and access usage metrics.
While many Ethereum development environments have a set of default shared API keys, they are often throttled during periods of high usage leading to slower response times and a higher likelihood of request failures.
For the best development experience, we recommend that you sign up for a free API key!
With a dedicated API key, developers are able to:
  • access higher request throughput and increased concurrent requests
  • query enhanced APIs, gaining access to free archive data, logs, and higher-level API abstractions
  • leverage individualized usage metrics

Does Ethereum only use JSON-RPC?

The raw Ethereum client only uses JSON-RPC notation to encode remote procedure calls for interpreting requests and serving up responses. However, most developers use libraries that actually abstract away the JSON-RPC standard. Libraries like AlchemyWeb3 wrap the base Ethereum JSON-RPC API to create more intuitive methods that make debugging and developing easier. Likewise, developers can find a host of different wrapper libraries spanning different programming languages like Javascript, Python, Golang, etc. which use JSON-RPC under the hood.

How does Alchemy's Ethereum API work?

Alchemy's Ethereum API gives developers and users access to read and write data to the Ethereum blockchain.
If you’re not familiar with how a blockchain works, here’s a quick recap:
  • The Ethereum blockchain is made up of blocks of data.
  • Blocks are stored on distributed Ethereum nodes.
  • Each node in the network serves as a “mini-server” that allows its operator to read/write blocks of data.
Alchemy provides access to our higher level infrastructure that allows developers to interface with the Ethereum network. With API access, Alchemy developers are able to send read/write requests to the blockchain.
We take care of the hard stuff so that developers can focus on their products!

Can you use Python for Ethereum?

Yes! While Javascript libraries have historically gained traction in the Ethereum development community, Python developers are also able to read and write the same data. One commonly used blockchain interaction library is web3.py which wraps many of the same methods featured in web3.js and Ethers.js.
For Python-based EVM development, Brownie offers a full suite of Web3 developer tools for compiling, testing, and deploying dApps similar to its peer environments Hardhat and Truffle.

How do I get the timestamp for a transaction?

There are three steps to get the timestamp for a transaction:
  1. 1.
    Grab the blockNumber field in your transaction object
    1. 1.
      If you only have the transaction hash, you can get the full object by making a request to eth_getTransactionByHash.
  2. 2.
    Get the block info by calling eth_getBlockByNumber
  3. 3.
    Grab the timestamp field in the returned block object
Here is an example request.
It's important to note that block numbers themselves are Ethereum's measure of time, however standard timestamps are available by looking at the block data.

How do I distinguish between a contract address and a wallet address?

A super easy way to distinguish between a contract address and a wallet address is by calling eth_getCode, which will return contract code if it's a contract and nothing if it's a wallet. Here's an example of both using our composer tool:

My question isn't here, where can I get help?

Don't worry, we got you. Check out our support page for plenty of options!
Ethereum API
Alchemy Documentation