WbAnalytics icon

WbAnalytics

n8n node to interact with WB API

Overview

This node interacts with a search analytics API to generate detailed search reports for specified products and filters. It is designed to post a search report request that compares search data over two periods (current and past) and filters results by product IDs, subjects, brands, tags, and position clusters in search results.

Typical use cases include:

  • Monitoring how product search positions change over time.
  • Comparing search performance between two date ranges.
  • Filtering search analytics by specific product SKUs, brands, or categories.
  • Generating ranked lists of products based on average search position or other criteria.

For example, an e-commerce manager could use this node to analyze how the visibility of Adidas and Nike products changed from one week to another, focusing only on products ranked within the first 100 search results.

Properties

Name Meaning
Current Period The current date range for the report, specified as JSON with start and end dates. Example: { "start": "2024-02-10", "end": "2024-02-10" }.
Past Period The past date range for comparison, also JSON with start and end dates. Must be equal or shorter than the current period.
Nm Ids JSON array of Wildberries article numbers (product SKUs) to filter the report by specific products. Example: [162579635, 166699779].
Subject Ids JSON array of subject/category IDs to filter the report. Example: [32, 64].
Brand Names JSON array of brand names to filter the report. Example: ["Adidas", "Nike"].
Tag Ids JSON array of tag IDs to filter the report. Example: [3, 5, 6].
Position Cluster Filter products by their average search position cluster:
- all: all positions
- firstHundred: positions 1 to 100
- secondHundred: positions 101 to 200
- below: positions 201 and below
Order By JSON object specifying sorting parameters with fields:
- field: field name to sort by (e.g., "avgPosition")
- mode: sort direction ("asc" or "desc"). Example: { "field": "avgPosition", "mode": "asc" }
Limit Number of product groups to return in the response.
Offset Number of items to skip before starting to return data (for pagination).

Output

The node outputs JSON data representing the search report generated by the API. This includes grouped product search analytics filtered and sorted according to the input parameters. The exact structure depends on the API response but typically contains:

  • Product groups with aggregated search metrics.
  • Average search positions.
  • Comparison data between current and past periods.
  • Metadata about filtering and sorting applied.

No binary data output is indicated.

Dependencies

  • Requires access to the Wildberries Analytics API or equivalent service.
  • Needs an API key credential configured in n8n for authentication.
  • The base URL and endpoints are derived from a bundled OpenAPI specification.
  • Proper network connectivity to the API endpoint.

Troubleshooting

  • Invalid Date Ranges: Ensure pastPeriod is not longer than currentPeriod and dates are valid ISO strings.
  • Empty Results: Check filters like nmIds, brandNames, and positionCluster to ensure they match existing data.
  • Authentication Errors: Verify the API key credential is correctly set up and has necessary permissions.
  • Pagination Issues: Adjust limit and offset carefully to avoid missing data or empty pages.
  • JSON Parsing Errors: Input properties expecting JSON must be valid JSON strings; otherwise, parsing will fail.

Links and References

Discussion