crm-lookup

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Source of truth

权威来源

hubspot <command> --help
is authoritative. Read
bulk-operations/SKILL.md
first — it owns JSONL piping, pagination, batch-get-via-stdin, and the safety flow for any write that comes after a lookup. This skill is read-only.
hubspot <command> --help
是权威参考。请先阅读
bulk-operations/SKILL.md
— 该文档涵盖了JSONL管道传输、分页、通过标准输入批量获取数据,以及查找后任何写入操作的安全流程。本技能为只读类型。

Pick properties from the live schema

从实时架构中选择属性

Schemas drift. Run
hubspot properties list --type <type>
for the live set. First-pass
--properties
for a brief:
Object
--properties
contacts
email,firstname,lastname,company,phone,lifecyclestage,hubspot_owner_id
companies
name,domain,industry,annualrevenue,numberofemployees,hubspot_owner_id
deals
dealname,amount,dealstage,closedate,hubspot_owner_id,hs_is_closed_won
tickets
subject,hs_pipeline_stage,hs_ticket_priority,hubspot_owner_id
Contact ad/campaign attribution lives on
hs_analytics_*
(e.g.
hs_analytics_source
,
hs_analytics_source_data_1
/
_2
,
hs_analytics_first_touch_converting_campaign
,
hs_analytics_last_touch_converting_campaign
). Full list:
hubspot properties list --type contacts | grep hs_analytics_
.
架构会随时间变化。运行
hubspot properties list --type <type>
获取实时属性集合。以下是首次使用时可选用的精简
--properties
参数:
对象
--properties
参数
联系人
email,firstname,lastname,company,phone,lifecyclestage,hubspot_owner_id
公司
name,domain,industry,annualrevenue,numberofemployees,hubspot_owner_id
交易
dealname,amount,dealstage,closedate,hubspot_owner_id,hs_is_closed_won
工单
subject,hs_pipeline_stage,hs_ticket_priority,hubspot_owner_id
联系人的广告/营销归因信息存储在
hs_analytics_*
属性中(例如
hs_analytics_source
hs_analytics_source_data_1
/
_2
hs_analytics_first_touch_converting_campaign
hs_analytics_last_touch_converting_campaign
)。完整列表可通过以下命令查看:
hubspot properties list --type contacts | grep hs_analytics_

1. Lookup by ID

1. 通过ID查找

Up to ~100 IDs in a single batch call:
bash
hubspot objects get --type contacts 12345 67890 23456 --properties email,firstname,lastname,company,phone,lifecyclestage
单次批量调用最多可查询约100个ID:
bash
hubspot objects get --type contacts 12345 67890 23456 --properties email,firstname,lastname,company,phone,lifecyclestage

2. Find one by email / domain (exact match)

2. 通过邮箱/域名查找(精确匹配)

email
/
domain
are exact-match — normalize to lowercase. Multiple
--filter
flags are OR'd.
bash
hubspot objects search --type contacts --filter "email=jane@acme.com" \
  --properties email,firstname,lastname,company,lifecyclestage,hubspot_owner_id

hubspot objects search --type companies --filter "domain=acme.com" \
  --properties name,domain,industry,annualrevenue,hubspot_owner_id
email
/
domain
为精确匹配 — 需统一转换为小写。多个
--filter
参数为逻辑或关系。
bash
hubspot objects search --type contacts --filter "email=jane@acme.com" \
  --properties email,firstname,lastname,company,lifecyclestage,hubspot_owner_id

hubspot objects search --type companies --filter "domain=acme.com" \
  --properties name,domain,industry,annualrevenue,hubspot_owner_id

OR — multiple emails in one call

或 — 单次调用查询多个邮箱

hubspot objects search --type contacts
--filter "email=alice@acme.com" --filter "email=bob@acme.com" --properties email,firstname
undefined
hubspot objects search --type contacts
--filter "email=alice@acme.com" --filter "email=bob@acme.com" --properties email,firstname
undefined

3. Find by partial name (token + client-side narrowing)

3. 通过部分名称查找(令牌匹配 + 客户端筛选)

~
is CONTAINS_TOKEN — matches whole space-separated words.
dealname~acme
finds "Acme Renewal" but not "AcmeCorp". For substring, pipe to
jq
. There's no full-text search across all fields — pick the property.
bash
hubspot objects search --type deals --filter "dealname~acme" --properties dealname,amount,dealstage \
| jq -c 'select(.properties.dealname | ascii_downcase | contains("acme corp"))'
~
表示包含令牌 — 匹配空格分隔的完整单词。
dealname~acme
会匹配“Acme Renewal”,但不会匹配“AcmeCorp”。如需子字符串匹配,可将结果管道传输至
jq
。目前不支持跨所有字段的全文搜索 — 需指定具体属性。
bash
hubspot objects search --type deals --filter "dealname~acme" --properties dealname,amount,dealstage \
| jq -c 'select(.properties.dealname | ascii_downcase | contains("acme corp"))'

4. Find all associated records (two CLI calls, not xargs)

4. 查找所有关联记录(两次CLI调用,无需xargs)

Pattern:
associations list
jq -c '{id}'
objects get
batch. Never
xargs -I{} hubspot objects get …
— that spawns one process per record. Use plural in
--from
(
contacts:
,
companies:
,
deals:
);
--help
shows singular but only plural avoids a warning.
bash
undefined
流程:
associations list
jq -c '{id}'
objects get
批量处理。切勿使用
xargs -I{} hubspot objects get …
— 这会为每条记录启动一个进程。在
--from
参数中使用复数形式
contacts:
companies:
deals:
);
--help
显示的是单数形式,但只有复数形式可避免警告。
bash
undefined

All contacts at a company

某公司的所有联系人

hubspot associations list --from companies:67890 --to contacts
| jq -c '{id}'
| hubspot objects get --type contacts --properties email,firstname,lastname,jobtitle
hubspot associations list --from companies:67890 --to contacts
| jq -c '{id}'
| hubspot objects get --type contacts --properties email,firstname,lastname,jobtitle

Open deals for a contact (filter client-side; "open" varies by pipeline)

某联系人的未结交易(客户端筛选;“未结”定义因管道而异)

hubspot associations list --from contacts:12345 --to deals | jq -c '{id}'
| hubspot objects get --type deals --properties dealname,amount,dealstage,hs_is_closed
| jq -c 'select(.properties.hs_is_closed != "true")'
undefined
hubspot associations list --from contacts:12345 --to deals | jq -c '{id}'
| hubspot objects get --type deals --properties dealname,amount,dealstage,hs_is_closed
| jq -c 'select(.properties.hs_is_closed != "true")'
undefined

5. Get a record plus its associations

5. 获取记录及其关联信息

bash
contact_id=12345
hubspot objects get --type contacts $contact_id --properties email,firstname,lastname,company,lifecyclestage
bash
contact_id=12345
hubspot objects get --type contacts $contact_id --properties email,firstname,lastname,company,lifecyclestage

Associated company (usually one)

关联公司(通常只有一个)

hubspot associations list --from contacts:$contact_id --to companies | jq -c '{id}' | head -1
| hubspot objects get --type companies --properties name,domain,industry,annualrevenue
hubspot associations list --from contacts:$contact_id --to companies | jq -c '{id}' | head -1
| hubspot objects get --type companies --properties name,domain,industry,annualrevenue

Associated deals

关联交易

hubspot associations list --from contacts:$contact_id --to deals | jq -c '{id}'
| hubspot objects get --type deals --properties dealname,amount,dealstage,closedate
undefined
hubspot associations list --from contacts:$contact_id --to deals | jq -c '{id}'
| hubspot objects get --type deals --properties dealname,amount,dealstage,closedate
undefined

Constraints

限制条件

  • Search returns ≤100 per page. For more, use the pagination loop in
    bulk-operations/SKILL.md
    .
  • ~
    is token-based; substring filtering happens in
    jq
    after the search.
  • If the lookup feeds a write (update, delete, merge), follow the
    --dry-run
    → digest →
    --confirm
    flow in
    bulk-operations/SKILL.md
    .
  • 搜索结果每页最多返回100条。如需更多结果,请使用
    bulk-operations/SKILL.md
    中的分页循环。
  • ~
    为令牌匹配;子字符串筛选需在搜索后通过
    jq
    完成。
  • 如果查找结果用于写入操作(更新、删除、合并),请遵循
    bulk-operations/SKILL.md
    中的
    --dry-run
    → 摘要 →
    --confirm
    流程。