TianAPI Barcode Lookup for Openclaw

Openclaw Skills for TianAPI barcode lookup converts a product barcode into structured product metadata in seconds.

workxin
v1.0.0
Jul 13, 2026
0
376
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install tianapi-barcode

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install tianapi-barcode using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is TianAPI Barcode Lookup?

Openclaw Skills for TianAPI barcode lookup provides a lightweight, developer-friendly way to resolve a product barcode into structured commerce metadata. Given a valid TianAPI key, the skill calls scripts/fetch_barcode.py or the TianAPI barcode/index endpoint and returns product name, barcode, brand, spec, goods type, manufacturer, and a time-limited product image URL.

This Openclaw Skills workflow is ideal when you need fast product enrichment, barcode validation, or catalog QA without building a custom lookup service. It keeps the implementation simple: provide a barcode, get normalized output, and use the documented error codes to handle quota, permission, parameter, and network issues.

TianAPI Barcode Lookup Use Cases

  • Enrich e-commerce catalogs with barcode-derived brand, spec, manufacturer, and category data.
  • Verify scanned items in retail, warehouse, or receiving workflows.
  • Research unknown products during customer support or merchandising tasks.
  • QA barcode-to-SKU mappings and spot catalog data mismatches.
  • Build automation scripts that need quick product master-data lookups.

How TianAPI Barcode Lookup Works

  1. Capture the product barcode, typically a 13-digit number, and make sure you have a TianAPI barcode API key.
  2. Configure the key through TIANAPI_BARCODE_KEY, a local scripts/.env file, or a one-off CLI argument.
  3. Run scripts/fetch_barcode.py or call the TianAPI barcode/index endpoint directly.
  4. Send the barcode to TianAPI and wait for the JSON response.
  5. Render the resolved fields such as name, brand, spec, goods type, firm name, and goods image.
  6. If the lookup fails, inspect the API error code or retry after a network timeout.

TianAPI Barcode Lookup Setup

  1. Confirm that Python 3 is installed.
python3 --version
  1. Register on TianAPI, open the barcode lookup API page, and request access to obtain your API key.

  2. Configure the key in one of the documented ways. The skill uses TIANAPI_BARCODE_KEY as its primary environment variable, and the docs also show inline key injection for one-off runs.

export TIANAPI_BARCODE_KEY=your_api_key
echo 'TIANAPI_BARCODE_KEY=your_api_key' > scripts/.env
  1. Run the lookup script with your key and barcode.
python3 scripts/fetch_barcode.py <API_KEY> --barcode 6976586902578
  1. If you want to test the API directly, use the HTTP endpoint without the wrapper.
GET https://apis.tianapi.com/barcode/index?key=YOUR_API_KEY&barcode=6976586902578

TianAPI Barcode Lookup Data Schema & Taxonomy

OpenClaw metadata

Key Value Purpose
emoji 🛒 Skill icon used in the package metadata
requires.bins python3 Runtime dependency required by the skill
requires.env TIANAPI_BARCODE_KEY Required secret source for TianAPI access
primaryEnv TIANAPI_BARCODE_KEY Default environment variable for the API key

Request schema

Field Type Required Description
key string yes TianAPI API key used to authenticate the lookup
barcode string yes Product barcode to query, typically 13 digits

Response schema

Field Meaning Example
name Product name 多种维生素 B 族片
barcode Product barcode 6976586902578
brand Brand name 贤健
spec Product specification 50克
goods_type Product category 营养补充剂
firm_name Manufacturer 安徽谊康堂健康科技有限公司
goods_pic Temporary product image URL https://api.tianapi.com/goodspic/?img=...

Error taxonomy

Code Meaning Recommended action
150 API quota is exhausted Purchase more usage in the TianAPI console
160 API has not been applied for Apply for the barcode API first
230 Invalid API key Recheck TIANAPI_BARCODE_KEY
240 Missing API key parameter Pass key correctly
250 Empty result Verify the barcode and catalog coverage
280 Missing barcode parameter Pass barcode correctly
network timeout Request did not complete Retry and check connectivity

Files and artifacts

  • scripts/fetch_barcode.py: CLI wrapper around the barcode lookup call.
  • scripts/.env: optional local configuration file created by the user for secret storage.
  • No persistent database or cache files are generated by default.
  • The returned goods_pic URL is temporary and documented as valid for 3 hours.

TianAPI Barcode Lookup Advanced Features

  • CLI wrapper plus direct HTTP endpoint support for both automation and troubleshooting.
  • Three key injection modes: persistent environment variable, scripts/.env, or one-off CLI key.
  • Structured TianAPI error-code handling for quota, authorization, parameter, and empty-data failures.
  • Time-limited product image URLs for fresh, non-stale media references.
  • Lightweight dependency footprint: only python3 plus a TianAPI key.
  • Easy to embed in commerce enrichment, barcode validation, and catalog QA pipelines.
  • Openclaw Skills packaging makes the capability reusable across projects and easy to invoke from other agents.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Requires
Bins python3
Github Stars: 0
forks: 0

Featured*