Terraform Registry API
Query the public Terraform Registry for modules and providers, with versions, download counts and source repositories. No API key. Verified example included.
Endpoint tested and returned HTTP 200 on 2026-08-21
What is the Terraform Registry API?
The Terraform Registry has a documented public API. `GET https://registry.terraform.io/v1/modules?limit=2` lists published modules with their namespace, provider, version, source repository and download count. No API key or HashiCorp account is required for public reads.
Module identity in Terraform is a four-part coordinate, `namespace/name/provider/version`, and the API returns it pre-joined in the `id` field as well as broken into components. That is more helpful than it sounds, because the `source` argument in a Terraform configuration wants the first three parts joined with slashes while your UI probably wants them separate. Both forms in one response saves a round of string surgery.
The `verified` flag deserves attention if you are building anything that recommends modules. It means HashiCorp has confirmed the publisher, not that the module is audited, maintained or safe. Combine it with `published_at` and `downloads` to form a real judgement. Paging is offset-based and the response hands you a ready-made `meta.next_url`, so following the cursor is easier than constructing it.
Quick facts
- Base URL
https://registry.terraform.io/v1- Authentication
- Public modules and providers need no token. Private registries under Terraform Cloud require a bearer token, which is a separate API.
- Rate limit
- Not published for the public registry. Terraform's own CLI uses these endpoints, so behave like a well-mannered client and cache.
- Pricing
- Free for the public registry.
- CORS
- Not enabled — call it from your server
- Official docs
- Read the docs
How to use the Terraform Registry API
Every request below was executed against the live API on 2026-08-21, and the response shown is the real body it returned — not an illustration.
1. List published Terraform modules
GET https://registry.terraform.io/v1/modules?limit=2
curl 'https://registry.terraform.io/v1/modules?limit=2'const res = await fetch("https://registry.terraform.io/v1/modules?limit=2");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);import requests
res = requests.get("https://registry.terraform.io/v1/modules?limit=2", timeout=20)
res.raise_for_status()
print(res.json()){
"meta": {
"limit": 2,
"current_offset": 0,
"next_offset": 2,
"next_url": "https://registry.terraform.io/v1/modules?limit=2&offset=2"
},
"modules": [
{
"id": "GoogleCloudPlatform/lb-http/google/14.2.0",
"owner": "",
"namespace": "GoogleCloudPlatform",
"name": "lb-http",
"version": "14.2.0",
"provider": "google",
"provider_logo_url": "/images/providers/google-cloud.svg",
"description": "Creates a global HTTP load balancer for Compute Engine by using forwarding rules",
"source": "https://github.com/terraform-google-modules/terraform-google-lb-http",
"tag": "v14.2.0",
"published_at": "2026-01-15T00:10:36.13339Z",
"downloads": 11391763,
"verified": true
},
{
"id": "GoogleCloudPlatform/managed-instance-group/google/1.1.15",
"owner": "",
"namespace": "GoogleCloudPlatform",
"name": "managed-instance-group",
"version": "1.1.15",
"provider": "google",
"provider_logo_url": "/images/providers/google-cloud.svg",
"description": "Modular Google Compute Engine managed instance group for Terraform.",
"source": "https://github.com/GoogleCloudPlatform/terraform-google-managed-instance-group",
"tag": "1.1.15",
"published_at": "2019-02-14T16:55:26.567562Z",
"downloads": 179084,
"verified": true
}
]
}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | Optional | Results per page, up to the registry's maximum. 2 |
offset | integer | Optional | Zero-based offset for paging. `meta.next_offset` gives you the next value. 2 |
provider | string | Optional | Filter to modules for one provider, such as `aws`, `google` or `azurerm`. aws |
verified | boolean | Optional | Restrict results to publisher-verified modules. true |
/v1/modules/search | path | Optional | Search endpoint accepting a `q` parameter for free-text queries. ?q=vpc |
Response fields
metaobject- Paging state: `limit`, `current_offset`, `next_offset` and a prepared `next_url`. Follow `next_url` rather than building the query yourself.
modules[].idstring- Full coordinate `namespace/name/provider/version`. Strip the version to get the value for a Terraform `source` argument.
modules[].namespace / name / provider / versionstring- The coordinate split into parts. `provider` is the cloud the module targets, not the publisher.
modules[].sourcestring- Repository URL, almost always GitHub. This is where the code actually lives.
modules[].downloadsinteger- Cumulative download count. Useful as a popularity proxy, though it heavily favours older modules.
modules[].verifiedboolean- HashiCorp has verified the publisher. It is not a security or quality audit; treat it as identity only.
modules[].published_atstring- ISO 8601 publication timestamp of that version. Pair it with `downloads` to spot popular but stale modules.
modules[].ownerstring- Frequently an empty string rather than null, so test for emptiness, not for absence.
What you can build with the Terraform Registry API
- Check whether a module you depend on has a newer version before an upgrade
- Build an internal catalogue of approved Terraform modules
- Flag modules that have not been published to in years during an infrastructure review
- Resolve a module name to its source repository for a code review
- Compare module popularity when choosing between competing implementations
Common errors and how to fix them
404
The module path is wrong. The registry needs all three coordinate parts.
Fix: Use `/v1/modules/{namespace}/{name}/{provider}` for a specific module; two parts will not resolve.
Empty results with a provider filter
`provider` means the target cloud, not the publisher.
Fix: Filter on `aws` or `google`, not on the organisation that published the module.
Paging never advances
You reused the same `offset` value.
Fix: Read `meta.next_offset`, or simply request `meta.next_url`, which already carries the correct query string.
Terraform Registry API — frequently asked questions
Does the Terraform Registry API need a token?
Not for the public registry. Anonymous GET requests return modules and providers. Private registries in Terraform Cloud are a separate, authenticated API.
What does the verified flag actually mean?
That HashiCorp confirmed who publishes the module. It says nothing about code quality, maintenance or security, so do not present it as an endorsement.
How do I get the download URL for a module version?
The version endpoint returns a `X-Terraform-Get` header pointing at the source archive. For most purposes the `source` repository URL in the listing is what you want.
Can I query providers as well as modules?
Yes. `/v1/providers` mirrors the module endpoints and returns provider metadata, versions and supported platforms.
Tools that pair with this API
JSON Formatter
Format, beautify and minify JSON online with 2-space, 4-space or tab indentation. Sort keys alphabetically and catch syntax errors instantly — free and private.
JSON Viewer
View JSON as a collapsible interactive tree online. Expand and collapse nodes, search keys and values, and copy the JSONPath of any node privately.
JSON to CSV Converter
Convert a JSON array of objects to CSV online. Automatic column headers from the union of all keys, delimiter choice and proper quoting — all in-browser.
Timestamp Converter
Convert timestamps to human-readable dates and dates back to timestamps. Auto-detects seconds vs milliseconds, shows local, UTC and ISO 8601 formats.
Terraform Registry is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-21; always check the official documentation before relying on this API in production, as terms and limits can change.