So looking at https://commons.wikimedia.org/w/api.php?action=help&modules=query+search:
srnamespace Search only within these namespaces. Values (separate with |): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 100, 101, 102, 103, 104, 105, 106, 107, 460, 461, 490, 491, 828, 829, 1198, 1199, 2300, 2301, 2302, 2303, 2600 Default: 0
Is there a way to search all namespaces? index.php can with profile=all, but it doesn't look like srnamespace has equivalent functionality. Similar to how we support a value of max in parts of the API, it might be nice to have an all-type value accepted for srnamespace.