Back to Browse

building an API-based scraping service from scratch #3

204 views
Apr 7, 2025
28:22

In this tutorial, we'll guide you through building a robust web scraping service using FastAPI, a modern and high-performance web framework for Python. By the end of this tutorial, you’ll have a comprehensive understanding of how to build a secure and efficient web scraping service using FastAPI and MongoDB, ensuring users can access scraping functionalities while managing their accounts and subscriptions effectively. This guide will enhance your skills in building scalable web scraping APIs, making your service both secure and efficient. In the database.py file, the operations are handled through functions that interact directly with the MongoDB database. When a user registers, their data is inserted into the database via the RegisterToDB() function. For user authentication, the FindUserByEmail() and FindUserByAPIKey() functions search the database for a user’s credentials. The UpdateUserByEmail() function allows you to update a user’s subscription plan, credits, and expiry date, while the DecreaseBlance() function decreases the user’s credit balance when they make a scraping request. 🔗 Website used for APIs 👉 https://scrapeasap.com/ 🚀 Join the Telegram community for your questions 👉 https://t.me/webscrapingpy 🎓 Check out my FREE web scraping course 👉 https://codematetv.com/courses/web-scraping-for-infants-your-first-steps-with-python-and-requests/ 🔗 GitHub Repository: https://github.com/itishosseinian/scraping_service.git buy me a coffee! ☕️ https://codematetv.com/donate 00:00 - Introduction 00:18 - what we have done so far 01:52 - Connecting to MongoDB 06:18 - Registration operation for MongoDB 07:30 - Finding users by email in database 08:10 - Finding users by Apikey in database 08:53 - Updating users plan in MongoDB using their emails 10:55 - Charging user in database using their Apikey 27:50 - final code for this episode + a little talk #Webscraping #datascraping #Python #automation #fastapi

Download

0 formats

No download links available.

building an API-based scraping service from scratch #3 | NatokHD