How to Filter LinkedIn Job Searches by Recency and Workplace Type Using the CLI
Use the --jobage flag to filter jobs by posting recency (1, 7, 14, or 30 days) and the --remote flag to specify workplace type (remote, hybrid, or onsite) when executing the search command.
The MadsLorentzen/ai-job-search repository provides a lightweight, self-contained command-line tool that queries LinkedIn's public jobs-guest endpoints without requiring authentication or external API keys. You can filter LinkedIn job searches by recency and workplace type using the CLI, which parses HTML locally using the bun runtime and emits structured results in JSON, table, or plain-text formats.
CLI Architecture and Data Flow
The tool operates as a client-side parser that constructs targeted URLs for LinkedIn's public endpoints. According to the .agents/skills/linkedin-search/cli/README.md, the CLI pulls job listings from the seeMoreJobPostings/search and jobPosting/<id> endpoints, processing raw HTML to extract structured data.
The entry point at .agents/skills/linkedin-search/cli/src/cli.ts exposes two primary commands:
search: Queries job listings with filter parametersdetail: Retrieves full job descriptions by ID
Filter logic resides in .agents/skills/linkedin-search/cli/src/helpers.ts, which translates human-readable flags into LinkedIn's native query parameters before issuing HTTP requests.
Filter by Recency Using --jobage
The recency filter restricts results to jobs posted within a specific timeframe. The --jobage flag accepts four integer values: 1, 7, 14, or 30, representing the number of days since posting.
Internally, the CLI converts the day count into LinkedIn's f_TPR query parameter (seconds since epoch) in the helper functions. This parameter is appended to the request URL before fetching results from the jobs-guest endpoints.
bun run .agents/skills/linkedin-search/cli/src/cli.ts search \
-q "backend engineer" \
-l "Berlin, Germany" \
--jobage 7 \
--format table
This command returns only backend engineering positions posted within the last seven days, formatted as an ASCII table for terminal readability.
Filter by Workplace Type Using --remote
The workplace type filter uses the --remote flag to limit results by physical work arrangement. The flag supports three string values:
remote: Fully remote positionshybrid: Mixed remote and on-site arrangementsonsite: Physical office presence required
The CLI appends the appropriate workplaceType filter parameter to the LinkedIn search URL. As documented in .agents/skills/linkedin-search/SKILL.md, this filtering occurs client-side after fetching the raw HTML, ensuring the tool remains dependency-free.
bun run .agents/skills/linkedin-search/cli/src/cli.ts search \
-q "data scientist" \
-l "Remote" \
--remote remote \
--format table
This invocation targets fully remote data scientist roles regardless of geographic location.
Combine Filters for Precise Targeting
You can stack multiple filters in a single command to narrow results by both recency and workplace type simultaneously. The CLI processes these flags sequentially, building a composite query that satisfies all constraints.
bun run .agents/skills/linkedin-search/cli/src/cli.ts search \
-q "product manager" \
-l "London, United Kingdom" \
--jobage 14 \
--remote hybrid \
--format table
This example retrieves hybrid product manager positions posted within the last 14 days in the London area.
Output Formats and Pagination
The CLI supports three output formats controlled by the --format flag:
table: Human-readable ASCII table (ideal for terminal scanning)json: Machine-parseable JSON outputplain: Unformatted text for piping to other tools
Results paginate at 10 jobs per page. Use the --page flag to retrieve subsequent result sets, as noted in the CLI README documentation.
bun run .agents/skills/linkedin-search/cli/src/cli.ts search \
-q "devops engineer" \
--jobage 30 \
--remote onsite \
--page 2 \
--format json
Retrieve Detailed Job Descriptions
After identifying a job ID from search results, use the detail command to fetch complete job specifications including seniority level, employment type, and full description text.
bun run .agents/skills/linkedin-search/cli/src/cli.ts detail 4426311357 \
--format plain
Replace 4426311357 with the numeric job ID retrieved from your search results.
Summary
- Filter by recency: Use
--jobagewith values1,7,14, or30to limit results to recent postings - Filter by workplace type: Use
--remotewith valuesremote,hybrid, oronsiteto target specific work arrangements - Implementation location: Translation logic resides in
.agents/skills/linkedin-search/cli/src/helpers.ts, with CLI entry at.agents/skills/linkedin-search/cli/src/cli.ts - No authentication required: The tool queries public LinkedIn endpoints without API keys
- Output flexibility: Choose between
table,json, orplainformats using the--formatflag
Frequently Asked Questions
What values does the --jobage flag accept?
The --jobage flag accepts four integer values: 1, 7, 14, or 30. These represent the number of days since the job was posted. The CLI converts these values into LinkedIn's f_TPR query parameter (seconds since epoch) before issuing the request to filter results by recency.
Do I need a LinkedIn API key to use this CLI?
No authentication or external API key is required. The CLI queries LinkedIn's public jobs-guest endpoints (seeMoreJobPostings/search and jobPosting/<id>) and parses the returned HTML locally. The only dependency is the bun JavaScript runtime.
How does the tool handle pagination for large result sets?
The CLI returns 10 results per page by default. Use the --page flag followed by a page number to retrieve subsequent batches of results. For example, --page 2 returns results 11–20 for your current query.
Can I combine multiple filters in a single search command?
Yes, you can combine the --jobage and --remote flags (along with location -l and query -q parameters) in a single command. The CLI builds a composite query URL that applies all filters simultaneously, allowing you to target specific combinations of recency and workplace type.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →