Prerequisites
- An Alchemy account
- Access to the Alchemy Dashboard
Create an Alchemy API key
-
Navigate to the Create App button in the Apps tab.

-
Fill in the details under Create App to get your new key. You can also see the applications you previously made by you and your team on this page. Pull existing keys by clicking on View Key for any app.


Send a cURL request
You can interact with Alchemy’s Polygon infrastructure using JSON-RPC from the command line. UsePOST requests with the Content-Type: application/json header. Pass your query as the POST body with these fields:
jsonrpc: The JSON-RPC version. Only2.0is supported.method: The API method. See the API reference.params: A list of parameters to pass to the method.id: The ID of your request, returned in the response so you can match requests to responses.
To send requests to your own app instead of the public demo, replace
https://eth-mainnet.alchemyapi.io/jsonrpc/demo with https://eth-mainnet.alchemyapi.io/v2/your-api-key.Set up the Alchemy SDK
Use the Alchemy SDK to make blockchain requests directly from a JavaScript or Node.js dApp. If you already use Web3.js or Ethers.js, change your node provider URL to an Alchemy URL with your API key:https://eth-mainnet.alchemyapi.io/v2/your-api-key
The scripts below must run in a node context or be saved in a file, not run directly from the command line.