30817:url-indexing

URL Indexing

covers31263

JdM

published
2026-01-25

Abstract

This NIP defines kind:31263 (parameterized replaceable event) to publish metadata about URLs. Each event represents the indexing result of a URL and contains normalized identifiers and extracted metadata.

These events can be used to build decentralized search indexes, discovery systems, and content catalogs.

Event Structure

{
  "kind": 31263,
  "tags": [
    ["d", "<normalized-url>"],
    ["title", "<title>"],
    ["description", "<meta-description>"],
    ["l", "<language-code>"],
    ["keywords", "<comma-separated-keywords>"],
    ["x", "<sha256-page-hash>"],
    ["m", "<mime-type>"]
  ],
  "content": "<raw-text-snippet>"
}

Tags

  • d: Normalized URL identifier (see normalization rules below). (Required)
  • title: Title of the page (from <title> tag). (Optional)
  • description: Meta description (from <meta name="description">). (Optional)
  • l: Language of the content (ISO 639-1 code, e.g., en, fr). (Optional)
  • keywords: Comma-separated keywords (from <meta name="keywords">). (Optional)
  • x: SHA-256 hash of the full page content (for deduplication). (Optional)
  • m: MIME type of the content (e.g., text/html, application/pdf). (Optional)

Content

A plain-text snippet extracted from the main readable content.

Normalized URL

  1. Convert the scheme and host to lowercase:
  1. Remove default ports:
  1. Remove the www. prefix:
  1. Strip non-essential query parameters:
  1. Remove fragments (#section):
  1. Resolve relative paths:
  1. Remove trailing slashes (except for root /):
  1. Percent-encode special characters:
  1. Sort remaining query parameters alphabetically:
  1. Normalize Internationalized Domain Names (IDNs):

Conflicting Metadata

In cases where multiple events with the same normalized URL have conflicting metadata, clients can prioritize events based on the following criteria:

  • Hash verification: Events with a verified hash match are prioritized.
  • Trusted sources: Events from trusted indexers or contacts are prioritized.
  • Timestamp: More recent events may be prioritized if other criteria are equal.

Example

{
  "id": "...",
  "pubkey": "...",
  "sig": "...",
  "created_at": 1769366915,
  "kind": 31263,
  "tags": [
    ["d", "https://example.com/articles/ostriches?lang=en"],
    ["title", "The Social Life of Ostriches"],
    ["description", "Analysis of ostrich social behaviors."],
    ["l", "en"],
    ["keywords", "ostriches,animals,science"],
    ["x", "6f5635035f36ad500b4fc4bb7816bb72ef5594e1bcae44fa074c5e988fc4c0fe"],
    ["m", "text/html"]
  ],
  "content": "Ostriches live in groups called troops. They display complex social behaviors, including cooperative breeding and communal nesting. These behaviors allow them to gain benefits from social interactions, such as increased protection from predators and more effective rearing of their young."
}

Cited links

Discussion

Connect a key to comment.