<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://70.231.62.181/index.php?action=history&amp;feed=atom&amp;title=MyWiki%3AWikiProject_User_scripts%2FScripts%2FPage_exists</id>
	<title>MyWiki:WikiProject User scripts/Scripts/Page exists - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://70.231.62.181/index.php?action=history&amp;feed=atom&amp;title=MyWiki%3AWikiProject_User_scripts%2FScripts%2FPage_exists"/>
	<link rel="alternate" type="text/html" href="http://70.231.62.181/index.php?title=MyWiki:WikiProject_User_scripts/Scripts/Page_exists&amp;action=history"/>
	<updated>2026-04-23T01:24:51Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>http://70.231.62.181/index.php?title=MyWiki:WikiProject_User_scripts/Scripts/Page_exists&amp;diff=23438718&amp;oldid=prev</id>
		<title>imported&gt;Andrybak: add links to documentation</title>
		<link rel="alternate" type="text/html" href="http://70.231.62.181/index.php?title=MyWiki:WikiProject_User_scripts/Scripts/Page_exists&amp;diff=23438718&amp;oldid=prev"/>
		<updated>2024-06-08T00:29:56Z</updated>

		<summary type="html">&lt;p&gt;add links to documentation&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;/*&lt;br /&gt;
 * Returns a boolean: whether or not the page with the specified title exists or not.&lt;br /&gt;
 *&lt;br /&gt;
 * Keywords for search: check page existence, page is missing.&lt;br /&gt;
 *&lt;br /&gt;
 * Reference documentation:&lt;br /&gt;
 *   - for JS class Api: https://doc.wikimedia.org/mediawiki-core/REL1_41/js/#!/api/mw.Api&lt;br /&gt;
 *   - for action=query requests:&lt;br /&gt;
 *     - https://www.mediawiki.org/wiki/API:Query&lt;br /&gt;
 *     - https://en.wikipedia.org/w/api.php?action=help&amp;amp;modules=query&lt;br /&gt;
 */&lt;br /&gt;
async function pageExists(title) {&lt;br /&gt;
	const api = new mw.Api();&lt;br /&gt;
	const response = await api.get({&lt;br /&gt;
		&amp;quot;action&amp;quot;: &amp;quot;query&amp;quot;,&lt;br /&gt;
		&amp;quot;format&amp;quot;: &amp;quot;json&amp;quot;,&lt;br /&gt;
		&amp;quot;titles&amp;quot;: title&lt;br /&gt;
	});&lt;br /&gt;
	const missing = &amp;quot;missing&amp;quot; in Object.values(response.query.pages)[0];&lt;br /&gt;
	return !missing;&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>imported&gt;Andrybak</name></author>
	</entry>
</feed>