# Get Last Mined Block EVM

Through this endpoint customers can fetch the last mined block in a specific blockchain network, along with its details. These could include the hash of the specific, the previous and the next block, its transactions count, its height, etc. 

Blockchain specific data is information such as version, nonce, size, bits, merkleroot, etc.

- **Endpoint:** `GET https://rest.cryptoapis.io/blocks/evm/{blockchain}/{network}/latest/details`
- **Authentication:** `x-api-key` header
- **Credits cost:** 30 credits for 1 result by default; per blockchain: Ethereum: 30, Ethereum Classic: 39, Binance Smart Chain: 75, Polygon: 60, Arbitrum: 48, Avalanche: 54, Base: 36, Optimism: 42, Tron: 45
- **Documentation page:** https://developers.cryptoapis.io/v-2.2024-12-12-175/RESTapis/blocks-evm/get-last-mined-block-evm/get

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `blockchain` | string | yes | Represents the specific blockchain protocol name Allowed values: `ethereum`, `ethereum-classic`, `tron`, `binance-smart-chain`, `polygon`, `avalanche`, `arbitrum`, `base`, `optimism`. |
| `network` | string | yes | Represents the name of the blockchain network used Allowed values: `mainnet`, `mordor`, `nile`, `testnet`, `sepolia`, `amoy`, `fuji`. |

## Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `context` | string | no | In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. `context` is specified by the user. |

## Responses

| Status | Description |
| --- | --- |
| 200 | The request has been successful. |
| 400 | 400 |
| 401 | 401 |
| 402 | 402 |
| 403 | 403 |
| 404 | The specified block has not been found on the specific blockchain. |
| 409 | The data provided seems to be invalid. |
| 415 | The selected Media Type is unavailable. The Content-Type header should be 'application/json'. |
| 422 | Your request body for POST requests must have a structure of { data: { item: [...properties] } } |
| 429 | The request limit has been reached. There can be maximum {requests} requests per {seconds} second(s) made. Please contact our team via email if you need more or upgrade your plan. |
| 500 | An unexpected server error has occurred, we are working to fix this. Please try again later and in case it occurs again please report it to our team via email. |

### Example 200 response

```json
{
  "apiVersion": "2024-12-12",
  "requestId": "601c1710034ed6d407996b30",
  "context": "yourExampleString",
  "data": {
    "item": {
      "hash": "0x6b1fdd6357845016fb238d1bd58992a01b01c94e668f55e9502d65f0a50ac021",
      "height": 234324,
      "previousBlockHash": "0x45ec99037b9098f402ab83fa962ba54c11b6e5e5d3a981961e0784e8edf6f2a0",
      "size": 1408113,
      "timestamp": 1681893875,
      "transactionsCount": 23432,
      "extraData": "0x45ec99037b9098f402ab83fa962ba54c11b6e5e5d3a981961e0784e8edf6f2a0",
      "gasLimit": 12499653,
      "gasUsed": 12488144,
      "minedInSeconds": 7,
      "nonce": 2113101077,
      "totalDifficulty": 4794080996481072
    }
  }
}
```

### 200 response fields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `apiVersion` | string | yes | Specifies the version of the API that incorporates this endpoint. |
| `requestId` | string | yes | Defines the ID of the request. The `requestId` is generated by Crypto APIs and it's unique for every request. |
| `context` | string | no | In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. `context` is specified by the user. |
| `data` | object | yes |  |
| `data.item` | object | yes |  |
| `data.item.hash` | string | yes | Represents the hash of the block, which is its unique identifier. It represents a cryptographic digital fingerprint made by hashing the block header twice through the SHA256 algorithm. |
| `data.item.height` | integer | yes | Represents the number of blocks in the blockchain preceding this specific block. Block numbers have no gaps. A blockchain usually starts with block 0 called the "Genesis block". |
| `data.item.previousBlockHash` | string | yes | Represents the hash of the previous block, also known as the parent block. |
| `data.item.size` | integer | yes | Represents the total size of the block in Bytes. |
| `data.item.timestamp` | integer | yes | Defines the exact date/time when this block was mined in Unix Timestamp. |
| `data.item.transactionsCount` | integer | yes | Represents the total number of all transactions as part of this block. |
| `data.item.extraData` | string | yes | Numeric representation of the block extra data |
| `data.item.gasLimit` | integer | yes | Defines the total gas limit of all transactions in the block. |
| `data.item.gasUsed` | integer | yes | Represents the total amount of gas used by all transactions in this block. |
| `data.item.minedInSeconds` | integer | yes | Numeric representation of the block gas limit |
| `data.item.nonce` | integer | yes | Represents a random value that can be adjusted to satisfy the proof of work |
| `data.item.totalDifficulty` | integer | yes | Defines the total difficulty of the chain until this block, i.e. how difficult it is for a specific miner to mine a new block. |
