I’m using the Python API, inheriting some code which is several years old.
One line grabs all projects:
response = self._client.projects.find_all(project_options)
project_options is a dictionary which specifies which fields to get, and the workspace ID.
I only care about projects which have existed since January 1st, 2022, but I’m getting tens of thousands of projects we don’t care about anymore. I can’t filter out archived projects since some projects we do care about are archived.
Filtering out all the projects takes a significant amount of time.
Is there a way I can get all projects within a certain date range?
Hi @Nicholas_Wackowski
If your code is several years old, it may have been written before the new “search api” was released.
You can now query using the “search” endpoint
Search tasks in a workspace – Asana
But, you will need to change your code a little bit, because the results are not paginated like it was in the previous endpoint (using offset), but they are sorted by date.
You can look at this thread I think for a sample call.
Python client library: using the Search API - Developers & API - Asana Community Forum
1 Like
Hi @Frederic_Malenfant
Thank you for the helpful answer, but I’m struggling to find a way to filter projects. I see your link allows for filtering based on task info, but I don’t see any options for filtering projects other than “workspace,” “archival,” or “team.” I don’t see a way I could get, for example, “all projects due after X date,” or “all projects within a delimited list of strings.”
Any advice?