Is there a reason Midjourney does not have an API?
Of course automating image generation via any means (including the private api) goes against tos for good reason, I have never misused the api to generate images and have no plans to.
However I do use the api to download all my images and their metadata including prompts. Using the API I sync every image grid + 'upscaled' I have ever generated, generate a json file with all metadata including the full prompt and then use that to build my local archive.