Skip to main content
view 属性控制每条结果的 data 对象中出现哪些存储字段。

view 可以取哪些值

默认值是 id_only。当应用需要记录详情时请显式设置 view,否则只会收到标识符而非描述性字段。

summary 视图包含什么

公司 summary 返回 14 个字段:namesloganindustryheadquarters_locationheadquarters_country_codeoffices_citiescompany_size_fromcompany_size_toemployees_in_linkedinlinkedin_followerswebsitedomainurllogo 人物 summary 返回 11 个字段:namecurrent_titlecurrent_company_namecurrent_company_industrylocationcitycountry_codefollowersconnectionsurlavatar 记录中没有值的字段会从 data 中省略,而不是返回 null,因此同一请求返回的两条记录可能带有不同的键。

full 视图包含什么

full 返回所有已发布字段。公司 full 在 14 个 summary 字段之外,还包括 aboutspecialtiesorganization_typefounded_yearheadquarters_cityoffices_country_codesalumni_countlinkedin_follower_to_employee_ratiofunding_stagefunding_raisedinvestor_namessimilar_company_idsaffiliated_company_idscrunchbase_idimagelinkedin_id 人物 full 在 11 个 summary 字段之外,还包括 first_nameaboutrecommendations_countinfluencerpatent_countcurrent_tenure_monthsexperience_yearspast_job_titlespast_company_namespast_company_idseducation_schoolseducation_detailscertification_nameslanguagescurrent_company_idcurrent_company_specialtiescurrent_company_country_codecurrent_company_size_fromcurrent_company_size_tocurrent_company_funding_stagecurrent_company_funding_raisedsimilar_profile_idsalso_viewed_idslinkedin_num_idlinkedin_person_id fields 列表可以指定其中任意字段。记录中没有值的字段会被省略,因此一条 full 记录携带的键通常少于上述列表。

如何请求自定义字段列表

当应用需要特定字段集合时,请使用自定义字段列表,例如 summary 视图未包含的公司字段 founded_year
更短的字段列表能让响应更小,也让 Business Search 与存储结构之间的约定更明确。只在真正开始存储某个字段时才把它加入列表。

代码应如何处理返回的 data 对象

以下四条规则可以让解析逻辑在各种记录下保持稳定:
  • 只有当数据源对该记录存有值时,所请求的字段才会出现。
  • 处理空值或 null 时不要让整条记录失败。
  • 未知或未发布的字段名会返回 HTTP 400 view: unknown field(s): not_a_released_field,未知的视图名会返回 view: unknown view profile "bogus_view"。新字段名只需验证一次,不必每次请求都验证。
  • bright_id 这个信封字段与 data 中的实体字段区分开。bright_id 用于标识记录,不是公司或人物的属性。
选作输出的字段不会成为搜索条件。在 view 中请求 founded_year 不会排除没有成立年份记录的公司。