我正在进行一个网络抓取项目,以收集关于使用他们的名字和姓氏的雇员的信息。我想利用zoomInfo api来实现这一点。
我查看了这里的文档:https://api-docs.zoominfo.com/#7bad886b-b4a8-46cd-9a55-1725944f2cc2。
我的当前实现返回一个有效的jwt,但我不知道如何修改有效负载以执行联系人搜索。
import zi_api_auth_client
import requests
jwt_token = zi_api_auth_client.user_name_pwd_authentication("evan.gertis@netfoundry.io", "!z1UuiH^8920EaCEbX")
url = "https://api.zoominfo.com/lookup/inputfields/contact/search"
payload={}
headers = {
'Authorization': 'Bearer '+jwt_token
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
这会返回
/*
* 提示:该行代码过长,系统自动注释不进行高亮。一键复制会移除系统注释
* [{"fieldName":"personId","fieldType":"String","description":"Unique ZoomInfo identifier for the contact. Can include a comma-separated list."},{"fieldName":"emailAddress","fieldType":"String","description":"Work email address for the contact in example@example.com format"},{"fieldName":"hashedEmail","fieldType":"String","description":"Hashed email value for the contact. Allows searching via an email address with the extra security of not exposing the email. Supported hash algorithms are: MD5, SHA1, SHA256 and SHA512."},{"fieldName":"fullName","fieldType":"String","description":"Contact full name"},{"fieldName":"firstName","fieldType":"String","description":"Contact first name"},{"fieldName":"middleInitial","fieldType":"String","description":"Contact middle initial"},{"fieldName":"lastName","fieldType":"String","description":"Contact last name"},{"fieldName":"jobTitle","fieldType":"String","description":"Contact title at current place of employment. Use OR to input multiple job titles."},{"fieldName":"excludeJobTitle","fieldType":"String","description":"Exclude comma-separated list of job titles"},{"fieldName":"managementLevel","fieldType":"String","description":"Contact management level at current place of employment"},{"fieldName":"excludeManagementLevel","fieldType":"String","description":"Exclude comma separated list of management levels"},{"fieldName":"department","fieldType":"String","description":"Contact department at current place of employment"},{"fieldName":"boardMember","fieldType":"String","description":"Exclude or include board members from search results"},{"fieldName":"excludePartialProfiles","fieldType":"Boolean","description":"Contacts who do not have an active company associated with them are considered partial profiles. Exclude contacts with a partial profile from search results."},{"fieldName":"executivesOnly","fieldType":"Boolean","description":"Return only executives"},{"fieldName":"requiredFields","fieldType":"String","description":"Specify a list of required fields for each record returned. Can include email, phone, personalEmail, and mobilePhone. Can include a comma-separated list of these fields."},{"fieldName":"contactAccuracyScoreMin","fieldType":"String","description":"Minimum accuracy score for search results. This score indicates the likelihood that a contact is reachable and still employed by the company listed. Minimum score is 70 and maximum is 99."},{"fieldName":"contactAccuracyScoreMax","fieldType":"String","description":"Maximum accuracy score for search results. This score indicates the likelihood that a contact is reachable and still employed by the company listed. Minimum score is 70 and maximum is 99."},{"fieldName":"jobFunction","fieldType":"String","description":"Contact job function at their current place of employment"},{"fieldName":"lastUpdatedInMonths","fieldType":"Integer","description":"Number of months within which the contact's profile was last updated"},{"fieldName":"hasBeenNotified","fieldType":"String","description":"Contacts who have been notified of inclusion in ZoomInfo's database. Values are exclude, include, and only"},{"fieldName":"companyPastOrPresent","fieldType":"String","description":"Returns companies based on a contact's work history. Values are present (default), past, and pastAndPresent"},{"fieldName":"school","fieldType":"String","description":"Searches by contact's education"},{"fieldName":"degree","fieldType":"String","description":"Searches by contact's education"},{"fieldName":"locationCompanyId","fieldType":"ArrayList","description":"Searches by contact's locationIds"},{"fieldName":"companyId","fieldType":"String","description":"ZoomInfo unique identifier for the company. Will accept a comma-separated list."},{"fieldName":"companyName","fieldType":"String","description":"Company name"},{"fieldName":"companyWebsite","fieldType":"String","description":"Company domain"},{"fieldName":"companyTicker","fieldType":"ArrayList","description":"Company stock ticker symbol"},{"fieldName":"companyDescription","fieldType":"String","description":"Text description unique to the company you want to use as search criteria"},{"fieldName":"parentId","fieldType":"String","description":"ZoomInfo Company ID for parent company"},{"fieldName":"ultimateParentId","fieldType":"String","description":"ZoomInfo Company ID for ultimate parent company"},{"fieldName":"companyType","fieldType":"String","description":"Company type (private, public, and so on)"},{"fieldName":"address","fieldType":"String","description":"Company address"},{"fieldName":"street","fieldType":"String","description":"Company street"},{"fieldName":"state","fieldType":"String","description":"Company state"},{"fieldName":"zipCode","fieldType":"String","description":"Zip Code of the company's primary address"},{"fieldName":"country","fieldType":"String","description":"Company country"},{"fieldName":"continent","fieldType":"String","description":"Company continent"},{"fieldName":"zipCodeRadiusMiles","fieldType":"String","description":"Used in conjunction with zipCode, designates a geographical radius (in miles) from the zipCode provided."},{"fieldName":"hashTagString","fieldType":"String","description":"Hash tags for a company. Can include a comma-separated list."},{"fieldName":"techAttributeTagList","fieldType":"String","description":"Specify technology product tags"},{"fieldName":"subUnitTypes","fieldType":"String","description":"Company sub types (e.g., division, subsidiary and so on)."},{"fieldName":"primaryIndustriesOnly","fieldType":"Boolean","description":"Used in conjunction with the industryCodes input parameter. When set to true, any result returned must have one of the specified industries in the top two. If no industries are specified, then this parameter will be ignored. Default is false."},{"fieldName":"industryCodes","fieldType":"String","description":"Top-level industry that the contact works in. A contact can have multiple top level industries. Tags are based on the contact's current company. Can include a comma-separated list."},{"fieldName":"industryKeywords","fieldType":"String","description":"Industry keywords associated with a company. Can include a comma-separated list."},{"fieldName":"sicCodes","fieldType":"String","description":"Four-digit numerical codes assigned by the U.S. government to business establishments to identify the primary business of the establishment."},{"fieldName":"naicsCodes","fieldType":"String","description":"Four-digit numerical codes assigned by the U.S. government to business establishments to identify the primary business of the establishment. "},{"fieldName":"revenueMin","fieldType":"Integer","description":"Minimum annual revenue for a company in U.S. dollars. Use with revenueMax to set a range. Alternatively, you can use the revenue parameter to search for pre-defined ranges."},{"fieldName":"revenueMax","fieldType":"Integer","description":"Maximum annual revenue for a company in U.S. dollars. Use with revenueMin to set a range. Alternatively, you can use the revenue parameter to search for pre-defined ranges."},{"fieldName":"revenue","fieldType":"String","description":"Annual revenue range in U.S. dollars. Accepts a comma-separated list of values. Alternatively, to get more granular ranges, you can use the revenueMin and revenueMax parameters."},{"fieldName":"employeeRangeMin","fieldType":"String","description":"Minimum employee count for a company. Use with employeeRangeMax to set a range. Alternatively, you can use the employeeCount parameter to search for pre-defined ranges."},{"fieldName":"employeeRangeMax","fieldType":"String","description":"Maximum employee count for a company. Use with employeeRangeMin to set a range. Alternatively, you can use the employeeCount parameter to search for pre-defined ranges."},{"fieldName":"employeeCount","fieldType":"String","description":"Employee count range. Accepts a comma-separated list of values. Alternatively, to get more granular ranges, you can use the employeeRangeMin and employeeRangeMax parameters."},{"fieldName":"companyRanking","fieldType":"String","description":"Company ranking list (e.g., Fortune 500 and so on)"},{"fieldName":"metroRegion","fieldType":"String","description":"Company metro area. Accepts a comma-separated list of U.S. and Canada metro areas."},{"fieldName":"locationSearchType","fieldType":"String","description":"Location type (PersonOrHQ, PersonAndHQ, Person, HQ, PersonThenHQ)."},{"fieldName":"fundingAmountMin","fieldType":"Integer","description":"Minimum funding amount in thousands (e.g., 1 = 1000, 500 = 500,000). If fundingAmountMin is used without fundingAmountMax, the result will be the amount specified or greater."},{"fieldName":"fundingAmountMax","fieldType":"Integer","description":"Maximum funding amount in thousands (e.g., 1 = 1000, 500 = 500,000). If fundingAmountMax is used without fundingAmountMin, the result will be the amount specified or less."},{"fieldName":"fundingStartDate","fieldType":"String","description":"Start date of the funding in YYYY-MM-DD format. If fundingStartDate and fundingEndDate are both specified, they will be used as a range. Start date after end date returns an error. If start date and end date are the same, will return results for exact date."},{"fieldName":"fundingEndDate","fieldType":"String","description":"End date of the funding in YYYY-MM-DD format. If fundingStartDate and fundingEndDate are both specified, they will be used as a range. Start date after end date returns an error. If start date and end date are the same, will return results for exact date."},{"fieldName":"excludedRegions","fieldType":"String","description":"Exclude a company metro area. Accepts a comma-separated list of U.S. and Canada metro areas."},{"fieldName":"zoominfoContactsMin","fieldType":"String","description":"Minimum number of ZoomInfo contacts associated with company"},{"fieldName":"zoominfoContactsMax","fieldType":"String","description":"Maximum number of ZoomInfo contacts associated with company"},{"fieldName":"companyStructureIncludedSubUnitTypes","fieldType":"String","description":"Company hierarchical structure"},{"fieldName":"oneYearEmployeeGrowthRateMin","fieldType":"String","description":"Minimum one year employee growth rate for a company. Use with oneYearEmployeeGrowthRateMax to set a range."},{"fieldName":"oneYearEmployeeGrowthRateMax","fieldType":"String","description":"Maximum one year employee growth rate for a company. Use with oneYearEmployeeGrowthRateMin to set a range."},{"fieldName":"twoYearEmployeeGrowthRateMin","fieldType":"String","description":"Minimum two year employee growth rate for a company. Use with twoYearEmployeeGrowthRateMax to set a range."},{"fieldName":"twoYearEmployeeGrowthRateMax","fieldType":"String","description":"Maximum two year employee growth rate for a company. Use with twoYearEmployeeGrowthRateMin to set a range."},{"fieldName":"lastUpdatedDateAfter","fieldType":"String","description":"The date after which the contact's profile was last updated"},{"fieldName":"validDateAfter","fieldType":"String","description":"The date after which the contact's profile was last validated"},{"fieldName":"phone","fieldType":"ArrayList","description":"List of person phones or mobile numbers"},{"fieldName":"positionStartDateMin","fieldType":"String","description":"Minimum date for when a contact began current employment. Use with positionStartDateMax to set a range"},{"fieldName":"positionStartDateMax","fieldType":"String","description":"Maximum date for when a contact began current employment. Use with positionStartDateMin to set a range"},{"fieldName":"supplementalEmail","fieldType":"ArrayList","description":"Supplemental email address for the contact in example@example.com format"},{"fieldName":"rpp","fieldType":"Integer","description":"Limits the results returned to the given number of results per page"},{"fieldName":"page","fieldType":"Integer","description":"Provides the results for the given page, used in conjunction with rpp"},{"fieldName":"sortBy","fieldType":"String","description":"Sorts results by valid output fields"},{"fieldName":"sortOrder","fieldType":"String","description":"Default value is desc. It accepts the following values { Asc, Ascending, desc, descending }"}]
*/
如果有人能告诉我如何更新有效负载,我想提出这样的请求
payload = {"contact": "John Doe"}
发布于 2022-06-09 18:02:03
看起来您需要将输入更改为POST请求:
"POST Contact Search https://api.zoominfo.com/search/contact从ZoomInfo的数据中返回符合指定搜索标准的联系人列表。输入参数可能需要特定的值,其中一些值太大,无法在参数描述中列出。您可以使用查找端点检索这些值。“
与GET请求:
“获取联系人搜索输出https://api.zoominfo.com/lookup/outputfields/contact/search返回联系人搜索端点响应中包含的字段列表。”
因此,我可以看到- GET搜索只返回有关输入字段的信息,而POST搜索则根据输入参数为每个字段生成唯一的信息。(请告诉我这是否有帮助:)
发布于 2022-07-18 04:27:55
看起来您想要使用丰富功能:
var zoompayload = {
"matchPersonInput": [
{
"firstName": fname,
"lastName": lname,
"companyName": cname,
// "companyId": 358636815,
//"emailAddress":"forabc@rediffmail.com"
"emailAddress": email
}
],
"outputFields": outfields
};
var options = {
method: 'POST',
redirect: 'follow',
headers: { "Content-Type": "application/json", "Authorization": "Bearer " + "your jwt here" },
'payload': JSON.stringify(zoompayload),
};
// Fetch all the required fields
var response = UrlFetchApp.fetch("https://api.zoominfo.com/enrich/contact", options);
试一试,并参考他们的api文档
https://stackoverflow.com/questions/70840047
复制相似问题