{"id":17798965,"url":"https://github.com/icy/cloudflare_api","last_synced_at":"2025-07-15T13:17:34.961Z","repository":{"id":139397366,"uuid":"199062197","full_name":"icy/cloudflare_api","owner":"icy","description":"Cloudflare API v4 binding in Bash4","archived":false,"fork":false,"pushed_at":"2019-07-26T19:41:30.000Z","size":15,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-27T21:21:24.162Z","etag":null,"topics":["bash","cloudflare-api"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/icy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-26T18:20:06.000Z","updated_at":"2021-04-03T15:31:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"25906dd4-3c15-4dab-b845-f472bbe580c2","html_url":"https://github.com/icy/cloudflare_api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icy%2Fcloudflare_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icy%2Fcloudflare_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icy%2Fcloudflare_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icy%2Fcloudflare_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/icy","download_url":"https://codeload.github.com/icy/cloudflare_api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243852484,"owners_count":20358271,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","cloudflare-api"],"created_at":"2024-10-27T12:03:44.020Z","updated_at":"2025-03-17T05:32:02.555Z","avatar_url":"https://github.com/icy.png","language":"Shell","readme":"## Table of contents\n\n1. [Description](#description)\n1. [Author](#author)\n1. [License](#license)\n1. [Examples](#examples)\n1. [Tips](#tips)\n1. [FIXME](#fixme)\n\n## Description\n\nA `Bash` binding of Cloudflare API https://api.cloudflare.com/.\nRequire `Bash4`, `perl-json`.\n\n## Author\n\nAnh K. Huynh.\n\n## License\n\nThe work is released under a MIT license.\n\n## Examples\n\n````\n# Without Bearer token, you need to set up two variables\n$ export CF_KEY_FILE=./my_api_key.private\n$ export CF_EMAIL=john@example.net\n\n# Alternatively, you can use CF_BEARER_TOKEN instead of those two variables\n$ export CF_BEARER_TOKEN=....\n\n# List all of my domains\n$ ./cloudflare_api.sh _cf_zone_get_entries | json_pp\n\n# Get information of a domain\n$ ./cloudflare_api.sh _cf_zone_get_entry example.net | json_pp\n\n# Return the identify of a domain\n$ ./cloudflare_api.sh _cf_zone_get_entry_id example.net\n\n$ export CF_ZONE_ID=foobar # result return from the above step\n\n$ ./cloudflare_api.sh _cf_zone_dns_get_simple_list\n# Or equivalently\n# ./cloudflare_api.sh _cf_zone_dns_get_simple_list --zone_id $CF_ZONE_ID\n\n# Create an dns entry\n$ ./cloudflare_api.sh _cf_zone_dns_create_entry \\\n    --zone_id $CF_ZONE_ID \\\n    --name \"foo.example.net\" \\\n    --ttl 1 \\\n    --type CNAME \\\n    --value \"bar.example.net\"\n\n$ ./cloudflare_api.sh _cf_zone_dns_get_entry \\\n    --zone_id $CF_ZONE_ID \\\n    --name \"foo.example.net\"\n\n# Enable proxying\n$ ./cloudflare_api.sh _cf_zone_dns_update_entry \\\n    --zone_id $CF_ZONE_ID \\\n    --name \"foo.example.net\" \\\n    --proxied true\n\n# Purging cache\n$ ./cloudflare_api.sh _cf_cache_purge_all \\\n    --zone_id $CF_ZONE_ID\n\n# Purge some URIs\n$ ./cloudflare_api.sh _cf_purge_uri \\\n    --zone_id $CF_ZONE_ID \\\n    http://example.net/foo \\\n    http://example.net/bar \\\n    ...\n````\n\n## Tips\n\n1. Use `--debug true` option to see how `curl` sends request(s) to Cloudflare.\n1. If `--zone_id` option is not specified, the `CF_ZONE_ID` environment is used.\n1. Sourcing and noop would help to set up some variables like `CF_ZONE_ID`.\n   For example,\n\n        source cloudflare_api.sh : \"$@\"\n        # Now CF_ZONE_ID is exported.\n        # See details in `_cf_check` and `__cf_detect_arg`\n\n## FIXME\n\n1. Ability to specify `--entry_id` when updating / listing\n1. Not work with entry that has multiple DNS properties (`A`, `MX`, ...)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficy%2Fcloudflare_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficy%2Fcloudflare_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficy%2Fcloudflare_api/lists"}