Wordpress and the Factual API
Alert: We are sun-setting access to the V3 APIs (Read, Schema, Facets, Submit). Learn more.
This page serves to help you access the Factual API from within your own instance of WordPress. You can use Factual’s PHP driver along with WordPress to access Factual data for use with your site.
What you’ll need
You’ll need three things to get started:
- An instance of WordPress
- The Factual PHP driver
- A Factual API Key
Install the driver
- Download the zip archive of the driver from Factual or git clone from https://github.com/Factual/factual-php-driver and then zip archive it yourself.
- Go to the plugins page of the Wordpress Manager (/wordpress/wp-admin/plugins.php)
- Click Add New
- Click Upload
- Select the .zip archive of the driver (note: the plug-in manager will ONLY accept .zip files)
- Click Activate Plugin
- Create a test page, something like this:
- Make sure you’ve put your own key and secret when you create the $factual object.
- Make sure the import path matches the path to your plugin.
- You’ll need to pass a zip parameter to the URL with a US postcode.
Assuming everything is configured correctly, your new webpage should look like this: