Title: Getting error from API
Last modified: May 30, 2023

---

# Getting error from API

 *  Resolved [devworlds](https://wordpress.org/support/users/devworlds/)
 * (@devworlds)
 * [3 years ago](https://wordpress.org/support/topic/getting-error-from-api/)
 * Hi,
 * i’m trying to get my product data by api, by filtering. like below,
 * [https://mydomin.com/wc-api/v3/products?consumer_key=xxxx&consumer_secret=xxxx&brand=apple&model=12%20pro&storage=256&color=silver&limit=2](https://mydomin.com/wc-api/v3/products?consumer_key=xxxx&consumer_secret=xxxx&brand=apple&model=12%20pro&storage=256&color=silver&limit=2)
 * i’m not getting information.
 * how can i get this correct one, please help me.
 * thank you

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [devworlds](https://wordpress.org/support/users/devworlds/)
 * (@devworlds)
 * [3 years ago](https://wordpress.org/support/topic/getting-error-from-api/#post-16791110)
 * after 4 days still i don’t get response.
 *  [xue28 (woo-hc)](https://wordpress.org/support/users/xue28/)
 * (@xue28)
 * [3 years ago](https://wordpress.org/support/topic/getting-error-from-api/#post-16796362)
 * Hi [@devworlds](https://wordpress.org/support/users/devworlds/)
 * Thanks for reaching out!
 * I understand that you’re trying to retrieve your product data using the WooCommerce
   API with specific filters.
 * Based on the URL you provided, it seems like you are using the WooCommerce API
   version 3. However, I would recommend using the latest version of the WooCommerce
   REST API, which is version 2. You can update the URL to use the latest API version
   like this:
 * `https://mydomain.com/wp-json/wc/v2/products`
 * Regarding the filter parameters, the WooCommerce API doesn’t support filtering
   products by custom attributes like brand, model, storage, and color directly 
   in the URL. Instead, you can use the search parameter to search for specific 
   keywords. Here’s an example:
 * `https://mydomain.com/wp-json/wc/v2/products?consumer_key=xxxx&consumer_secret
   =xxxx&search=apple%2012%20pro%20256%20silver&per_page=2`
 * This will search for products that contain the keywords “apple”, “12 pro”, “256”,
   and “silver”. However, this method might not always return the exact results 
   you’re looking for, as it searches for these keywords in various product fields.
 * To achieve more accurate filtering, you can fetch all the products and then filter
   the results programmatically using your preferred programming language. For example,
   you can fetch all the products using the API and then loop through the products
   to find the ones that match your criteria (brand, model, storage, and color).
 * For more information, please check the support documentation for Woo REST API
   here: [https://woocommerce.github.io/woocommerce-rest-api-docs/](https://woocommerce.github.io/woocommerce-rest-api-docs/)
 * Hope this helps!
 *  Thread Starter [devworlds](https://wordpress.org/support/users/devworlds/)
 * (@devworlds)
 * [3 years ago](https://wordpress.org/support/topic/getting-error-from-api/#post-16800950)
 * Hi,
 * Thank you for your response. the thing are ok what you show me.
 * But actually i want it by product meta (or category whatever) Example below.
 * like my product attributes have Brand name, model name, color name, storage capacity
   ETC.
 * i want to filter actual product like — pa_brand_name=apple&pa_model_name=12 pro&
   pa_color=silver
 * so only selected product will show in api url.
 * I’m not sure is there any other way have or not. If have please Help Me with 
   this.
 * Thank you
 *  [anastas10s](https://wordpress.org/support/users/anastas10s/)
 * (@anastas10s)
 * [2 years, 12 months ago](https://wordpress.org/support/topic/getting-error-from-api/#post-16811338)
 * Hello [@devworlds](https://wordpress.org/support/users/devworlds/)
 * Kindly keep in mind we are not developers and only offer support for existing
   functionality.
 * Please see our Support Policy: [http://www.woocommerce.com/support-policy/](http://www.woocommerce.com/support-policy/)
 * For assistance with customization or development with your site, we recommend
   that you seek help from:
    - A local web developer
    - [Codeable.io](https://woocommerce.com/codeable/)
    - [WooExperts](https://woocommerce.com/experts/)
    - [Stackexchange](http://wordpress.stackexchange.com/help/on-topic)
 * If you are comfortable coding yourself and have questions, I would also recommend
   that you consider:
    - [WooCommerce developer Portal](https://developer.woocommerce.com/)
    - [WooCommerce Slack Community](https://woocommerceslack.herokuapp.com/)
    - [Advanced WooCommerce Facebook group](https://www.facebook.com/groups/advanced.woocommerce)
 * I hope that helps you to figure it out.
 * Nevertheless, I will leave this thread open a bit longer, for a member of the
   community might want to chime in.
 * Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Getting error from API’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

## Tags

 * [api](https://wordpress.org/support/topic-tag/api/)
 * [js](https://wordpress.org/support/topic-tag/js/)

 * 4 replies
 * 3 participants
 * Last reply from: [anastas10s](https://wordpress.org/support/users/anastas10s/)
 * Last activity: [2 years, 12 months ago](https://wordpress.org/support/topic/getting-error-from-api/#post-16811338)
 * Status: resolved