Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter devworlds

    (@devworlds)

    after 4 days still i don’t get response.

    Hi @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/

    Hope this helps!

    Thread Starter devworlds

    (@devworlds)

    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

    Hello @devworlds

    Kindly keep in mind we are not developers and only offer support for existing functionality.

    Please see our Support Policy: https://www.woocommerce.com/support-policy/

    For assistance with customization or development with your site, we recommend that you seek help from:

    If you are comfortable coding yourself and have questions, I would also recommend that you consider:

    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.