---
title: List D1 Databases
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/go)

[D1](https://developers.cloudflare.com/api/go/resources/d1)

[Database](https://developers.cloudflare.com/api/go/resources/d1/subresources/database)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# List D1 Databases

client.D1.Database.List(ctx, params) (\*V4PagePaginationArray\[[DatabaseListResponse](<https://developers.cloudflare.com/api/go/resources/d1#(resource)%20d1.database%20%3E%20(model)%20DatabaseListResponse%20%3E%20(schema)>)], error)

GET/accounts/{account\_id}/d1/database

List D1 databases in your account.

##### Security

<details>

<summary>API Token</summary>



The preferred authorization scheme for interacting with the Cloudflare API. <a href="https://developers.cloudflare.com/fundamentals/api/get-started/create-token/">Create a token</a>.

**Example:**<code>Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY</code>

</details>

<details>

<summary>API Email + API Key</summary>



The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

**Example:**<code>X-Auth-Email: user@example.com</code>

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

**Example:**<code>X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194</code>

</details>

##### Accepted Permissions (at least one required)

`D1 Read``D1 Write`

##### ParametersExpand Collapse

<details>

<summary>

params DatabaseListParams

</summary>

AccountID param.Field\[string]

Path param: Account identifier tag.

maxLength32

<a href="#(resource)%20d1.database%20%3E%20(method)%20list%20%3E%20(params)%20default%20%3E%20(param)%20account_id">Link to this property</a>

Name param.Field\[string]Optional

Query param: a database name to search for.

<a href="#(resource)%20d1.database%20%3E%20(method)%20list%20%3E%20(params)%20default%20%3E%20(param)%20name">Link to this property</a>

Page param.Field\[float64]Optional

Query param: Page number of paginated results.

minimum1

<a href="#(resource)%20d1.database%20%3E%20(method)%20list%20%3E%20(params)%20default%20%3E%20(param)%20page">Link to this property</a>

PerPage param.Field\[float64]Optional

Query param: Number of items per page.

maximum10000

minimum10

<a href="#(resource)%20d1.database%20%3E%20(method)%20list%20%3E%20(params)%20default%20%3E%20(param)%20per_page">Link to this property</a>

</details>

[Link to this property](<#(resource)%20d1.database%20%3E%20(method)%20list%20%3E%20(params)%20default>)

##### ReturnsExpand Collapse

<details>

<summary>

type DatabaseListResponse struct{…}

</summary>

CreatedAt TimeOptional

Specifies the timestamp the resource was created as an ISO8601 string.

formatdate-time

<a href="#(resource)%20d1.database%20%3E%20(model)%20DatabaseListResponse%20%3E%20(schema)%20%3E%20(property)%20created_at">Link to this property</a>

<details>

<summary>

Jurisdiction DatabaseListResponseJurisdictionOptional

Specify the location to restrict the D1 database to run and store data. If this option is present, the location hint is ignored.

</summary>

One of the following:

const DatabaseListResponseJurisdictionEu DatabaseListResponseJurisdiction = "eu"

<a href="#(resource)%20d1.database%20%3E%20(model)%20DatabaseListResponse%20%3E%20(schema)%20%3E%20(property)%20jurisdiction%20%3E%20(member)%200">Link to this property</a>

const DatabaseListResponseJurisdictionFedramp DatabaseListResponseJurisdiction = "fedramp"

<a href="#(resource)%20d1.database%20%3E%20(model)%20DatabaseListResponse%20%3E%20(schema)%20%3E%20(property)%20jurisdiction%20%3E%20(member)%201">Link to this property</a>

const DatabaseListResponseJurisdictionUs DatabaseListResponseJurisdiction = "us"

<a href="#(resource)%20d1.database%20%3E%20(model)%20DatabaseListResponse%20%3E%20(schema)%20%3E%20(property)%20jurisdiction%20%3E%20(member)%202">Link to this property</a>

</details>

<a href="#(resource)%20d1.database%20%3E%20(model)%20DatabaseListResponse%20%3E%20(schema)%20%3E%20(property)%20jurisdiction">Link to this property</a>

Name stringOptional

D1 database name.

<a href="#(resource)%20d1.database%20%3E%20(model)%20DatabaseListResponse%20%3E%20(schema)%20%3E%20(property)%20name">Link to this property</a>

UUID stringOptional

D1 database identifier (UUID).

<a href="#(resource)%20d1.database%20%3E%20(model)%20DatabaseListResponse%20%3E%20(schema)%20%3E%20(property)%20uuid">Link to this property</a>

Version stringOptional

<a href="#(resource)%20d1.database%20%3E%20(model)%20DatabaseListResponse%20%3E%20(schema)%20%3E%20(property)%20version">Link to this property</a>

</details>

[Link to this property](<#(resource)%20d1.database%20%3E%20(model)%20DatabaseListResponse%20%3E%20(schema)>)

### List D1 Databases

Go

HTTPTypeScriptPythonGoTerraform

```
package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/d1"
  "github.com/cloudflare/cloudflare-go/option"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  page, err := client.D1.Database.List(context.TODO(), d1.DatabaseListParams{
    AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
```

200 example

```
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": [
    {
      "created_at": "2022-11-15T18:25:44.442097Z",
      "jurisdiction": "eu",
      "name": "my-database",
      "uuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "version": "production"
    }
  ],
  "success": true,
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000
  }
}
```

##### Returns Examples

200 example

```
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": [
    {
      "created_at": "2022-11-15T18:25:44.442097Z",
      "jurisdiction": "eu",
      "name": "my-database",
      "uuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "version": "production"
    }
  ],
  "success": true,
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000
  }
}
```