> ## Documentation Index
> Fetch the complete documentation index at: https://developers.firmly.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Product from URL

> Extracts product information from a merchant's product page URL

Retrieves product information from a merchant's product detail page (PDP) URL. This endpoint extracts and returns the same detailed product data as the [Get a Product](/api-reference/catalog/get-product) endpoint.

## Query Parameters

<ParamField query="url" type="string" required>
  The full merchant product page URL. Can be plain or URL-encoded.

  Examples:

  * `https://staging.luma.gift/radiant-tee.html`
  * `https://staging.luma.gift/hero-hoodie.html?variant=123`

  <Note>
    If the URL contains query parameters, encode it with percent encoding according to HTTP standards.
  </Note>
</ParamField>

<ParamField query="postal_code" type="string">
  Postal code to customize pricing, inventory, or availability, based on location
</ParamField>

## Response

Returns the same [Product Details](/api-reference/catalog/get-product#response) structure as the Get a Product endpoint, including:

* Base product information
* Variants with pricing and availability
* Images and variant options
* Review information

## Expected Errors

<ResponseField name="ProductUrlNotImplemented" type="404">
  The merchant's platform doesn't support product extraction from URLs
</ResponseField>

<RequestExample>
  ```bash theme={null}
  # Plain URL
  curl --request GET \
    --url 'https://api.firmly.work/api/v1/domains-pdp?url=https://staging.luma.gift/radiant-tee.html' \
    --header 'x-firmly-authorization: YOUR_AUTH_TOKEN'

  # URL with query parameters (encoded)
  curl --request GET \
    --url 'https://api.firmly.work/api/v1/domains-pdp?url=https%3A%2F%2Fstaging.luma.gift%2Fhero-hoodie.html%3Fvariant%3D123' \
    --header 'x-firmly-authorization: YOUR_AUTH_TOKEN'
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "base_sku": "WS12",
    "title": "Radiant Tee",
    "handle": "radiant-tee",
    "description": "A comfortable and stylish tee perfect for any occasion",
    "product_type": "Tees",
    "images": [
      {
        "url": "https://cdn.staging.luma.gift/products/radiant-tee-main.jpg",
        "type": "default"
      }
    ],
    "variant_option_values": [
      {
        "display_name": "Size",
        "property_accessor": "size",
        "position": 0,
        "option_values": [
          {
            "display_name": "Medium",
            "value": "M",
            "available": true
          }
        ]
      }
    ],
    "variants": [
      {
        "handle": "radiant-tee-xs-orange",
        "sku": "WS12-XS-Orange",
        "title": "Radiant Tee - XS Orange",
        "display_name": "XS / Orange",
        "add_to_cart_ref": {
          "variant_id": "WS12-XS-Orange"
        },
        "price": {
          "currency": "USD",
          "value": 22.00,
          "number": 2200,
          "symbol": "$"
        },
        "available": true,
        "variant_option_list": ["XS", "Orange"]
      }
    ],
    "reviews": {
      "total_reviews": 127,
      "average_rating": 4.5
    }
  }
  ```
</ResponseExample>

## Use Cases

This endpoint is particularly useful for:

<CardGroup cols={2}>
  <Card title="Browser Extensions" icon="code">
    Extract product data when users browse merchant sites
  </Card>

  <Card title="Social Commerce" icon="link">
    Handle shared product links from social media
  </Card>

  <Card title="Universal Wishlists" icon="heart">
    Save products from any supported merchant
  </Card>

  <Card title="Price Tracking" icon="chart-simple">
    Monitor product prices across different stores
  </Card>
</CardGroup>

## Example: URL-Based Product Import

```javascript theme={null}
// User provides a product URL
const productUrl = 'https://staging.luma.gift/hero-hoodie.html';

// Fetch product details from URL
const response = await fetch(
  `https://api.firmly.work/api/v1/domains-pdp?url=${encodeURIComponent(productUrl)}`,
  {
    headers: {
      'x-firmly-authorization': authToken
    }
  }
);

const product = await response.json();

// Display product information
console.log(`Product: ${product.title}`);
console.log(`Price: ${product.variants[0].price.symbol}${product.variants[0].price.value}`);

// Add to cart using the variant_id
const variantId = product.variants[0].add_to_cart_ref.variant_id;
await addToCart(variantId);
```
