# Get resources

> **Part of**: [resources](admin_api_resources.md) | [Admin API reference](admin_api.md)


Lists resources (assets) uploaded to your product environment.

#### Syntax
`GET /resources(/:resource_type(/:type))`

```multi
|ruby
Cloudinary::Api.resources(options = {})

|php_2
$api->assets($options = []);

|python
cloudinary.api.resources(**options)

|nodejs
cloudinary.v2.api.resources(options).then(callback);

|java
api.resources(Map options);

|csharp
cloudinary.ListResources(ListResourceParams params);

|go
resp, err := cld.Admin.Assets(ctx, admin.AssetsParams{})

|cli
cld admin resources 
```

#### Optional parameters
Parameter | Type | Description
---|---|---
resource\_type | String | The type of asset. Relevant as a parameter only when using the SDKs (the `resource_type` is included in the endpoint URL when using the REST API). **Note**: use `video` for all video and audio assets, such as .mp3. **Possible values**: `image`, `raw`, `video`. **Default**: image.  
type | String | The delivery type, relevant as a parameter only when using the SDKs (the `type` is included in the endpoint URL when using the REST API). **Possible values**: `upload`, `private`, `authenticated`, `fetch`, `facebook`, `twitter`, `gravatar`, `youtube`, `hulu`, `vimeo`, `animoto`, `worldstarhiphop`, `dailymotion`, `list`. **Default**: upload.   
prefix | String | Find all assets with a public ID that starts with the specified prefix. The assets are sorted by public ID in the response. **Note**: use this parameter to find public IDs with a `+` character in them.
public\_ids | String[] | An array of public IDs. Get assets with the specified public IDs (up to 100). **Note**: Not supported for SDKs. Instead use the `resources_by_ids` SDK method. This parameter doesn't support public IDs with a `+` character in them (use the `prefix` parameter to find the assets instead). 
max\_results | Integers |  Maximum number of assets to return (up to 500). **Default**: `10`. 
next\_cursor | String | When a request has more results to return than `max_results`, the `next_cursor` value is returned as part of the response. You can then specify this value as the `next_cursor` parameter of a following request.
start\_at | String | Get assets that were created since the specified timestamp (ISO 8601 format). Supported unless `prefix` or `public_ids` were specified. For example: `2020-12-01`
direction | String/Integer | Control the order of returned assets, according to the `created_at` date. **Note**: if a `prefix` is specified, this parameter is ignored and the results are sorted by public ID. **Possible values**: `desc` or `-1` (default), `asc` or `1`. fields | String | A comma-separated list of fields to include in the response.**Notes**:- This parameter takes precedence over other parameters requesting details in the response (e.g., `tags` or `context`), so include them in this list if you also want their details returned.  - The following fields are always included in the response: `public_id`, and `asset_id`.tags | Boolean | Whether to include the list of tag names assigned to each asset. **Default**: `false`.
context | Boolean | Whether to include key-value pairs of contextual metadata associated with each asset. **Default**: `false`.
metadata | Boolean | Whether to include the structured metadata fields and values assigned to each asset. **Default**: `false`.
moderation | Boolean| Whether to include the image moderation status of each asset. **Default**: `false`.

#### Examples
Get all images:

```multi
|curl
curl https://<API_KEY>:<API_SECRET>@api.cloudinary.com/v1_1/<cloud_name>/resources/image

|ruby
result = Cloudinary::Api
.resources

|php_2
$result = $api
->assets();

|python
result = cloudinary.api\
.resources()

|nodejs
cloudinary.v2.api
.resources()
.then(result=>console.log(result)); 

|java
result = api
.resources(ObjectUtils.emptyMap());

|csharp
result = cloudinary
.ListResources();

|go
resp, err := cld.Admin.Assets(ctx, admin.AssetsParams{})

|cli
cld admin resources
```

Get images of delivery type 'upload', up to a maximum of 30 results:

```multi
|curl
curl https://<API_KEY>:<API_SECRET>@api.cloudinary.com/v1_1/<cloud_name>/resources/image/upload

|ruby
result = Cloudinary::Api
.resources(
  type: "upload",
  max_results: 30)

|php_2
result = api
->assets(
  ["type" => "upload", "max_results" => 30]);

|python
result = cloudinary.api\
.resources(type = "upload", max_results = 30)

|nodejs
cloudinary.v2.api
.resources(
  { type: 'upload', max_results: 30 })
.then(result=>console.log(result)); 

|java
result = api
.resources(
  ObjectUtils.asMap("type", "upload", "max_results", 30));

|csharp
var listResourcesParams = new ListResourcesParams(){
  Type = "upload",
  MaxResults = 30};
var listResourcesResult = cloudinary.ListResources(listResourcesParams);

|go
resp, err := cld.Admin.Assets(ctx, admin.AssetsParams{
        DeliveryType:   "upload",
        MaxResults:     30})

|cli
cld admin resources type=upload
```

Get all uploaded images with a specified prefix:

```multi
|curl
curl https://<API_KEY>:<API_SECRET>@api.cloudinary.com/v1_1/<cloud_name>/resources/image/upload?prefix=sample

|ruby
result = Cloudinary::Api
.resources(
type: "upload", 
prefix: "sample")

|php_2
$result = $api
->assets([
  "type" => "upload", 
  "prefix" => "sample"]);

|python
result = cloudinary.api\
.resources(
type = "upload", 
prefix = "sample")

|nodejs
cloudinary.v2.api
.resources(
{ type: 'upload', 
  prefix: 'sample' })
.then(result=>console.log(result)); 

|java
result = api
.resources(
ObjectUtils.asMap(
  "type", "upload", 
  "prefix", "sample"));

|csharp
var listResourcesByPrefixParams = new ListResourcesByPrefixParams(){
  Type = "upload",
  Prefix = "sample"};
var listResourcesResult = cloudinary.ListResources(listResourcesByPrefixParams);

|go
resp, err := cld.Admin.Assets(ctx, admin.AssetsParams{
        DeliveryType: "upload",
        Prefix:       "sample"})

|cli
cld admin resources type=upload prefix=sample
```

Get Facebook images:

```multi
|curl
curl https://<API_KEY>:<API_SECRET>@api.cloudinary.com/v1_1/<cloud_name>/resources/image/facebook
 
|ruby
result = Cloudinary::Api
.resources(type: "facebook")

|php_2
$result = $api
>assets(["type" => "facebook"]);

|python
result = cloudinary.api\
.resources(type = "facebook")

|nodejs
cloudinary.v2
.api.resources(
  { type: 'facebook' })
.then(result=>console.log(result)); 

|java
result = api.resources(
  ObjectUtils.asMap("type", "facebook"));

|csharp
var listResourcesParams = new ListResourcesParams(){
  Type = "facebook"};
var listResourcesResult = cloudinary.ListResources(listResourcesParams);

|go
resp, err := cld.Admin.Assets(ctx, admin.AssetsParams{
        DeliveryType: "facebook"})

|cli
cld admin resources type=facebook
```

Get raw uploaded files:

```multi
|curl
curl https://<API_KEY>:<API_SECRET>@api.cloudinary.com/v1_1/<cloud_name>/resources/raw
       
|ruby
result = Cloudinary::Api
.resources(
  resource_type: "raw")

|php_2
$result = $api
->assets(["resource_type" => "raw"]);

|python
result = cloudinary.api\
.resources(resource_type = "raw")

|nodejs
cloudinary.v2.api
.resources(
  { resource_type: 'raw' })
.then(result=>console.log(result)); 

|java
result = api
.resources(
  ObjectUtils.asMap("resource_type", "raw"));

|csharp
var listResourcesParams = new ListResourcesParams(){
  ResourceType = "raw"};
var listResourcesResult = cloudinary.ListResources(listResourcesParams);

|go
resp, err := cld.Admin.Assets(ctx, admin.AssetsParams{
        AssetType:    "raw",
        DeliveryType: "upload"})

|cli
cld admin resources resource_type=raw
```
      
Get all uploaded images with the specified IDs:

```multi
|curl
curl https://<API_KEY>:<API_SECRET>@api.cloudinary.com/v1_1/<cloud_name>/resources/image/upload?public_ids[]=user_photo_1&public_ids[]=user_photo_2
        
|ruby
result = Cloudinary::Api
.resources_by_ids(["user_photo_1", "user_photo_2"])

|php_2
$result = $api
->assetsByIds(["user_photo_1", "user_photo_2"]);

|python
result = cloudinary\
.api.resources_by_ids(["user_photo_1", "user_photo_2"])

|nodejs
cloudinary.v2.api
.resources_by_ids(["user_photo_1", "user_photo_2"])
.then(result=>console.log(result)); 

|java
result = api
.resources_by_ids(Arrays.asList("user_photo_1", "user_photo_2"),
  ObjectUtils.emptyMap());

|csharp
var publicIds = new List<string>(){"user_photo_1", "user_photo_2" };
cloudinary.ListResourceByPublicIds(publicIds);

|go
resp, err := cld.Admin.AssetsByIDs(ctx, admin.AssetsByIDsParams{
      DeliveryType: "upload",
      PubicIDs:     []string{"user_photo_1", "user_photo_2"}})

|cli
cld admin resources_by_ids user_photo_1 user_photo2
```

#### Sample response
```json
{
  "resources": [
    {
      "asset_id": "ebfe9f427f4a6787ea00e00da9e67f9e",
      "public_id": "face_center",
      "format": "jpg",
      "version": 1719305903,
      "resource_type": "image",
      "type": "upload",
      "created_at": "2024-06-25T08:58:23Z",
      "bytes": 379132,
      "width": 1870,
      "height": 1250,
      "asset_folder": "",
      "display_name": "face_center",
      "url": "http://res.cloudinary.com/cld-docs/image/upload/v1719305903/face_center.jpg",
      "secure_url": "https://res.cloudinary.com/cld-docs/image/upload/v1719305903/face_center.jpg"
    },
    {
      "asset_id": "a13dc5a232a28c03bf5881ac39b94d2c",
      "public_id": "65646572251",
      "format": "jpg",
      "resource_type": "image",
      "type": "facebook",
      "created_at": "2024-06-25T09:01:30Z",
      "bytes": 0,
      "asset_folder": "",
      "display_name": "65646572251",
      "url": "http://res.cloudinary.com/cld-docs/image/facebook/65646572251.jpg",
      "secure_url": "https://res.cloudinary.com/cld-docs/image/facebook/65646572251.jpg"
    }
  ]
}
```

---
