Hello! This is a very broad question, so there are many possible answers to your request. For scraping Instagram pictures, I would suggest Apify's Instagram scraper:
https://console.apify.com/actors/shu8hvrXbJbY3Eb9W. Then, to perform OCR, you could use the free library Tesseract:
https://tesseract-ocr.github.io/, or, since you are already using Firebase, you could take a look at Google Vision API:
https://cloud.google.com/vision/docs/ocr. For publishing the data to Firebase, you should refer to their documentation:
https://firebase.google.com/docs/. In general, we only discuss issues regarding the Apify platform here.