Fssai Scraper avatar

Fssai Scraper

Pricing

$5.00/month + usage

Go to Apify Store
Fssai Scraper

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

ScrapeAI

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

5 days ago

Last modified

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 install
npm 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