<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.everycrt.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ADataAPIManifest</id>
	<title>Module:DataAPIManifest - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.everycrt.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ADataAPIManifest"/>
	<link rel="alternate" type="text/html" href="https://wiki.everycrt.com/index.php?title=Module:DataAPIManifest&amp;action=history"/>
	<updated>2026-08-02T04:11:54Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://wiki.everycrt.com/index.php?title=Module:DataAPIManifest&amp;diff=9351&amp;oldid=prev</id>
		<title>Arclight-MCP-Bot: Fix API_URL: this wiki has $wgScriptPath=&#039;&#039; so api.php is at the document root, not under /w/ (via update-page on MediaWiki MCP Server)</title>
		<link rel="alternate" type="text/html" href="https://wiki.everycrt.com/index.php?title=Module:DataAPIManifest&amp;diff=9351&amp;oldid=prev"/>
		<updated>2026-05-12T20:17:16Z</updated>

		<summary type="html">&lt;p&gt;Fix API_URL: this wiki has $wgScriptPath=&amp;#039;&amp;#039; so api.php is at the document root, not under /w/ (via update-page on MediaWiki MCP Server)&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 20:17, 12 May 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l19&quot;&gt;Line 19:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 19:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;local p = {}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;local p = {}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;local API_URL  = &#039;https://wiki.everycrt.com&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;/w&lt;/del&gt;/api.php&#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;-- This wiki is configured with $wgScriptPath = &#039;&#039; and $wgArticlePath = &#039;/wiki/$1&#039;,&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;-- so api.php / rest.php live at the document root and articles at /wiki/PageName.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;local API_URL  = &#039;https://wiki.everycrt.com/api.php&#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;local BASE_URL = &amp;#039;https://wiki.everycrt.com&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;local BASE_URL = &amp;#039;https://wiki.everycrt.com&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Arclight-MCP-Bot</name></author>
	</entry>
	<entry>
		<id>https://wiki.everycrt.com/index.php?title=Module:DataAPIManifest&amp;diff=9347&amp;oldid=prev</id>
		<title>Arclight-MCP-Bot: Initial version: emits a JSON manifest of canonical entity-type categories for third-party Data API consumers (via create-page on MediaWiki MCP Server)</title>
		<link rel="alternate" type="text/html" href="https://wiki.everycrt.com/index.php?title=Module:DataAPIManifest&amp;diff=9347&amp;oldid=prev"/>
		<updated>2026-05-12T20:05:59Z</updated>

		<summary type="html">&lt;p&gt;Initial version: emits a JSON manifest of canonical entity-type categories for third-party Data API consumers (via create-page on MediaWiki MCP Server)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- Module:DataAPIManifest&lt;br /&gt;
--&lt;br /&gt;
-- Emits a JSON manifest describing the canonical entity-type categories&lt;br /&gt;
-- of the EveryCRT wiki, for use by third-party apps performing a full&lt;br /&gt;
-- or incremental sync of the wiki&amp;#039;s semantic data.&lt;br /&gt;
--&lt;br /&gt;
-- Public functions:&lt;br /&gt;
--   p.json(frame)  -- returns a pretty-printed JSON string describing&lt;br /&gt;
--                     the wiki and its entity types, with live page&lt;br /&gt;
--                     counts pulled from SMW.&lt;br /&gt;
--&lt;br /&gt;
-- See [[EveryCRT:Data API]] for full documentation and usage examples.&lt;br /&gt;
--&lt;br /&gt;
-- To add a new entity type to the API, add an entry to `entityTypes`&lt;br /&gt;
-- below. The category named here must exist (or be auto-populated by a&lt;br /&gt;
-- template, like Category:Documents) and contain all members of that&lt;br /&gt;
-- entity type.&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local API_URL  = &amp;#039;https://wiki.everycrt.com/w/api.php&amp;#039;&lt;br /&gt;
local BASE_URL = &amp;#039;https://wiki.everycrt.com&amp;#039;&lt;br /&gt;
&lt;br /&gt;
-- Canonical entity types. Each is enumerated via its MediaWiki category.&lt;br /&gt;
local entityTypes = {&lt;br /&gt;
	{&lt;br /&gt;
		key         = &amp;#039;crt_model&amp;#039;,&lt;br /&gt;
		label       = &amp;#039;CRT models&amp;#039;,&lt;br /&gt;
		category    = &amp;#039;CRT models&amp;#039;,&lt;br /&gt;
		description = &amp;#039;CRT monitors, televisions, and professional video displays.&amp;#039;,&lt;br /&gt;
	},&lt;br /&gt;
	{&lt;br /&gt;
		key         = &amp;#039;av_device&amp;#039;,&lt;br /&gt;
		label       = &amp;#039;AV devices&amp;#039;,&lt;br /&gt;
		category    = &amp;#039;AV devices&amp;#039;,&lt;br /&gt;
		description = &amp;#039;VCRs, TBCs, video mixers, switchers, and other vintage AV equipment.&amp;#039;,&lt;br /&gt;
	},&lt;br /&gt;
	{&lt;br /&gt;
		key         = &amp;#039;accessory&amp;#039;,&lt;br /&gt;
		label       = &amp;#039;Accessories&amp;#039;,&lt;br /&gt;
		category    = &amp;#039;Accessories&amp;#039;,&lt;br /&gt;
		description = &amp;#039;Remotes, cables, antennas, and other accessories.&amp;#039;,&lt;br /&gt;
	},&lt;br /&gt;
	{&lt;br /&gt;
		key         = &amp;#039;part&amp;#039;,&lt;br /&gt;
		label       = &amp;#039;Parts&amp;#039;,&lt;br /&gt;
		category    = &amp;#039;Parts&amp;#039;,&lt;br /&gt;
		description = &amp;#039;ICs, transistors, CRT tubes, flyback transformers, and other components.&amp;#039;,&lt;br /&gt;
	},&lt;br /&gt;
	{&lt;br /&gt;
		key         = &amp;#039;repair_service&amp;#039;,&lt;br /&gt;
		label       = &amp;#039;Repair services&amp;#039;,&lt;br /&gt;
		category    = &amp;#039;Repair services&amp;#039;,&lt;br /&gt;
		description = &amp;#039;Repair shops and technicians serving the vintage AV community.&amp;#039;,&lt;br /&gt;
	},&lt;br /&gt;
	{&lt;br /&gt;
		key         = &amp;#039;document&amp;#039;,&lt;br /&gt;
		label       = &amp;#039;Documents&amp;#039;,&lt;br /&gt;
		category    = &amp;#039;Documents&amp;#039;,&lt;br /&gt;
		description = &amp;#039;Manuals, brochures, spec sheets, service bulletins, and other reference documents.&amp;#039;,&lt;br /&gt;
	},&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
-- Returns the page count for a category by running #ask|format=count.&lt;br /&gt;
local function countCategory(frame, category)&lt;br /&gt;
	local raw = frame:preprocess(&lt;br /&gt;
		&amp;#039;{{#ask:[[Category:&amp;#039; .. category .. &amp;#039;]]|format=count}}&amp;#039;&lt;br /&gt;
	)&lt;br /&gt;
	if not raw then return 0 end&lt;br /&gt;
	local stripped = raw:gsub(&amp;#039;&amp;lt;[^&amp;gt;]+&amp;gt;&amp;#039;, &amp;#039;&amp;#039;):gsub(&amp;#039;^%s+&amp;#039;, &amp;#039;&amp;#039;):gsub(&amp;#039;%s+$&amp;#039;, &amp;#039;&amp;#039;)&lt;br /&gt;
	return tonumber(stripped) or 0&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Builds an action=ask URL that lists all pages of one entity type with&lt;br /&gt;
-- their last-modification timestamps -- suitable for indexing and for&lt;br /&gt;
-- driving incremental sync.&lt;br /&gt;
local function listUrl(category)&lt;br /&gt;
	local query = &amp;#039;[[Category:&amp;#039; .. category .. &amp;#039;]]|?Modification date|limit=500|offset=0&amp;#039;&lt;br /&gt;
	return API_URL .. &amp;#039;?action=ask&amp;amp;format=json&amp;amp;formatversion=2&amp;amp;query=&amp;#039; .. mw.uri.encode(query)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.json(frame)&lt;br /&gt;
	local types = {}&lt;br /&gt;
	for _, t in ipairs(entityTypes) do&lt;br /&gt;
		table.insert(types, {&lt;br /&gt;
			key          = t.key,&lt;br /&gt;
			label        = t.label,&lt;br /&gt;
			description  = t.description,&lt;br /&gt;
			category     = t.category,&lt;br /&gt;
			category_url = BASE_URL .. &amp;#039;/wiki/Category:&amp;#039; .. mw.uri.encode(t.category, &amp;#039;WIKI&amp;#039;),&lt;br /&gt;
			ask_query    = &amp;#039;[[Category:&amp;#039; .. t.category .. &amp;#039;]]&amp;#039;,&lt;br /&gt;
			count        = countCategory(frame, t.category),&lt;br /&gt;
			list_url     = listUrl(t.category),&lt;br /&gt;
		})&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local manifest = {&lt;br /&gt;
		version          = 1,&lt;br /&gt;
		generated_at_utc = os.date(&amp;#039;!%Y-%m-%dT%H:%M:%SZ&amp;#039;),&lt;br /&gt;
		wiki = {&lt;br /&gt;
			name     = &amp;#039;EveryCRT&amp;#039;,&lt;br /&gt;
			base_url = BASE_URL,&lt;br /&gt;
			api_url  = API_URL,&lt;br /&gt;
		},&lt;br /&gt;
		endpoints = {&lt;br /&gt;
			list_entities = {&lt;br /&gt;
				method = &amp;#039;GET&amp;#039;,&lt;br /&gt;
				url    = API_URL .. &amp;#039;?action=ask&amp;amp;format=json&amp;amp;formatversion=2&amp;amp;query=&amp;lt;ASK_QUERY&amp;gt;&amp;#039;,&lt;br /&gt;
				notes  = &amp;#039;Returns titles and selected printouts for entities matching the SMW ask query. Append |limit=N|offset=M for pagination (max limit 500).&amp;#039;,&lt;br /&gt;
			},&lt;br /&gt;
			entity_facts = {&lt;br /&gt;
				method = &amp;#039;GET&amp;#039;,&lt;br /&gt;
				url    = API_URL .. &amp;#039;?action=browsebysubject&amp;amp;format=json&amp;amp;formatversion=2&amp;amp;subject=&amp;lt;PAGE_TITLE&amp;gt;&amp;#039;,&lt;br /&gt;
				notes  = &amp;#039;Returns every SMW fact (property/value pair) for a single page, including subobjects (CRT inputs, outputs, voltage ranges, etc.).&amp;#039;,&lt;br /&gt;
			},&lt;br /&gt;
			recent_changes = {&lt;br /&gt;
				method = &amp;#039;GET&amp;#039;,&lt;br /&gt;
				url    = API_URL .. &amp;#039;?action=query&amp;amp;list=recentchanges&amp;amp;format=json&amp;amp;formatversion=2&amp;amp;rcprop=title%7Ctimestamp%7Cids%7Csizes%7Cuser&amp;amp;rclimit=500&amp;#039;,&lt;br /&gt;
				notes  = &amp;#039;Returns recent edits across all namespaces. Use rcend=&amp;lt;ISO timestamp&amp;gt; to fetch only changes since your last sync. Add &amp;amp;rcnamespace=N|N to filter by namespace.&amp;#039;,&lt;br /&gt;
			},&lt;br /&gt;
			rdf_export = {&lt;br /&gt;
				method = &amp;#039;GET&amp;#039;,&lt;br /&gt;
				url    = BASE_URL .. &amp;#039;/wiki/Special:ExportRDF?pages=&amp;lt;PAGE_TITLE&amp;gt;&amp;#039;,&lt;br /&gt;
				notes  = &amp;#039;Full RDF/OWL export. Use &amp;amp;recursive=1&amp;amp;pages=Category:CRT models to export an entire category subtree.&amp;#039;,&lt;br /&gt;
			},&lt;br /&gt;
		},&lt;br /&gt;
		entity_types = types,&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	local prettyFlag = mw.text.JSON_PRETTY or 0&lt;br /&gt;
	return mw.text.jsonEncode(manifest, prettyFlag)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Arclight-MCP-Bot</name></author>
	</entry>
</feed>