HARPA.AI
LIBRARYAPIGUIDESAI COMMANDSBLOG

๐Ÿ›๏ธย ย Quick WooCommerce Product JSON Generator

Convert any product page into WooCommerce JSON format with easy export/webhook options

Created by Najib HADDOUCHI
Updated on May 16, 16:04
Installed 1 time
SENDS HTTP REQUESTS

How to Use

IMPORT COMMAND

Content

- type: clear
- type: say
  message: >-
    # ๐Ÿ›๏ธ Quick WooCommerce Product JSON Generator

    ## Tips for best results: - Make sure you're on a product page with visible
    pricing - The script works best with standard e-commerce layouts - For
    webhooks, have your endpoint URL ready - The generated JSON follows
    WooCommerce import format - You can use this JSON in WooCommerce โ†’ Products
    โ†’ Import

    ## Features: โœ“ Automatic price detection โœ“ Image URL extraction โœ“ Product
    attributes parsing โœ“ Category/tag detection โœ“ Export to file or webhook
- type: ask
  param: product_url
  message: 'Paste a product URL or press Enter to use current page:'
  options:
    - label: โœ… USE CURRENT PAGE
      value: '{{url}}'
  default: '{{url}}'
- type: gpt
  prompt: >-
    Act as an e-commerce data extraction expert.

    TASK: Extract product information from the webpage and structure it
    according to WooCommerce JSON format.

    GUIDELINES: - Identify product name (title or H1) - Extract prices (regular
    and sale if available) - Get product description - Create short description
    (1-2 sentences) - Find product images - Collect specifications - Extract
    categories and tags

    OUTPUT FORMAT: Return only the following JSON structure: {
      "name": "Product name",
      "type": "simple",
      "regular_price": "Regular price (numeric)",
      "sale_price": "Sale price if available (numeric)", 
      "description": "Full description",
      "short_description": "Brief summary",
      "categories": ["Categories"],
      "tags": ["Tags"],
      "images": [{"src": "Image URL"}],
      "attributes": [
        {
          "name": "Attribute name",
          "options": ["Values"]
        }
      ]
    }

    PAGE TO ANALYZE: {{page}}

    Generate WooCommerce JSON:
  param: json_data
  isolated: true
- type: calc
  func: extract-json
  to: woo_json
  param: json_data
  index: ''
- type: say
  message: โœ… WooCommerce JSON successfully generated!
- type: ask
  param: action
  message: What would you like to do with the JSON?
  options:
    - label: ๐Ÿ“‹ VIEW JSON
      value: view
    - label: ๐Ÿ“ฆ EXPORT TO FILE
      value: export
    - label: ๐Ÿ”— SEND TO WEBHOOK
      value: webhook
    - label: โœ… FINISH
      value: done
- condition: '{{action}} = view'
  type: say
  message: |-
    ```json
    {{woo_json}}
    ```
- condition: '{{action}} = export'
  type: export
  what: param
  param: woo_json
  filename: woocommerce_product.json
- condition: '{{action}} = webhook'
  type: group
  steps:
    - type: say
      message: >-
        ๐Ÿ“Œ **Webhook Tips:** - Make sure your webhook endpoint accepts POST
        requests - The JSON will be sent in the request body - Content-Type will
        be application/json - Test your webhook URL before using it
    - type: ask
      param: webhook_url
      message: 'Enter your webhook URL:'
      options: null
      default: ''
    - type: request
      url: '{{webhook_url}}'
      method: POST
      headers:
        Content-Type: application/json
      body: '{{woo_json}}'
      auth:
        enabled: false
      param: response
    - type: say
      message: >-
        โœ… JSON sent to webhook successfully!

        You can now: - Import the product in WooCommerce - Check your webhook
        logs - Process the data on your server
- condition: '{{action}} != done'
  type: jump
  to: action
Notice: Please read before using

This automation command is created by a community member. HARPA AI team does not audit community commands.

Please review the command carefully and only install if you trust the creator.

Contact us
HomeUse CasesGuidesPrivacy PolicyTerms of Service
CAN WE STORE COOKIES?
Our website uses cookies for the purposes of accessibility and security. They also allow us to gather statistics in order to improve the website for you. More info: Privacy Policy