
This repository provides a Python-based solution to extract data from public LinkedIn feed posts using the Crawlbase Crawling API.
It includes:
- A feed scraper that sends an asynchronous request to a LinkedIn post.
- A retrieval script that fetches the final structured post data using the request ID (RID).
📖 Read the full tutorial: How to Scrape LinkedIn
crawlbase
– for using Crawling and Storage APIsjson
– for working with structured dataPython 3.6+
Install the required Python package:
pip install crawlbase
File: linkedin_feed_scraper.py
- Sends an asynchronous request to a public LinkedIn feed post.
- Returns a
rid
(request ID) used to retrieve the final data.
- Replace
YOUR_API_TOKEN
with your Crawlbase token. - Set the LinkedIn feed post
URL
.
python linkedin_feed_scraper.py
{
"rid": "977b3381ab11f938d6522775"
}
File: linkedin_feed_retrieve.py
- Uses the rid from the previous script to fetch and print the full post data.
- Replace
YOUR_API_TOKEN
andRID
in the script.
python linkedin_feed_retrieve.py
{
"feeds": [
{
"text": "#AlphabetInc is eliminating 12,000 jobs, its chief executive said in a staff memo The cuts mark the latest to shake the #technology sector and come days after rival Microsoft Corp said it would lay off 10,000 workers. Full report - https://lnkd.in/dfxXc2N4",
"images": [
"https://media.licdn.com/dms/image/C4D22AQHvTzTp5mnMcg/feedshare-shrink_2048_1536/0/1674212335928?e=2147483647&v=beta&t=Aq3WKkxF1Q5ZwGB6ax6OOWRtCW7Vlz8KDdpBvvK4K_0"
],
"videos": [],
"datetime": "1y",
"postUrl": "https://in.linkedin.com/company...",
...
},
...
]
}
- Support for scraping multiple company pages
- Export company data to CSV/JSON
- Add CLI options for input/output
- Implement retry and error-handling logic
- Research competitors and market trends
- Monitor public-facing company updates
- Build datasets for lead generation and analytics