iu-redcap / phpcap
PHP library for accessing the REDCap API
1.5.4
2026-03-10 15:33 UTC
Requires
- php: >=5.6.0
- ext-curl: *
- ext-openssl: *
Requires (Dev)
- erusev/parsedown: 1.8.0
- phpstan/phpstan: 2.1.40
- phpunit/phpunit: 13.0.5
- smalot/pdfparser: 2.12.3
- squizlabs/php_codesniffer: 4.0.1
- dev-master
- 1.5.4
- 1.5.3
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.0
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 0.3.4
- 0.3.3
- 0.3.2
- 0.3.1
- 0.3.0
- 0.2.0
- 0.1.1
- 0.1.0
- dev-develop
- dev-phpstan
- dev-2024-update-1
- dev-redcap-12.4-changes
- dev-file-info
- dev-nal3
- dev-api-doc
- dev-nal2
- dev-nal1
This package is auto-updated.
Last update: 2026-03-10 16:16:13 UTC
README
PHPCap
PHPCap is a PHP API (Application Programming Interface) for REDCap, that lets you:
- export/import/delete data in REDCap
- export/import/delete project information (e.g., field names and types) in REDCap
PHPCap makes accessing REDCap from a PHP program easier by providing:
- a high-level interface
- improved error checking
REDCap is a web application for building and managing online surveys and databases. For information about REDCap, please see http://www.project-redcap.org.
Developers: Jim Mullen; Andy Arenson, aarenson@iu.edu
Requirements
To use PHPCap, you need to have:
- A computer with PHP 5.6 or later installed, and PHP needs to have cURL and OpenSSL enabled.
- An account on a REDCap site.
- API token(s) for the project(s) you want to access. API tokens need to be requested within the REDCap system.
Example
<?php require_once('PHPCap/autoloader.php'); use IU\PHPCap\RedCapProject; $apiUrl = 'https://redcap.someplace.edu/api/'; $apiToken = '273424CC67263B849E41CCD2134F37C3'; $project = new RedCapProject($apiUrl, $apiToken); # Print the project title $projectInfo = $project->exportProjectInfo(); print "project title: ".$projectInfo['project_title']."\n"; # Print the first and last names for all records $records = $project->exportRecords(); foreach ($records as $record) { print $record['first_name']." ".$record['last_name']."\n"; } ?>
Documentation
For more information, see:
- PHPCap user documentation: https://iuredcap.github.io/phpcap
- PHPCap API reference: https://iuredcap.github.io/phpcap/api/namespaces/iu-phpcap.html