You can write a script that stores the prefetched data into json files and use the json file in getStaticProps. Then you just need to run this script before generating the build.
During the development, if the file is not available, you'd hit the actual api.