# Package Dimension: Request

> Request parameters, credit cost and an example for the PACKAGE_DIMENSION operation of the Easyparser Real-Time API.

Source: https://docs.easyparser.com/real-time-integration/package-dimension/request

Send a GET request with `operation=PACKAGE_DIMENSION` to the Real-Time API. The operation takes a single product identifier, the `asin`.

## Endpoint

```http
GET https://realtime.easyparser.com/v1/request
```

## Required parameters

All parameters go in the query string. See [Common Request Fields](/real-time-integration/common-required-request-fields) for details on the shared parameters.

| Parameter | Type | Required | Description |
|---|---|---|---|
| `api_key` | string | Yes | Your API key, sent as a query parameter. Find it at [Account > Plan](https://app.easyparser.com/account/plan). |
| `platform` | string | Yes | Target platform. Allowed: `AMZ` (Amazon). |
| `operation` | string | Yes | Operation code in upper case. Allowed: `PACKAGE_DIMENSION`. |
| `domain` | string | Yes | Amazon marketplace, written with a leading dot, for example `.com`. See [Supported Marketplaces](/essentials/supported-marketplaces). |
| `asin` | string | Yes | Amazon product ID: 10 upper-case letters or digits, for example `B0CJB6V2L5`. |

## Optional parameters

This operation has no operation-specific optional parameters. It does not support address parameters (`address_id`, `zip_code`, `city`, `district`, `country_code`), `language` or `currency`. See [Address Management](/essentials/address-management) for the operations that do.

## Credit cost

Each successful request costs 1 credit. See [Credit Consumption](/essentials/credit-consumption).

## Example request

**cURL**

```bash
curl --get "https://realtime.easyparser.com/v1/request" \
  --data-urlencode "api_key=YOUR_API_KEY" \
  --data-urlencode "platform=AMZ" \
  --data-urlencode "operation=PACKAGE_DIMENSION" \
  --data-urlencode "domain=.com" \
  --data-urlencode "asin=B0CJB6V2L5"
```

**Python**

```python
import requests

params = {
    "api_key": "YOUR_API_KEY",
    "platform": "AMZ",
    "operation": "PACKAGE_DIMENSION",
    "domain": ".com",
    "asin": "B0CJB6V2L5",
}

response = requests.get("https://realtime.easyparser.com/v1/request", params=params)
print(response.json())
```

**Node.js**

```javascript
const params = new URLSearchParams({
  api_key: "YOUR_API_KEY",
  platform: "AMZ",
  operation: "PACKAGE_DIMENSION",
  domain: ".com",
  asin: "B0CJB6V2L5",
});

const response = await fetch(`https://realtime.easyparser.com/v1/request?${params}`);
const data = await response.json();
console.log(data);
```

**HTTP**

```http
GET /v1/request?api_key=YOUR_API_KEY&platform=AMZ&operation=PACKAGE_DIMENSION&domain=.com&asin=B0CJB6V2L5 HTTP/1.1
Host: realtime.easyparser.com
```

**PHP**

```php
<?php
$params = [
    'api_key' => 'YOUR_API_KEY',
    'platform' => 'AMZ',
    'operation' => 'PACKAGE_DIMENSION',
    'domain' => '.com',
    'asin' => 'B0CJB6V2L5',
];

$url = 'https://realtime.easyparser.com/v1/request?' . http_build_query($params);
$response = file_get_contents($url);
$data = json_decode($response, true);
print_r($data);
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"net/url"
)

func main() {
	params := url.Values{}
	params.Add("api_key", "YOUR_API_KEY")
	params.Add("platform", "AMZ")
	params.Add("operation", "PACKAGE_DIMENSION")
	params.Add("domain", ".com")
	params.Add("asin", "B0CJB6V2L5")

	resp, err := http.Get("https://realtime.easyparser.com/v1/request?" + params.Encode())
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	body, _ := io.ReadAll(resp.Body)
	fmt.Println(string(body))
}
```

**C#**

```csharp
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;

var parameters = new Dictionary<string, string>
{
    ["api_key"] = "YOUR_API_KEY",
    ["platform"] = "AMZ",
    ["operation"] = "PACKAGE_DIMENSION",
    ["domain"] = ".com",
    ["asin"] = "B0CJB6V2L5",
};

var query = string.Join("&", parameters.Select(p =>
    $"{Uri.EscapeDataString(p.Key)}={Uri.EscapeDataString(p.Value)}"));

using var client = new HttpClient();
var response = await client.GetStringAsync($"https://realtime.easyparser.com/v1/request?{query}");
Console.WriteLine(response);
```

**Java**

```java
import java.net.URI;
import java.net.URLEncoder;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.charset.StandardCharsets;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.stream.Collectors;

public class EasyparserRequest {
    public static void main(String[] args) throws Exception {
        Map<String, String> params = new LinkedHashMap<>();
        params.put("api_key", "YOUR_API_KEY");
        params.put("platform", "AMZ");
        params.put("operation", "PACKAGE_DIMENSION");
        params.put("domain", ".com");
        params.put("asin", "B0CJB6V2L5");

        String query = params.entrySet().stream()
            .map(e -> URLEncoder.encode(e.getKey(), StandardCharsets.UTF_8) + "="
                + URLEncoder.encode(e.getValue(), StandardCharsets.UTF_8))
            .collect(Collectors.joining("&"));

        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://realtime.easyparser.com/v1/request?" + query))
            .GET()
            .build();

        HttpResponse<String> response = HttpClient.newHttpClient()
            .send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.body());
    }
}
```

## Notes

- Units depend on the marketplace. `.com` returns inches and pounds; EU marketplaces return centimeters and kilograms. Always read the `unit` field of each measurement instead of assuming a unit.
- To get dimensions for many ASINs in one job, use the [Bulk API](/bulk-integration/bulk-service-request) with the `asins` payload key.
