---
description: >-
  Learn how to get an API Key and make your first request with the
  expand.network API.
---

# Getting Started

## 🗒️ _Follow these steps to start your journey today:_

### Step 1: 🔑Create an API key (For further details, [<mark style="color:blue;">Click here</mark>](how-do-i-get-my-api-key))

### Step 2: 🎉 Make Your First Request

### Performing READ operations

To perform **read** queries, directly target our domain **`https://api.expand.network/`** to hit our API environmen&#x74;**.** Following are the examples to make read queries:

{% hint style="info" %}
📑 Replace **"`YOUR_API_KEY"`** with your **API Key,** which was received by completing Step 1.
{% endhint %}

#### Example 1: via Postman

<figure><img src="https://680235803-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaWFVt3vE2Ci7ngiL0xHe%2Fuploads%2Fmk100jFNQJNuqKykjWXL%2FGroup%2034010.png?alt=media&#x26;token=7cccf338-f403-4beb-9d8b-c61aac9ef016" alt=""><figcaption><p>API KEY - AUTHORIZATION</p></figcaption></figure>

<figure><img src="https://680235803-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaWFVt3vE2Ci7ngiL0xHe%2Fuploads%2FWR982EMDSnGbvDlpegZ3%2Fimage%20(6).png?alt=media&#x26;token=711ddc1a-24ca-47e3-ad54-a5807e49d62c" alt=""><figcaption><p>Sample request via Postman</p></figcaption></figure>

#### Example 2: via cURL from a command line

```
curl -H "x-api-key: YOUR_API_KEY" https://api.expand.network/chain/getbalance?address=0xe688b84b23f322a994A53dbF8E15FA82CDB71127
```

### Performing WRITE operations

To perform a **write** transaction, you would require the followings:-

1. expand.network SDK which can be cloned from [GitHub](https://github.com/expand-network/sdk-nodejs.git).
2. API key&#x20;

* _Example code_: Send one Wei from an address ending in `2c7` to address ending in `86F`. You need to use your private key to sign the transaction. The return value is the transaction hash (`res`).&#x20;

```javascript
const rawTransaction = await signTransaction({
    from: '0x1BdC0A29f667E2cc74e55531431986838023E2c7',
    to: '0x94a5E554DC172A472421291Ae6e6c0e3C150286F',
    value: '1',
    gas: 50000,
},{
    privateKey: YOUR_PRIVATE_KEY',
    xApiKey : 'YOUR_API_KEY'
}).then(rawTransaction => sendTransaction({
    rawTransaction: rawTransaction.rawTransaction,
    xApiKey : 'YOUR_API_KEY'
})).then(res => console.log(res));
```

{% hint style="info" %}
**Good to know:** All transactions are securely signed on your end, so your **private key remains with you** and never comes to us over API. We do not hold your crypto at any point: <mark style="color:blue;">**Your Keys, Your Crypto**</mark><mark style="color:blue;">.</mark>&#x20;
{% endhint %}
