Roboflow API - how to use filters | download list of images per project

In general I have 5 projects under my private workspace. I want to download the list of files which were uploaded to Dataset and those in annotating process.

The problem is I can’t get Roboflow API to work.

For this example let’s use those VARs:

WORKSPACE=private-workspace-123
PROJECT=example-project
PROJECT_URL_1=https://app.roboflow.com/private-workspace-123/example-project
PROJECT_URL_2=app.roboflow.com/private-workspace-123/example-project
PROJECT_URL_3=private-workspace-123/example-project
PROJECT_URL_4=example-project

API_TOKEN=3j5hj534h5j

Based on documentation: Workspace Image Query | Roboflow Docs I tried to create my own query:

curl --location 'https://api.roboflow.com/private-workspace-123/search/v1?api_key= 3j5hj534h5j' --header 'Content-Type: application/json' --data '{"query": "project: PROJECT_URL_{no}", "pageSize": 100, "fields": ["filename", "tags"]}

Results in (I also tried other versions of that url like /browse or with http://):

Internal Server Error%                                                                                                                     

curl --location 'https://api.roboflow.com/private-workspace-123/search/v1?api_key= 3j5hj534h5j' --header 'Content-Type: application/json' --data '{"query": "project:example-project", "pageSize": 100, "fields": ["filename", "tags"]}

Results in always full list of images in all projects:

  ],
    "total": 10775,
    "continuationToken": "WzE3Mjg5NDEyODdd"
}%    

And I cannot find any possible key added to fields that would return the name of project (so I could post process results for only project I’m interested in)

I found out also a second API:

curl --location 'https://api.roboflow.com/private-workspace-123/example-project/search?api_key= 3j5hj534h5j' --header 'Content-Type: application/json' --data '{"in_dataset": "true","pageSize": 500, "fields": ["name", "tags"]}'

it returns perfectly images from that project but ONLY 50 max and the response doesn’t have e.g. {"continuationToken": "WzE3Mjg5NDEyODdd"} so I cannot get to the second page.

In general, is it a bug or it’s a feature?

Hi, looking into it, will report back! :slight_smile:

Try removing the space between project: and PROJECT_URL_{no}

But I never had any space between key “project:project_url” in original requests.

Could you give me please example based on my real project URL?

curl --location 'https://api.roboflow.com/truebuilt-software-sxnvw/search/v1?api_key=3j5hj534h5j' --header 'Content-Type: application/json' --data '{"query": "project:tagsearch-detection", "pageSize": 100, "fields": ["filename", "tags"]}'

or

curl --location 'https://api.roboflow.com/truebuilt-software-sxnvw/search/v1?api_key=3j5hj534h5j' --header 'Content-Type: application/json' --data '{"query": "project:app.roboflow.com/truebuilt-software-sxnvw/tagsearch-detection", "pageSize": 100, "fields": ["filename", "tags"]}'

or

curl --location 'https://api.roboflow.com/truebuilt-software-sxnvw/search/v1?api_key=3j5hj534h5j' --header 'Content-Type: application/json' --data '{"query": "project:https://app.roboflow.com/truebuilt-software-sxnvw/tagsearch-detection", "pageSize": 100, "fields": ["filename", "tags"]}'

because I’m losing my mind and nothing is working. Always it return the full list of files

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.