Fssai Scraper
Pricing
$5.00/month + usage
Fssai Scraper
Validates FSSAI license numbers using the FoSCoS API with AES-128-ECB encrypted communication. Retrieves CSRF tokens via Playwright, decrypts responses, and returns structured JSON with license details like business name, address, status, and category.
Pricing
$5.00/month + usage
Rating
5.0
(3)
Developer
ScrapeAI
Actor stats
0
Bookmarked
2
Total users
1
Monthly active users
a month ago
Last modified
Categories
Share
๐ฝ๏ธ FSSAI License Checker
This repository contains an Apify Actor designed to validate FSSAI (Food Safety and Standards Authority of India) license numbers using the FoSCoS API.
The actor performs encrypted communication identical to the official FoSCoS portal, decrypts the server responses, and produces structured JSON output.
โญ Highlights
๐ AES-128-ECB encryption/decryption identical to FoSCoS
๐ CSRF token & cookie extraction using Playwright
๐ Parses complete license details (business name, category, address, status)
๐ Automatic retry system with exponential backoff
๐ Structured JSON output compatible with Apify datasets
โ๏ธ Fully integrated with Apify environment
๐งพ Debug support โ saves encrypted payloads and responses
โ๏ธ Input Configuration
The actor accepts the following parameters:
Name Type Required Default Description licenseNumbers Array
๐ Sample Inputs
Single License
{"licenseNumbers": ["12416006000141"]}
Multiple Licenses
{"licenseNumbers": ["12416006000141","12418012002769"]}
Using Apify Proxy
{"licenseNumbers": ["12416006000141"],"proxyConfiguration": {"useApifyProxy": true,"apifyProxyGroups": ["RESIDENTIAL"],"apifyProxyCountry": "IN"}}
๐ฆ Output Format
Each processed license produces one JSON record stored in the default Apify dataset.
Field Type Description license_no String 14-digit FSSAI license number success Boolean Verification result data Object License details returned from FoSCoS data.premiseaddress String Business address data.licenseno String License number data.licensecategoryname String License category data.statename String State data.statusdesc String License status data.companyname String Business name data.districtname String District data.talukname String Taluk data.premisepincode Number PIN code
๐งช Example Output
โ Successful Lookup
{"license_no": "12416006000141","success": true,"data": {"premiseaddress": "738 A4, BALASAMUTHIRAM ROAD, MAYILADUMPARAI, SIVAGIRIPATTI, PALANI","licenseno": "12416006000141","licensecategoryname": "State License","statename": "Tamil Nadu","statusdesc": "License Issued","licensecategoryid": 2,"talukname": "Palani block","districtname": "Dindigul","companyname": "SRI KANDA VILAS VIBUTHI STORE","licenseactiveflag": true,"refid": 105751480,"villagename": null,"premisepincode": 624601}}
โ Failed Lookup
{"license_no": "12416006000141","success": false,"error": "License not found"}
๐งฉ Project Components
๐ Encryption Module
Implements FoSCoS AES-128-ECB encryption with custom key derivation arrays.
๐ Browser Automation
Playwright launches a browser session to retrieve the CSRF token and HTTP-only cookies.
๐ก HTTP Client
Uses Axios (or Apify Request API) to send encrypted payloads.
๐ Retry Engine
Retries each license lookup up to three times using exponential backoff.
๐ Logging
Stores encrypted payloads, responses, and errors for debugging.
๐ Running Locally
npm installnpm run start
Ensure Playwright is installed if the CSRF token step is required.
โ ๏ธ Error Handling
The actor handles:
โ Invalid license numbers
โฑ Network timeouts (45-second timeout with retry)
๐ API errors (500 / 502 responses)
๐ Decryption failures
๐ฆ FoSCoS rate limiting
๐ Retry Policy
Maximum 3 attempts per license
Exponential delay 1s โ 2s โ 4s
Maximum delay 5 seconds
Only transient errors trigger retries
All attempts are logged
๐ Security Considerations
Uses first 16 bytes of derived key for AES-128-ECB
All FoSCoS communication is encrypted
No personal data is stored beyond the FoSCoS response
Designed strictly for license verification