Holiday Sale 30% OFF sitewide on all WordPress & WooCommerce plugins — use code Shop Now →
Back to all articles
API Troubleshooting Nov 30, 2026 7 min read
TECHRBUN // API TROUBLESHOOTING

How to Retrieve PrestaShop Products via API

Need to retrieve product information from your PrestaShop store? The PrestaShop API makes it easy to access product data programmatically, whether you’re building an integration, syncing inventory, or creating a custom storefront.

In this guide, you’ll learn how to retrieve PrestaShop products via API, including the key setup steps and how to make a request for product records. With a little configuration, you can access the data you need and put it to work in your application.

Prepare API access

Before making a request, you’ll need a valid route into your store and permission to read the data you want. I start by checking both in the back office; it saves time when a request later returns an access error or more data than the integration needs.

First, locate the webservice settings and confirm the API is enabled. The steps below cover where to find the connection details, then how to limit access to product data.

Find your API key and endpoint

Your API key identifies the connection, while the endpoint gives your request its starting address. I collect both before writing code so I can test the connection with a simple request.

In the back office, open Advanced Parameters > Webservice and enable the webservice if it is not already active. Add a key, or open an existing one, and copy it somewhere secure. Menu names can vary slightly by PrestaShop version.

Your base endpoint usually follows this pattern: https://your-store.example/api/. For example, to work with products, the resource URL is https://your-store.example/api/products. Use the store’s HTTPS address, and treat the key like a password. PrestaShop’s webservice documentation describes the API setup and request format.

With the address and key ready, the next step is to grant only the access your integration needs. This also helps keep the connection safer if its credentials are ever exposed.

Set permissions and choose product fields

A key can be restricted by resource and action, so there’s no need to give a product-reading script permission to change your catalog. I recommend starting with read-only access and expanding it only if the integration requires more.

In the key’s permissions, find the products resource and enable GET. Leave POST, PUT, and DELETE disabled unless your application must create, edit, or remove products. If you use several integrations, create a separate key for each one so you can revoke access independently.

Once access is set, choose the fields your request needs. A focused request can be easier to process than a full product record. For example, you can request selected fields with a display parameter:

/api/products?display=[id,name,price,reference]

For inventory syncing, you may also need quantity or associations, depending on your PrestaShop version and configuration. I test with a small field list first, then add fields as the application requires. This keeps responses manageable and makes it easier to spot missing permissions or unexpected values.

PrestaShop API retrieve products

With access configured, you can move from setup to a live request. I usually start with a small result set, check the response, and then add filters or pages as the integration needs them.

Send a GET request

A GET request reads records without changing your catalog. The example below asks for a few useful fields; replace the sample address and key with your own values.

PrestaShop’s webservice commonly returns XML by default. You can make the request with cURL, which sends the API key as the username and leaves the password blank:

curl -u "YOURAPIKEY:" "https://your-store.example/api/products?display=[id,name,price,reference]&limit=0,20"

The response contains the requested product fields. When I test a connection, I check the HTTP status and confirm that the result includes the expected IDs and values. A 401 or 403 response often points to a key or permission issue; a successful response with no products may mean the filters are too narrow. See the PrestaShop webservice documentation for details on request formats and supported options.

Retrieve products with filters and pagination

Once a basic request works, filters help narrow the results and pagination keeps larger catalogs manageable. You can combine these options in the same resource URL rather than downloading every record at once.

For example, this request returns active products, sorted by ID, with up to 20 results starting at offset 0:

curl -u "YOURAPIKEY:" "https://your-store.example/api/products?display=[id,name,price,reference]&filter[active]=[1]&sort=[idASC]&limit=0,20"

To fetch the next page, change the limit to 20,20, then 40,20. I keep requesting pages until the response contains fewer items than the page size, which is a practical signal that I’ve reached the end.

Common options include:

  • filter[active]=[1] to return active products.
  • filter[id]=[1,50] to request products within an ID range.
  • sort=[idASC] to keep results in a predictable order.
  • limit=0,20 to set the starting offset and page size.

When building a sync, I save the last processed ID or page position and handle each result before requesting more. That makes large imports easier to resume if a request fails partway through.

Work with product data

A successful response is only the start: the next step is making sure your application can interpret the values and use them safely. I check the response format first, then decide how each field should appear in the store.

Product responses can include nested values and language-specific fields, so a quick review can help you catch format or data issues before they affect a sync. Here’s how I handle the most common cases.

Handle responses and common errors

PrestaShop’s webservice commonly returns XML, so your application may need an XML parser before it can use the data. Depending on your PrestaShop version and configuration, JSON output may also be available; I confirm the supported format before building a parser around it.

When a request fails, I check the status code and response body rather than treating every problem as an empty result. These clues often point to the cause:

  • 401 or 403: check that the API key is correct and has GET permission for products.
  • 404: verify the store address and resource path, including the /api/ portion.
  • 5xx response: inspect the server response and try again later if the issue appears temporary.
  • Empty results: review filters, language settings, and pagination parameters.

I also log the request URL, status code, and a short error message, but never the API key. The PrestaShop webservice documentation is useful when checking response formats and available options.

Once the response is readable, think about where those values will go. Product names may vary by language, and prices or stock figures need context before they’re shown or used in another system.

Use retrieved product details in your store

For a storefront, I map only the fields the page needs, such as the product ID, name, reference, price, and image information. Keep the product ID as a stable identifier; names and references can change, so they’re less reliable for matching records during later updates.

Before displaying or syncing values, I check a few details:

  • Language: select the appropriate localized name and description.
  • Price: confirm the currency and tax treatment expected by the destination.
  • Availability: use the relevant stock data rather than assuming an active product is in stock.
  • Output safety: escape text before placing it into HTML, and avoid exposing internal fields unnecessarily.

For frequently viewed catalog data, a local cache can reduce repeated requests; refresh it on a schedule that suits how often your products change. I test with a few real records first, including a product with translated content or unusual pricing, before relying on the integration across the whole catalog.

Build a reliable product integration with PrestaShop

Retrieving products through the PrestaShop API is straightforward when access is configured carefully and requests are tailored to your needs. Use focused permissions, fetch records efficiently, and handle responses and errors thoughtfully to keep your integration secure and dependable.

Whether you’re syncing a catalog or powering a custom storefront, the PrestaShop API retrieve products workflow gives you a flexible way to put product data to work. Start with a small test, validate the results, and you’ll be ready to build with confidence.

Discussion

0 Comments

Leave a comment ↓

No comments yet. Share your thoughts or questions below.

Leave a Comment

Your email address will not be published. Required fields are marked *