DEV Community

Cover image for How to Check Social Share Previews (OG Tags) in Bulk Without a Paid API
Tim Zinin
Tim Zinin

Posted on Originally published at apify.com

How to Check Social Share Previews (OG Tags) in Bulk Without a Paid API

The problem

You publish a landing page, someone pastes the link into X, LinkedIn, Slack or Telegram — and it renders as a blank gray card, a cropped logo, or a headline that says nothing. The cause is almost always in the page's Open Graph and Twitter Card metadata, and the fix takes minutes. Finding out which of your pages are broken is the slow part.

The manual loop is per-page and tedious: view source or a browser extension for every URL, plus a trip to each platform's own debugging tool, which shows cached state and often disagrees with the markup you just read. For a site with dozens or hundreds of URLs — a sitemap, a client portfolio, a batch of fresh blog posts — checking one link at a time does not scale, and each platform debugger answers only for its own platform.

What the actor does

The Social Preview Checker audits up to 100 authorized public pages in one run. It reads the bounded public HTML head metadata directly — no browser, no LLM — and extracts the Open Graph and Twitter Card tags (titles, descriptions, images, canonical URL, type, site name, card type). For each URL it then:

  • applies an OG → Twitter Card → <title> fallback chain to produce a resolved likely preview (previewLikely: headline, text, image, site name) — the same fallback logic messaging and social platforms apply;
  • performs a live image check on the selected preview image via HEAD/GET, reporting reachability, content type and declared size, so a card that points at a 404 or an HTML error page is caught before a human shares it;
  • computes a 0–100 share score from seven deterministic metadata checks, plus a plain-language issues list naming the specific defects — missing og:image/twitter:image, overly long titles, missing tags, unreachable assets;
  • attaches decision metadata: confidenceScore/confidenceBand for the observation, dataGaps, a recommendedAction (FIX_PREVIEW_METADATA_AND_RECHECK, MONITOR_SOCIAL_PREVIEW_METADATA, or REVIEW_FETCH_FAILURE), actionPriority, and safeToAutomate.

One honest boundary is stated throughout the README: a row describes metadata observable in one bounded public response and a likely preview. Platform caches, crawlers and rendering rules differ, so the actor does not guarantee the exact card any platform will render — and it does not purge caches or predict traffic. Non-delivery is free: source failures, no-match and budget-stopped rows come back as advisories with billing.billable: false, and the actor fails closed rather than guessing when pricing cannot be read safely.

Input is a list of up to 100 public HTTP(S) URLs (fragments removed, normalized duplicates processed once) plus a maxConcurrency setting from 1 to 50. DNS resolution is guarded and pinned, and redirects are revalidated, so a public URL cannot redirect the fetch into a private address.

Example: input and output

{
  "urls": [
    "https://apify.com",
    "https://github.com",
    "https://stripe.com"
  ],
  "maxConcurrency": 3
}
Enter fullscreen mode Exit fullscreen mode

An example success row from the README's output section (a compact contract example derived from acceptance fixtures — illustrative, not a live observation of that URL):

{
  "url": "https://example.com/",
  "found": true,
  "httpStatus": 200,
  "shareScore": 43,
  "issues": [
    "No og:image / twitter:image — preview shows no picture (worst for CTR)."
  ],
  "confidenceScore": 43,
  "confidenceBand": "low",
  "recommendedAction": "FIX_PREVIEW_METADATA_AND_RECHECK",
  "safeToAutomate": false,
  "failureType": null,
  "retryable": false
}
Enter fullscreen mode Exit fullscreen mode

Pricing and the free limit

Pay per event: $0.005 per run start plus $0.004 per delivered social metadata audit. Advisory, no-match, source-failure and budget-stop rows are not billed.

Apify's free plan gives $5 of usage credits per month. At this tariff, $5 covers up to 1,248 page audits in a single run (0.005 + 0.004 × 1,248 ≈ $5.00) — or about 12 full 100-page runs at $0.405 each.

Try it

Paste a URL list, start the run, and work the issues list top-down: Social Preview Checker

For AI agents and MCP

The actor takes JSON in and returns structured JSON rows plus a run-level OUTPUT record, so an agent can call it through the Apify API and route rows by recommendedAction, failureType and safeToAutomate — quarantining advisory rows instead of letting them into a positive-results lane. The README includes a ready-made Apify MCP call-actor payload for this actor and an MCP server setup block, alongside cURL, JavaScript and Python examples. The human-review boundary travels with the data: safeToAutomate stays false for anything that would edit a production site.

Top comments (0)