{"library":"paapi5-typescript-sdk","title":"Amazon Product Advertising API 5.0 TypeScript SDK","description":"The `paapi5-typescript-sdk` is an unofficial TypeScript SDK designed for interacting with Amazon's Product Advertising API 5.0. As of its latest release, v0.2.0, it provides a comprehensive set of classes and types for constructing and sending requests such as `SearchItemsRequest`, `GetItemsRequest`, and `GetBrowseNodesRequest`. The library internally handles the AWS V4 signing process via the `SignHelper` class, abstracting away much of the authentication complexity. Being unofficial, its development and alignment with Amazon's API updates are dependent on the maintainer. It ships with full TypeScript types, making it ideal for type-safe Node.js environments. This SDK simplifies interaction with PAAPI 5.0, which migrated from XML to JSON responses and deprecated PAAPI 4.0 in 2020. While Amazon provides official SDKs for other languages like Python, this TypeScript version fills a gap for Node.js developers seeking a type-safe interface.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install paapi5-typescript-sdk"],"cli":null},"imports":["import * as SDK from 'paapi5-typescript-sdk';","import { SignHelper, Region, HttpMethod } from 'paapi5-typescript-sdk';","import { GetItemsRequest, PartnerType, Host } from 'paapi5-typescript-sdk';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { GetItemsRequest, PartnerType, Host, Region } from 'paapi5-typescript-sdk';\n\nasync function fetchAmazonProductDetails(asin: string) {\n  const partnerTag = process.env.PA_API_PARTNER_TAG ?? 'YOUR_PARTNER_TAG';\n  const accessKey = process.env.PA_API_ACCESS_KEY ?? 'YOUR_ACCESS_KEY';\n  const secretKey = process.env.PA_API_SECRET_KEY ?? 'YOUR_SECRET_KEY';\n\n  // Ensure you use the correct Host and Region for your desired marketplace\n  // e.g., Host.UnitedStates and Region.UNITED_STATES for amazon.com\n  const request = new GetItemsRequest(\n    {\n      ItemIds: [asin],\n      Resources: [\n        'Images.Primary.Large',\n        'ItemInfo.Title',\n        'Offers.Listings.Price'\n      ],\n    },\n    partnerTag,\n    PartnerType.ASSOCIATES,\n    accessKey,\n    secretKey,\n    Host.Italy, // Example: Using Italy. Change as needed.\n    Region.ITALY  // Example: Using Italy. Change as needed.\n  );\n\n  try {\n    const data = await request.send();\n    console.log(`Successfully fetched details for ASIN ${asin}:`);\n    console.log(JSON.stringify(data, null, 2));\n    return data;\n  } catch (error) {\n    console.error(`Error fetching details for ASIN ${asin}:`, error);\n    throw error;\n  }\n}\n\n// Example usage (replace with a real ASIN from amazon.it if using Italy locale)\n// Make sure to set PA_API_PARTNER_TAG, PA_API_ACCESS_KEY, PA_API_SECRET_KEY\n// in your environment variables or replace the placeholders.\nfetchAmazonProductDetails('B07WGNF455')\n  .then(() => console.log('Product fetch complete.'))\n  .catch(() => console.error('Failed to fetch product.'));","lang":"typescript","description":"This quickstart demonstrates how to instantiate and send a `GetItemsRequest` to Amazon's Product Advertising API 5.0, fetching product details by ASIN.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}