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
5 days 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