← Back to Home

How to Extract Article ID from Yahoo News URL

Updated January 14, 2026
url parsingregexarticle idyahoo newspickup

Extracting Article ID from Yahoo News URL

Yahoo News article IDs are embedded in the pickup page URLs.

URL Pattern

Yahoo News pickup URLs follow this pattern:

https://news.yahoo.co.jp/pickup/6564191

The article ID is the numeric segment after /pickup/.

Extraction Method

Use regex to extract the numeric ID:

const url = "https://news.yahoo.co.jp/pickup/6564191";
const match = url.match(/\/pickup\/(\d+)/);

if (match) {
  const articleId = match[1]; // "6564191"
}

Alternative Patterns

Some Yahoo News URLs may use different patterns:

Use a more general pattern if needed:

const match = url.match(/\/(?:pickup|articles)\/(\d+)/);

Code Example

function extractArticleId(url: string): string | null {
  const match = url.match(/\/pickup\/(\d+)/);
  return match ? match[1] : null;
}

// Usage
const id = extractArticleId("https://news.yahoo.co.jp/pickup/6564191");
console.log(id); // "6564191"