Skip to main content

Python client for CloudFlare.

Project description

Build Status

A Python client for CloudFlare API v4 and Host API.

It provides two levels of integration against the CloudFlare API:

  1. A low level API, with one method per API endpoint (
  2. A high level ORM API (pycloudflare.models).

Only a subset of the CloudFlare API is currently supported:

  • Users
  • Zones
  • Zone Settings
  • DNS Records
  • Page Rules
  • User creation & authentication through CloudFlare’s partner-facing Host API.


Get all our zones at CloudFlare

>>> cf = CloudFlareService(api_key, email)
>>> for domain in cf.get_zones():
>>>     print domain['name'], domain['id']


The Host (Partner) API service client is configured when it is instantiated and reads its configuration from configuration.json.

The configuration file should be in the format:

    "common": {
        "cloudflare": {
            "api_key": "HOST API KEY HERE",


Install development requirements:

pip install -r requirements.txt

Tests can then be run by doing:


The integration tests require a host API key. They can be run with:

nosetests tests/

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pycloudflare-2.3.0.tar.gz (15.8 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page