# Sui API Quickstart

> Get started building on Sui and using the JSON-RPC API

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

The Sui API enables you to interact with the Sui blockchain via a collection of JSON-RPC endpoints. You can query block and transaction data, interact with Move-based smart contracts, manage assets, and more.

Unlike Ethereum-based chains, Sui uses an object-centric data model, optimized for parallel execution and scalability. This quickstart helps you make your first request to the network.

***

## What is the Sui API?

The Sui API lets you send queries and transactions to the Sui blockchain through a JSON-RPC interface. With Sui’s object-based architecture and horizontal scalability, you benefit from high throughput and low-latency reads and writes.

Alchemy’s Sui API provides consistent and performant access to:

* Retrieving account and object data
* Querying blocks, transactions, and events
* Simulating and broadcasting transactions
* Accessing Move smart contract modules and functions

***

## Getting started

### 1. Choose a package manager (npm or yarn)

Select a package manager to manage your project's dependencies. The choice between `npm` and `yarn` depends on your preference or project requirements.

| npm                                                                                                                       | yarn                                                                                                |
| ------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| Begin with `npm` by following the [npm documentation](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm). | For `yarn`, refer to [yarn's installation guide](https://classic.yarnpkg.com/lang/en/docs/install). |

### 2. Set up your project

Open your terminal and run the following commands:

<CodeGroup>
  ```text npm
  mkdir sui-api-quickstart
  cd sui-api-quickstart
  npm init --yes
  ```

  ```text yarn
  mkdir sui-api-quickstart
  cd sui-api-quickstart
  yarn init --yes
  ```
</CodeGroup>

This creates a new directory named `sui-api-quickstart` and initializes a Node.js project within it.

### 3. Make your first request

Install Axios, a popular HTTP client, to make API requests:

<CodeGroup>
  ```bash bash
  npm install axios
  # Or with yarn
  # yarn add axios
  ```
</CodeGroup>

Create an `index.js` file in your project directory and paste the following code:

<CodeGroup>
  ```javascript javascript
  const axios = require('axios');

  const url = `https://sui-mainnet.alchemy-blast.com/v2/${yourAPIKey}`;

  const payload = {
  jsonrpc: '2.0',
  id: 1,
  method: 'sui_getLatestCheckpointSequenceNumber',
  params: []
  };

  axios.post(url, payload)
  .then(response => {
  console.log('Latest checkpoint sequence number:', response.data.result);
  })
  .catch(error => {
  console.error('Error fetching checkpoint:', error);
  });

  ```
</CodeGroup>

Replace `yourAPIKey` with your actual Alchemy API key from the [Alchemy Dashboard](https://dashboard.alchemy.com/signup).

### 4. Run your script

Run the following command:

<CodeGroup>
  ```bash bash
  node index.js
  ```
</CodeGroup>

You should see the latest checkpoint sequence number on Sui printed to your console:

```shell
Latest checkpoint sequence number: 1029433
```

## Next steps

You've made your first request to the Sui API. You can now explore the [JSON-RPC methods available on Sui](/docs/chains/sui/sui-api-endpoints/sui-dev-inspect-transaction-block) and start building your dApps.