Semver Parser & Version Range Checker
Pricing
Pay per event
Semver Parser & Version Range Checker
Parse, validate, compare, and sort semantic versions. Supports npm/cargo/pip range syntax (^1.2, ~2.0, >=1.0.0 <2.0.0). Returns parsed components, range checks, and ranked sorted arrays.
Pricing
Pay per event
Rating
0.0
(0)
Developer
Stas Persiianenko
Actor stats
0
Bookmarked
2
Total users
1
Monthly active users
5 days ago
Last modified
Categories
Share
Parse, validate, compare, and sort semantic version strings in one API call. Supports npm, Cargo, pip, and Maven range syntax — no code required.
What does Semver Parser do?
Semver Parser accepts a list of version strings (e.g. 1.2.3, 2.0.0-beta.1) and performs any combination of four operations:
- 🔍 Parse — break every version into
major,minor,patch, pre-release, and build-metadata components - ✅ Validate — instantly flag strings that don't conform to the Semantic Versioning 2.0.0 spec
- 🎯 Range check — test whether each version satisfies an npm/cargo/pip range expression (e.g.
^1.2,~2.0,>=1.0.0 <2.0.0) - 📊 Sort & rank — return all valid versions in ascending or descending semver order with a 1-based rank
Every result is written to an Apify dataset as a flat JSON record, ready to export as JSON, CSV, or Excel with a single click.
Who is Semver Parser for?
DevOps & platform engineers who automate dependency pipelines:
- Check whether a batch of library versions satisfies a minimum requirement before deploying
- Validate version strings from package manifests before triggering CI/CD workflows
- Sort release tags from container registries into ascending upgrade paths
Package maintainers and open-source maintainers:
- Quickly determine which of your release versions fall inside a support window (e.g.
>=3.0.0 <4.0.0) - Detect accidentally published pre-release strings in a release list
- Produce a ranked changelog from an unordered list of git tags
QA / release managers who need fast, scriptable version checks:
- Validate that all version fields in a config file are well-formed semver before a release
- Confirm that a proposed version bump is greater than all existing published versions
- Automate go/no-go decisions based on version constraints in your CI pipeline
Low-code/no-code builders working in Zapier, Make, or n8n:
- Use the actor as a pure utility step — pass an array of versions, receive parsed JSON, route on
satisfiesRangeorisValidfields without writing any code
Why use Semver Parser?
- 🚀 Pure HTTP utility — zero proxy usage, runs in ~1 second, costs fractions of a cent
- 🎯 Full npm range syntax —
^1.2,~2.0,>=1.0.0 <2.0.0,1.x,*,latest— powered by the battle-testedsemvernpm package (500M+ downloads/week) - 🔢 Batch processing — parse up to 1,000 versions in a single run; extend to 10,000 via the
maxVersionsparameter - 📦 Coercion — loose strings like
v1.2or1.0are coerced to valid semver before processing; the original input is preserved - ✅ Pre-release support — control whether pre-release identifiers (
-beta.1,-rc.2) count for range satisfaction - 📊 Ranked output — valid versions are sorted and assigned a 1-based
rankfield for easy downstream consumption - 🔗 API-first — trigger via REST API, Apify CLI, Zapier, Make, or any HTTP client
- 📁 Export formats — JSON, CSV, XLSX, JSONL, XML — direct from the dataset tab
What data can you extract?
Each input version produces one output record with the following fields:
| Field | Type | Description |
|---|---|---|
version | string | Original input version string |
isValid | boolean | Whether the string is valid semver |
major | number | Major version component |
minor | number | Minor version component |
patch | number | Patch version component |
prerelease | string | Pre-release identifier (e.g. beta.1), empty if none |
build | string | Build metadata (e.g. build.42), empty if none |
coerced | string | Coerced semver string (e.g. v1.2 → 1.2.0), null if uncoerceable |
satisfiesRange | boolean | Whether version satisfies the given range expression; null if no range provided |
rank | number | Sort rank (1 = first in chosen sort order), null if invalid |
error | string | Validation error message for invalid versions; null if valid |
The key-value store also contains a summary record with aggregate statistics: counts, range match counts, highest/lowest version, and operation metadata.
How much does it cost to parse semantic versions?
Semver Parser uses Pay-Per-Event (PPE) pricing — you pay only for what you actually process.
| Event | FREE tier | BRONZE | SILVER | GOLD | PLATINUM | DIAMOND |
|---|---|---|---|---|---|---|
| Actor start (one-time) | $0.005 | $0.005 | $0.005 | $0.005 | $0.005 | $0.005 |
| Per version parsed | $0.00115 | $0.001 | $0.00078 | $0.0006 | $0.0004 | $0.00028 |
Real-world cost examples:
| Use case | Versions | Estimated cost (BRONZE) |
|---|---|---|
| Validate a manifest | 10 | ~$0.015 |
| Check a release list | 100 | ~$0.105 |
| Audit a lock file | 500 | ~$0.505 |
| Full dependency graph | 1,000 | ~$1.005 |
Free plan: Apify gives new users $5 in free credits. At BRONZE pricing, that's ~4,750 version parses at no cost.
💡 Since this actor uses zero proxy bandwidth and minimal compute, the per-item cost is among the lowest on the Apify Store.
How to parse semantic versions with Semver Parser
- Open the actor at apify.com/automation-lab/semver-parser
- Click "Try for free" and sign in (or create a free account)
- Add your version strings to the "Version strings" field — one per line in the UI, or as a JSON array via the API
- Set an optional range (e.g.
>=1.0.0 <2.0.0) to test which versions satisfy your constraint - Choose your operation:
all(default),parse,validate, orcompare - Click "Start" — the actor runs in ~1-5 seconds for most inputs
- View results in the Dataset tab — export as JSON, CSV, or Excel
Example: validate a list of dependency versions
Input:
{"versions": ["1.2.3", "2.0.0-beta.1", "invalid-ver", "3.0.0"],"range": ">=1.0.0 <3.0.0","operation": "all","sortOrder": "desc"}
Example: sort git tags for a changelog
{"versions": ["v0.9.0", "v1.0.0", "v1.1.0", "v0.5.0", "v2.0.0-alpha.1"],"operation": "compare","sortOrder": "desc","includePrerelease": false}
Example: validate only (fast mode)
{"versions": ["1.0.0", "bad-version", "2.0", "1.0.0-alpha"],"operation": "validate"}
Input parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
versions | string[] | — | Required. Array of version strings to process |
range | string | "" | Optional range expression to test (^1.2, ~2.0, >=1.0.0 <2.0.0, 1.x, *) |
operation | string | "all" | all, parse, validate, or compare |
sortOrder | string | "desc" | "desc" (newest first) or "asc" (oldest first) |
includePrerelease | boolean | true | Whether pre-release versions count for range satisfaction |
maxVersions | integer | 1000 | Maximum versions to process (1–10,000) |
Output examples
Valid version with range check
{"version": "2.5.1","isValid": true,"major": 2,"minor": 5,"patch": 1,"prerelease": "","build": "","coerced": "2.5.1","satisfiesRange": true,"rank": 1,"error": null}
Pre-release version
{"version": "2.0.0-beta.1","isValid": true,"major": 2,"minor": 0,"patch": 0,"prerelease": "beta.1","build": "","coerced": "2.0.0-beta.1","satisfiesRange": true,"rank": 2,"error": null}
Version with build metadata
{"version": "3.1.0+build.42","isValid": true,"major": 3,"minor": 1,"patch": 0,"prerelease": "","build": "build.42","coerced": "3.1.0+build.42","satisfiesRange": false,"rank": 1,"error": null}
Invalid version with coercion attempt
{"version": "invalid-ver","isValid": false,"major": null,"minor": null,"patch": null,"prerelease": "","build": "","coerced": null,"satisfiesRange": null,"rank": null,"error": "\"invalid-ver\" is not a valid semver string"}
Summary (key-value store summary key)
{"totalInput": 9,"validVersions": 8,"invalidVersions": 1,"range": ">=1.0.0 <3.0.0","satisfyingRange": 6,"notSatisfyingRange": 2,"sortOrder": "desc","operation": "all","highestVersion": "3.1.0+build.42","lowestVersion": "0.9.9"}
Tips for best results
- 🔢 Start small — run a sample of 10-20 versions first to verify your range expression works as expected before sending large batches
- 🏷️ Strip
vprefixes — the semver spec doesn't allow leadingv. Versions likev1.2.3are coerced to1.2.3automatically; check thecoercedfield if the original had a prefix - 📦 npm range syntax — use standard npm range expressions:
^for compatible,~for patch,xfor wildcards,>= <for bounded ranges - 🔄 Scheduling — use Apify's built-in scheduler to periodically re-check a dependency list; if
satisfyingRangedrops to 0, trigger a webhook or Slack alert - 💾 Export options — after a run, use the Dataset tab to export all results as CSV or Excel for spreadsheet analysis
- 🚫 Max versions — default cap is 1,000. For larger dependency graphs, set
maxVersionsup to 10,000 - ⚡ Compare-only mode — use
"operation": "compare"with no range for pure sorting/ranking without range computation overhead
Integrations
Semver Parser → Slack/Discord — dependency alert Schedule a daily run on your lock-file versions. Use a webhook trigger to post a Slack message when any version falls outside a supported range:
- Actor returns
satisfiesRange: falsefor a dependency - Webhook fires → Slack
#engineeringalert: "Dependency X is outside supported range"
Semver Parser → Google Sheets — version audit dashboard Export the dataset to Google Sheets via the Apify → Google Sheets integration:
- Input: all package versions from a multi-repo scan
- Output: live sheet with
isValid,rank,satisfiesRangecolumns - Filter for
isValid: falseto find version strings that need fixing
Semver Parser → Make (Integromat) — CI/CD gate Add a version validation step to your release pipeline in Make:
- POST your new version string to the actor API
- Receive the
satisfiesRangeresult in the Make module - Route: if
true→ continue deployment; iffalse→ notify release manager
Semver Parser → n8n — package manifest validation Use the HTTP Request node to call the Apify API:
- Input your entire
package.jsondependency list - Branch on
invalidVersions > 0to halt pipeline with an error
Scheduled runs for ongoing compliance monitoring Run Semver Parser on a nightly schedule against your approved version allowlist. Any new version added to a repo that fails the range check triggers an automated issue in GitHub via webhook.
Using the Apify API
Node.js
import { ApifyClient } from 'apify-client';const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });const run = await client.actor('automation-lab/semver-parser').call({versions: ['1.2.3', '2.0.0-beta.1', '3.1.0+build.42'],range: '>=1.0.0 <3.0.0',operation: 'all',sortOrder: 'desc',});const { items } = await client.dataset(run.defaultDatasetId).listItems();console.log(items);
Python
from apify_client import ApifyClientclient = ApifyClient(token='YOUR_API_TOKEN')run = client.actor('automation-lab/semver-parser').call(run_input={'versions': ['1.2.3', '2.0.0-beta.1', '3.1.0+build.42'],'range': '>=1.0.0 <3.0.0','operation': 'all','sortOrder': 'desc',})items = client.dataset(run['defaultDatasetId']).list_items().itemsprint(items)
cURL
# Start the actorcurl -X POST "https://api.apify.com/v2/acts/automation-lab~semver-parser/runs" \-H "Authorization: Bearer YOUR_API_TOKEN" \-H "Content-Type: application/json" \-d '{"versions": ["1.2.3", "2.0.0-beta.1", "3.1.0+build.42"],"range": ">=1.0.0 <3.0.0","operation": "all","sortOrder": "desc"}'# Fetch results (replace RUN_ID and DATASET_ID)curl "https://api.apify.com/v2/datasets/DATASET_ID/items?token=YOUR_API_TOKEN"
Use with AI agents via MCP
Semver Parser is available as a tool for AI assistants that support the Model Context Protocol (MCP).
Add the Apify MCP server to your AI client — this gives you access to all Apify actors, including this one:
Setup for Claude Code
$claude mcp add --transport http apify "https://mcp.apify.com"
Setup for Claude Desktop, Cursor, or VS Code
Add this to your MCP config file:
{"mcpServers": {"apify": {"url": "https://mcp.apify.com"}}}
Your AI assistant will use OAuth to authenticate with your Apify account on first use.
Example prompts
Once connected, try asking your AI assistant:
- "Use automation-lab/semver-parser to check which of these versions satisfy the range >=2.0.0 <3.0.0: 1.9.9, 2.0.0, 2.5.1, 3.0.0-rc.1, 3.0.0"
- "Parse and sort these git tags from newest to oldest: v1.0.0, v0.5.0, v1.2.3, v2.0.0-beta.1, v0.9.9"
- "Validate this list of dependency versions and tell me which ones are not valid semver strings"
Learn more in the Apify MCP documentation.
Is it legal to use Semver Parser?
Yes — completely. Semver Parser is a pure computation utility that processes version strings you supply as input. It makes no HTTP requests to any external website, scrapes no data, and involves no third-party terms of service.
The semver npm package it uses is open-source (ISC license) and the Semantic Versioning specification is a public, freely-licensed standard.
Use Semver Parser in any automation, compliance tool, CI/CD pipeline, or commercial workflow without restriction.
FAQ
What version range syntax is supported?
Semver Parser uses the semver npm package, which supports: comparators (>=, <=, >, <, =), hyphen ranges (1.2.3 - 2.3.4), X-ranges (1.x, 1.*, *), tilde ranges (~1.2.3), caret ranges (^1.2.3), and space-separated AND conditions (>=1.0.0 <2.0.0). This is the same syntax used by npm, Yarn, pnpm, Cargo, and many other package managers.
How fast is it? Can I process thousands of versions? A single run typically completes in 1-5 seconds for up to 1,000 versions. Processing is sequential but very fast since there are no HTTP requests — everything is in-memory arithmetic. For 10,000 versions (the maximum), expect under 30 seconds. Memory usage stays under 50 MB.
How much does processing 100 versions cost? At BRONZE pricing: 1 start event ($0.005) + 100 version-parsed events ($0.001 × 100 = $0.10) = $0.105 total. On the free plan ($5 credits), that's ~47 batches of 100 versions.
Does the actor handle v prefix or loose version strings like 1.0 or 1?
Yes — the actor coerces loose strings using semver.coerce(). v1.2.3 → 1.2.3, 1.0 → 1.0.0, 1 → 1.0.0. The coerced output field always shows what was actually used for parsing. The original version field is preserved unchanged. Strings that cannot be coerced (e.g. invalid-ver, abc) return isValid: false with coerced: null.
Why does a version not satisfy a range when I expect it to?
The most common cause is pre-release handling. By default (includePrerelease: true), pre-release versions like 1.0.0-beta.1 are included in range checks. If includePrerelease is false, semver spec rules apply: a pre-release version only satisfies a range if the range explicitly includes a pre-release comparator on the same major.minor.patch tuple. For example, ^1.0.0 would NOT match 1.0.0-beta.1 when includePrerelease: false.
Can I use this with the Apify Scheduler for recurring dependency audits?
Yes — set up a scheduled actor run via Apify Console or the API. Store your version list and range in the actor input, and use a webhook to notify you when satisfyingRange drops below a threshold or invalidVersions > 0. This is useful for ongoing compliance checks against dependency windows.
What happens if I send the same version multiple times?
Each entry in the input array is processed independently and produces one output record. Duplicates are preserved — they'll both appear in the dataset with the same rank. If you need deduplication, filter the output by version after the run.
Other utility actors from automation-lab
Looking for more developer and DevOps tools?
- 🔗 JSON Schema Generator — infer JSON Schema from any JSON sample automatically
- 🎨 Color Contrast Checker — WCAG 2.1 AA/AAA accessibility compliance checker for hex/RGB color pairs
- 🌐 Lazada Scraper — extract product listings, prices, and reviews from Lazada
- 🔍 Browse all tools at apify.com/automation-lab