ProcessWire comes with the best CMS API in the business. Not only is it easy to use, but it's a joy to develop with.

Once you start developing a site with ProcessWire, not only will you accomplish a lot in little time, but you'll have a ton of fun doing it. No other CMS API can match the power and enjoyment found in ProcessWire's API. ProcessWire's API puts the entire site's content at the developers fingertips with a unique and straightforward object-oriented interface, making it surprisingly fast and easy to develop anything you can imagine.

// output page headline (or title, if no headline)
echo "<h1>" . $page->get('headline|title') . "</h1>";

// get phone number from contact page and output it
$contact = $pages->get('/about/contact/');
echo "Call us at $contact->phone";

// find 3 newest products and list them
$products = $pages->find("template=product, sort=-created, limit=3");
echo $products->each("<li><a href='{url}'>{title}</a>");

// populates the <title> tag, no matter where we output this*
echo "<title>$page->title</title>";

*Using Markup Regions

API variables

ProcessWire provides several API variables to your template files, such as $page, $pages, $user, $input, $fields, $files and more. Each of the API variables provides access to content or other helpful tools. For example, the $page API variable provides the ability to get (or set) the content from the current page being viewed, while the $pages API variable provides the ability to find and load any other pages in the site. See all API variables and read more about API variables

Selectors

Selectors are simple strings of text that specify fields and values. These selectors are used throughout ProcessWire to find pages (and other types of data). For example, the selector name=hanna is a simple selector that says: “find items that have the name Hanna.” Selectors in ProcessWire are loosely based around the idea and syntax of attribute selectors in Javascript and jQuery in particular, but are even more powerful. More about selectors

// find pages matching selectors 
$items = $pages->find("year=2010, body*=Hanna");
$smiths = $pages->find("last_name=Smith");
$colors = $pages->find("title~=Red|Blue|Green");
$buildings = $pages->find("height>500, year_built>=2025");

See also: Hooks, Selector operators