LinkedIn 中的目标受众计数 API
Target Audience Count in LinkedIn API
LinkedIn API v1 有一个 api 端点来计算选定目标受众的数量。后面的 apis 只有 Ads-API
有这个端点
现在,我正在尝试使用定位条件来分享帖子(Share API). I want to restrict posting if size of audience is less than 300. (As LinkedIn has a limit (audience size must be at least 300), I have to do a check first.) how do I count the size of target? (Note that, I have the count of individual categories with this endpoint:但这些受众可能有交集,因此这些计数的总和并不准确。)
如果没有这个,其他人如何使用定位 api?还是我遗漏了什么?
您可以使用 Audience Counts API, where you can pass the targetingCriteria 作为列表,例如:
curl \
-H "Authorization:Bearer <the_token>" \
-H "Content-Type:application/json" \
-H "X-Restli-Protocol-Version: 2.0.0" \
"https://api.linkedin.com/v2/audienceCountsV2?q=targetingCriteriaV2&targetingCriteria=(include:(and:List((or:(urn%3Ali%3AadTargetingFacet%3AinterfaceLocales:List(urn%3Ali%3Alocale%3Aen_US))),(or:(urn%3Ali%3AadTargetingFacet%3Alocations:List(urn%3Ali%3Aregion%3A5636))))))"
会 return 像:
{
"elements": [
{
"total": 1100000,
"active": 0
}
],
"paging": {
"count": 10,
"start": 0,
"links": []
}
}
还要按照文档中的说明注意正确的编码。
更新
为了计算 companyPage 上的有机 post,您应该添加 followedCompanies 标准,如 described in the doc here:
The audience you target for your share must be greater than 300
members. Use the audienceCountsV2 API to calculate the approximate
size of your audience. Make sure to pass in your company URN in the
followedCompanies field of the targetingFacet parameter so your audience count will be filtered down to only members who follow your
company.
因此参考前面的示例,针对 ID = 123 的 companyPage:
curl \
-H "Authorization:Bearer token" \
-H "Content-Type:application/json" \
-H "X-Restli-Protocol-Version: 2.0.0" \
"https://api.linkedin.com/v2/audienceCountsV2?q=targetingCriteriaV2&targetingCriteria=(include:(and:List((or:(urn%3Ali%3AadTargetingFacet%3AfollowedCompanies:List(urn%3Ali%3Aorganization%3A123))),(or:(urn%3Ali%3AadTargetingFacet%3AinterfaceLocales:List(urn%3Ali%3Alocale%3Aen_US))),(or:(urn%3Ali%3AadTargetingFacet%3Alocations:List(urn%3Ali%3Aregion%3A5636))))))"
希望对您有所帮助
LinkedIn API v1 有一个 api 端点来计算选定目标受众的数量。后面的 apis 只有 Ads-API
有这个端点现在,我正在尝试使用定位条件来分享帖子(Share API). I want to restrict posting if size of audience is less than 300. (As LinkedIn has a limit (audience size must be at least 300), I have to do a check first.) how do I count the size of target? (Note that, I have the count of individual categories with this endpoint:但这些受众可能有交集,因此这些计数的总和并不准确。)
如果没有这个,其他人如何使用定位 api?还是我遗漏了什么?
您可以使用 Audience Counts API, where you can pass the targetingCriteria 作为列表,例如:
curl \
-H "Authorization:Bearer <the_token>" \
-H "Content-Type:application/json" \
-H "X-Restli-Protocol-Version: 2.0.0" \
"https://api.linkedin.com/v2/audienceCountsV2?q=targetingCriteriaV2&targetingCriteria=(include:(and:List((or:(urn%3Ali%3AadTargetingFacet%3AinterfaceLocales:List(urn%3Ali%3Alocale%3Aen_US))),(or:(urn%3Ali%3AadTargetingFacet%3Alocations:List(urn%3Ali%3Aregion%3A5636))))))"
会 return 像:
{
"elements": [
{
"total": 1100000,
"active": 0
}
],
"paging": {
"count": 10,
"start": 0,
"links": []
}
}
还要按照文档中的说明注意正确的编码。
更新
为了计算 companyPage 上的有机 post,您应该添加 followedCompanies 标准,如 described in the doc here:
The audience you target for your share must be greater than 300 members. Use the audienceCountsV2 API to calculate the approximate size of your audience. Make sure to pass in your company URN in the followedCompanies field of the targetingFacet parameter so your audience count will be filtered down to only members who follow your company.
因此参考前面的示例,针对 ID = 123 的 companyPage:
curl \
-H "Authorization:Bearer token" \
-H "Content-Type:application/json" \
-H "X-Restli-Protocol-Version: 2.0.0" \
"https://api.linkedin.com/v2/audienceCountsV2?q=targetingCriteriaV2&targetingCriteria=(include:(and:List((or:(urn%3Ali%3AadTargetingFacet%3AfollowedCompanies:List(urn%3Ali%3Aorganization%3A123))),(or:(urn%3Ali%3AadTargetingFacet%3AinterfaceLocales:List(urn%3Ali%3Alocale%3Aen_US))),(or:(urn%3Ali%3AadTargetingFacet%3Alocations:List(urn%3Ali%3Aregion%3A5636))))))"
希望对您有所帮助