> For the complete documentation index, see [llms.txt](https://docs.cspr.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cspr.cloud/1.1.x/rest-api/contract-package/get-contract-packages.md).

# Get contract packages

Get a paginated list of contract packages.

```
GET /contract-packages
```

This endpoint allows you to retrieve a paginated list of contract packages. You can filter the results by owner public key, specify the page number and size, and choose the sorting order and field. Additionally, you can include optional deploys number data in the response. The example shows a sample response with relevant details for each contract package, including contract package hash, owner public key, name, description, metadata, latest version contract type ID, timestamp, icon URL, and deploys number.

## Query params

| Query param        | Description              |
| ------------------ | ------------------------ |
| `owner_public_key` | Owner public key filter. |

## Sorting

| Property    | Description                          |
| ----------- | ------------------------------------ |
| `timestamp` | Sort contract packages by timestamp. |

Default sorting is `timestamp DESC`

## Optional properties

| Property         | Type  | Description                                                                                                                                                                                            |
| ---------------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `deploys_number` | `int` | Number of deploys in the specified number of the past days. It's a [function includer](/1.1.x/documentation/overview/optional-properties.md#functions) that accepts the number of days as an argument. |

## Response

[`PaginatedResponse`](/1.1.x/documentation/overview/pagination.md)[`<ContractPackage>`](/1.1.x/rest-api/contract-package.md)

## Example

```bash
curl -X 'GET' \
  'https://api.testnet.cspr.cloud/contract-packages' \
  -H 'Accept: application/json' \
  -H 'Authorization: 55f79117-fc4d-4d60-9956-65423f39a06a'
```

```json
{
  "data": [
    {
      "contract_package_hash": "ae2feaa4e86841c1c6f40f1779e1e1cb1d9d4d52a0eb82a8962829646524e744",
      "owner_public_key": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01",
      "name": "MyContractPackage1",
      "description": "A sample contract package",
      "metadata": {
        "name": "MyToken1",
        "symbol": "MT1",
        "decimals": 18,
        "balances_uref": "uref-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef-007",
        "total_supply_uref": "uref-abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef-007",
        "ownership_mode": 1,
        "nft_kind": 2,
        "nft_metadata_kind": 1,
        "whitelist_mode": 0,
        "holder_mode": 1,
        "minting_mode": 2,
        "burn_mode": 1,
        "identifier_mode": 0,
        "metadata_mutability": 1,
        "owner_reverse_lookup_mode": 1,
        "events_mode": 2
      },
      "latest_version_contract_type_id": 3,
      "timestamp": "2023-01-01T12:00:00Z",
      "icon_url": "https://example.com/icon1.png",
      "deploys_number": 42
    },
    {
      "contract_package_hash": "be2feaa4e86841c1c6f40f1779e1e1cb1d9d4d52a0eb82a8962829646524e745",
      "owner_public_key": "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
      "name": "MyContractPackage2",
      "description": "Another sample contract package",
      "metadata": {
        "name": "MyToken2",
        "symbol": "MT2",
        "decimals": 18,
        "balances_uref": "uref-abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef-007",
        "total_supply_uref": "uref-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef-007",
        "ownership_mode": 1,
        "nft_kind": 2,
        "nft_metadata_kind": 1,
        "whitelist_mode": 0,
        "holder_mode": 1,
        "minting_mode": 2,
        "burn_mode": 1,
        "identifier_mode": 0,
        "metadata_mutability": 1,
        "owner_reverse_lookup_mode": 1,
        "events_mode": 2
      },
      "latest_version_contract_type_id": 4,
      "timestamp": "2023-01-02T12:00:00Z",
      "icon_url": "https://example.com/icon2.png",
      "deploys_number": 56
    },
    ...
  ],
  "item_count": 100,
  "page_count": 10
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.cspr.cloud/1.1.x/rest-api/contract-package/get-contract-packages.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
