There can be several approaches for solving this problem
You can fetch all products in a single call or in multiple calls according to your use-case
for example, you want to fetch 2k records in a single call
products = wcapi.get('products', params={'per_page': 2000, 'stock_status': 'instock', 'tag': '1111', 'page': page}).json()
But the above approach is not good enough as the number of products may vary from time to time, therefore limiting products to be fetched is not a good solution for the long run.
Hence the better solution is to fetch the product details by multiple calls
page = 1 #The first page number to loop is page 1
products = []
while True:
prods = wcapi.get('products', params={'per_page': 100, 'stock_status': 'instock', 'tag': '1111', 'page': page}).json()
page += 1
if not prods:
break
products.append(prods)
After fetching all the product list you can fetch the product_ids like
product_ids = [product['id'] for product in products]