# Get Products — Barcode Lookup

> Retrieve products details by barcode, MPN, ASIN, or search terms. See the documentation

- Key: `barcode_lookup-get-products`
- Type: Action (Read-only)
- Version: 0.0.1
- App: Barcode Lookup (`barcode_lookup`) — https://pipedream.com/apps/barcode-lookup.md
- This page (HTML): https://pipedream.com/apps/barcode-lookup/actions/get-products
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/barcode_lookup/actions/get-products/get-products.mjs

## Description

Retrieve products details by barcode, MPN, ASIN, or search terms. [See the documentation](https://www.barcodelookup.com/api-documentation#endpoints)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `barcode` | `string` | No | Barcode to search, must be 7, 8, 10, 11, 12, 13 or 14 digits long, e.g. 865694301167 |
| `mpn` | `string` | No | Manufacturer Part Number of the product, i.e: LXCF9407 |
| `asin` | `string` | No | Amazon Standard Identification Number of the product, e.g. B079L4WR4T |
| `title` | `string` | No | Product title or name, e.g. Red Running Shoes |
| `category` | `string` | No | Category or type of the product, e.g. Home & Garden > Decor |
| `manufacturer` | `string` | No | Name of the product manufacturer, e.g. Samsung |
| `brand` | `string` | No | Brand associated with the product, e.g. Calvin Klein |
| `search` | `string` | No | General search term for products, e.g. Air Jordan Red Shoes Size 40 |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "barcode_lookup",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "barcode_lookup-get-products",
  arguments: {
    barcode: "Barcode",
    mpn: "MPN",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "barcode_lookup-get-products",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    barcode_lookup: { authProvisionId: "apn_xxxxxxx" },
    barcode: "Barcode",
    mpn: "MPN",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "barcode_lookup-get-products",
    "configured_props": {
      "barcode_lookup": { "authProvisionId": "apn_xxxxxxx" },
      "barcode": "Barcode",
      "mpn": "MPN"
    }
  }'
```

---

- App: https://pipedream.com/apps/barcode-lookup.md · All apps: https://pipedream.com/apps
