What you will build
The script below:- Fetches recent posts the profile reacted to.
- Fetches recent posts the profile commented on.
- Merges both signals by LinkedIn post.
- Prints concise outreach hook ideas you can review before using.
Endpoints used
Both endpoints accept:
profiles: LinkedIn/in/profile URLs or public usernamesmaxItems: maximum rows to return per profilepostedLimit: one ofany,24h,week,month,3months,6months,year
JavaScript example
Createlinkedin-hooks.mjs:
Python example
Createlinkedin_hooks.py:
Example output
Production tips
- Keep
maxItemssmall for interactive workflows; increase it only for batch jobs. - Prefer
postedLimit: "month"or shorter for timely hooks. - Store the returned
postUrlwith your CRM activity so reps can review the source context. - Use comments first when available: they usually reveal stronger intent than a reaction alone.
- De-duplicate hooks across prospects before generating outreach sequences.