Lark Bitable
Free during beta

Lark Bitable Integration Guide

Wire Tariffin AI classification + 13-country tariffs + landed cost into your Lark Bitable in 10 minutes — no code, no backend. This guide uses Lark’s native Automation feature, all configuration happens inside Lark.

1. How it works

Tariffin exposes a webhook at https://tariffin.com/api/lark/classify. It takes a product description + destination country and returns HS code, tariff rate, and landed cost. Lark Bitable’s Automation feature can watch a column, POST to the webhook, and write the response back into other columns.

01

Add input columns (product name, destination) to your Bitable

02

Add output columns (HS code, MFN rate, landed cost, ...)

03

Configure an Automation: on product-name fill → POST to Tariffin webhook

04

Map JSON response back to the output columns. Done.

Free during beta: 60 calls/min per API key, no monthly cap. Comfortable for any small-to-mid team.

2. Prerequisites (5 min)

Step 1

Sign up on Tariffin and issue an API key

Open Dashboard → API keys, click “Issue new key”, name it (e.g. “Lark Bitable”), and copy the full key — format tfk_xxxxxxxx.... It is shown only once.

Step 2

Create or open a Lark Bitable

Lark workspace → Bitable → New table, or open an existing one. We recommend wiring up a test sheet first before moving to production.

3. Set up your fields

Add 8 fields. The first 4 are inputs you fill, the last 4 will be auto-populated (leave them empty for now).

FieldTypeRequiredPurpose
Product
↓ 输入 in
Multi-line textAny language
Destination
↓ 输入 in
Single-select (US/CN/EU/...)ISO-2 code
Declared Value (USD)
↓ 输入 in
NumberDefault 1000
Origin
↓ 输入 in
Single-selectFor FTA logic, optional
HS Code
↑ 输出 out
TextAuto-filled, 6-10 digits
MFN Rate
↑ 输出 out
Number (%)Auto-filled
Landed (USD)
↑ 输出 out
NumberAuto-filled
AI Reasoning
↑ 输出 out
Multi-line textAuto-filled

4. Configure the Automation

In your Bitable, click the ⚙️ Automation icon top-right → New flow → Start from blank.

Step 1

Trigger: when Product field is filled

  • Type: When record is modified
  • Watched fields: tick Product
  • Condition: changes from empty to non-empty
Step 2

Action: Send HTTP request

Add Action → Send HTTP request. Configure as below:

MethodPOST
URLhttps://tariffin.com/api/lark/classify
Header: AuthorizationBearer tfk_xxxxxxxxxxxxxxxxxxxx
Header: content-typeapplication/json
Body formatJSON

Request body — replace {{Field}}with Lark’s field reference (right panel lets you click to insert):

{
  "product_name": "{{Product}}",
  "destination": "{{Destination}}",
  "declared_value_usd": {{Declared Value (USD)}},
  "origin": "{{Origin}}"
}
Critical: the Authorization header must read Bearer (with the trailing space) followed by your full tfk_... key. Missing or malformed → HTTP 401.
Step 3

Map the JSON response back to fields

Lark fieldJSON pathNote
HS Code$.hs_code6-10 chars
MFN Rate$.mfn_rate0.024 = 2.4%
Landed (USD)$.landed_cost_usdNumber
AI Reasoning$.reasoningLocalized text
Other useful response fields: description_en/zh, confidence (0-1), source_url (official tariff source). See section 6 for the full schema.
Step 4

Enable and test

Toggle the flow to “Enabled”. Back in the table, add a new row, fill Product (e.g. “Portable bluetooth speaker”) and Destination (US), save. 5-10 seconds later the 4 output columns will populate.

Debugging: Lark’s Automation > Run history shows the actual request body and response for every execution — invaluable when something doesn’t fire.

5. Request format

POST https://tariffin.com/api/lark/classify

Headers

Authorization: Bearer tfk_xxxxxxxxxxxxxxxxxxxxxxxx
content-type: application/json

Body fields

FieldTypeRequiredDefaultNotes
product_namestringProduct description, 2-2000 chars, any language
destinationstringISO-2 country code: US/CN/EU/UK/JP/KR/IN/AU/CA/MX/BR/VN/TH
declared_value_usdnumber100Declared value (USD), used for landed cost
originstringCountry-of-origin ISO code, affects FTA rates, optional

Full example

curl -X POST https://tariffin.com/api/lark/classify \
  -H "Authorization: Bearer tfk_xxxxxxxxxxxxxxxxxxxx" \
  -H "content-type: application/json" \
  -d '{
    "product_name": "Portable bluetooth speaker, plastic, USB-C, 5W",
    "destination": "US",
    "declared_value_usd": 1000,
    "origin": "CN"
  }'

6. Response format

FieldTypeDescription
hs_codestringHS code, 6-10 digits
description_enstringHS code English description
description_zhstringHS code Chinese description
confidencenumberAI classification confidence, 0-1
reasoningstringAI reasoning trace, localized
mfn_ratenumber / nullMFN rate, 0.024 = 2.4% (null = data not yet available)
full_codestring / nullCountry-specific full tariff code (e.g. US HTS 10-digit)
sourcestring / nullSource authority: USITC, CBIC, EU-TARIC, etc.
source_urlstring / nullOfficial source URL — click to verify
landed_cost_usdnumber / nullLanded cost (USD)
landed_cost_localnumber / nullLanded cost in destination local currency
currencystring / nullLocal currency code, e.g. CNY/EUR/JPY
effective_rate_percentnumber / nullEffective total tax burden percent
detected_languagestringDetected input language, e.g. zh / en
providerstringUnderlying AI provider (deepseek)
latency_msnumberCall latency, milliseconds

Sample response

{
  "hs_code": "851829",
  "description_en": "Other loudspeakers, single",
  "description_zh": "其他扬声器,单声道",
  "confidence": 0.92,
  "reasoning": "Portable bluetooth speaker with plastic housing, USB-C, 5W → HS 8518.29.",
  "mfn_rate": 0.024,
  "full_code": "8518.29.80",
  "source": "USITC HTS",
  "source_url": "https://hts.usitc.gov/?query=8518.29",
  "landed_cost_usd": 1117.6,
  "landed_cost_local": 1117.6,
  "currency": "USD",
  "effective_rate_percent": 2.4,
  "detected_language": "en",
  "provider": "deepseek",
  "latency_ms": 1843
}

7. Error codes & troubleshooting

HTTPerrorCause & fix
400invalid_requestBody malformed. Check JSON validity, field names, numeric types
400unsupported_destinationDestination not in the 13 supported countries. See supported array in response
401unauthorizedAuthorization header missing or key wrong. Verify Bearer prefix + full tfk_... key
429rate_limitedOver 60/min. Honor retry-after header, then retry
500Server error, usually LLM upstream blip. Retry typically resolves
Key compromised? Open Dashboard → API keys and revoke it (all calls using it stop immediately), then issue a fresh key and swap it into your Lark Automation header.

8. Common patterns

8.1 Compare across multiple destinations

Want to compare the same product across all 13 countries? Use Lark’s linked-table feature: main table = products, child table = product × destination (13 rows per product). The Automation fires per child row, so each call hits exactly one country — faster and easier to debug.

8.2 Backfilling a large existing table

Already have 1,000 rows to classify? Temporarily switch the Automation trigger to “Scheduled — every day at 8 AM, fill empty HS Code fields”. Note the 60/min limit — 1,000 rows takes ~17 minutes.

8.3 Multiple teammates / use cases

Issue a separate API key per teammate or use case (name them descriptively in the dashboard, e.g. “alice-prod”, “bob-test”). Benefits:

  • Per-key usage stats and last-used timestamps
  • Revoke a single key when someone leaves — others unaffected
  • Rate limits bucketed per key, so they don’t compete

8.4 Use the webhook outside Lark

The endpoint is a plain REST API. Any HTTP-capable tool works: Python requests, n8n, Zapier, shell scripts — just include the Bearer token.

8.5 In-app test

Before wiring up Automation, fire one sample request from Dashboard → Lark integration → Webhook test to confirm your account’s key works end-to-end.

9. FAQ

Does Lark Automation have call limits?

Lark itself caps automation runs (free plan: 100/month; paid plans: more). That's Lark-side, not Tariffin. For higher volume, upgrade Lark or call the webhook from a Lark Script (scripts don't count against automation runs).

Can I batch multiple products in one call?

The webhook is single-product per call today. For batch, configure Lark to fire per-row, or loop in your own script (mind the 60/min limit).

mfn_rate is null — what now?

Tariffin doesn't yet have a tariff record for that HS × country (often happens with rare HS codes or smaller countries). Verify against the official source URL in the response, if present.

How accurate is the AI classification?

92%+ top-3 accuracy on a benchmark of 5,000 real customs declarations. Mark records with confidence < 0.7 for human review — Lark Automation can branch on this directly.

How fresh is the tariff data?

USITC/CBP, GACC, EU TARIC, India CBIC, Japan customs — crawled daily. Smaller sources weekly. Every record has a verified_at timestamp and source_url for verification.

Ready to wire it up?

Issue a key, run the in-app test, and you’ll have a working pipeline in 5 minutes.