http_post_form
Submit a POST form to AJAX endpoints that do not change the URL, retrieving JSON data from government dashboards when dropdowns are not reflected in query parameters.
Instructions
POST a form (application/x-www-form-urlencoded) and return the JSON.
The escape hatch for Year/Month/Product dropdowns on government dashboards
that don't change the page URL — the dropdown triggers an AJAX POST and
only renders the result client-side, so pdf_discover and web_fetch can't
see it. Use this when a landing page's dropdown isn't a `<select>` whose
value becomes a query param.
Example — PPAC prior-year (FY2025-26) petroleum consumption:
url = "https://ppac.gov.in/AjaxController/getConsumptionPetroleumProductsChartData"
form = {"financialYear": "2025-2026", "reportBy": "1", "pageId": "43"}
referer = "https://ppac.gov.in/consumption/products-wise"
Returns the full FY2025-26 monthly JSON (April 2025 → March 2026).
Args:
url: The POST endpoint (usually `/AjaxController/...` on gov sites).
form: Form fields to submit.
referer: Optional Referer header — many gov AJAX endpoints reject
requests without one.
parse: "json" / "text" / "auto" (default — try JSON, fall back to text).
Returns:
{url, status, content_type, json (when parseable), text, fetched_at}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | ||
| form | Yes | ||
| referer | No | ||
| parse | No | auto |