const headers = {
"x-api-key": process.env.TRIGIFY_API_KEY,
"Content-Type": "application/json",
};
const profileRes = await fetch("https://api.trigify.io/v1/profile/enrich", {
method: "POST",
headers,
body: JSON.stringify({
profileUrl: "https://linkedin.com/in/amelia-chen",
}),
});
const profile = await profileRes.json();
const companyRes = await fetch("https://api.trigify.io/v1/company/enrich", {
method: "POST",
headers,
body: JSON.stringify({
companyUrl: "https://linkedin.com/company/microsoft",
}),
});
const company = await companyRes.json();
const memberUrn = profile.data.prospect.linkedin_urn;
const companyId = Number(company.data.linkedin_company_id);
const searchRes = await fetch("https://api.trigify.io/v1/searches", {
method: "POST",
headers,
body: JSON.stringify({
name: "Mention-driven LinkedIn Search",
query: {
keywords: ["copilot", "automation"],
monitoring_type: "linkedin-posts",
},
filters: {
mentions_member: [memberUrn],
mentions_organization: [companyId],
frequency: "DAILY",
time_frame: "past-week",
},
}),
});
const search = await searchRes.json();
console.log(search.data.id);