How to Capture GST Portal Web Pages as PDF with ScreenshotMachine
Use ScreenshotMachine’s PDF API for public GST Portal pages. For pages behind login, use an authorized browser session; CAPTCHA and OTP access are not verified by the API docs.
ScreenshotMachine’s Website to PDF API can convert a publicly accessible GST Portal URL into a PDF. It requires a customer key and supports settings such as paper size, orientation, screen or print rendering, background, and a rendering delay. Its documentation does not establish that it can capture a GST Portal page that requires login, CAPTCHA, or OTP.
If the page is public, use the API steps below. If it is behind sign-in, open it in a browser session you are authorized to use and save or print it as a PDF there. Do not send GST credentials or session cookies to a third party just to try to make an API capture work.
1. Check whether the page is public or requires sign-in
Open the exact GST Portal URL in a private browser window where you are not signed in. If the page is visible without authentication, it is a candidate for URL-based capture. If it redirects to login or asks for CAPTCHA or OTP, treat it as an authenticated page.
The GST Portal login manual describes CAPTCHA entry and, in specified circumstances, a second authentication round using an OTP sent to the registered mobile number and email. ScreenshotMachine’s reviewed PDF documentation describes a URL-to-PDF API, but does not document a GST-specific login flow or confirm that it can complete those checks. Its cookie option is not proof that private GST pages can be captured.
For a public page, you will need a ScreenshotMachine customer key. The official API documentation is the reference for current parameter names and accepted values: ScreenshotMachine Website to PDF API.
2. Capture a public GST Portal page with the PDF API
The API uses an HTTP GET request with the target URL and customer key. Set PDF options according to how the document will be read or printed. This shell example uses A4 portrait with screen rendering; check the current API documentation for exact accepted parameter values for your account.
curl -G 'https://api.screenshotmachine.com/?' \
--data-urlencode 'key=YOUR_CUSTOMER_KEY' \
--data-urlencode 'url=https://www.gst.gov.in/' \
--data-urlencode 'dimension=A4' \
--data-urlencode 'orientation=portrait' \
--data-urlencode 'media=screen' \
--data-urlencode 'delay=2000' \
--output gst-portal.pdf
Use the PDF endpoint and parameter names shown in ScreenshotMachine’s current documentation for your account. The example illustrates the documented URL-to-PDF workflow and common PDF controls; if a parameter is rejected, consult the API page rather than assuming an undocumented alias.
Choose PDF settings
| Setting | When to use it |
|---|---|
| Paper size | Choose A4 or another listed size based on the page and intended print format. |
| Orientation | Use portrait for narrow or document-like pages; try landscape when wide tables would otherwise become hard to read. |
| Media: screen or print | Use screen when you want browser-like presentation. Use print when the PDF is intended for printing; print mode may omit web-specific graphics and elements considered unnecessary for print. |
| Background | Enable or select a background when the page’s background colors are needed for understanding. Check the resulting PDF because print-oriented rendering can omit decorative styling. |
| Delay | Set a short wait only when the page needs time to render late content or finish an animation. A delay does not complete login, CAPTCHA, OTP, or access restrictions. |
Parameter spellings and allowed values can change or differ by endpoint. Use the API reference as the source of truth for the request syntax available to your key.
3. Use the ScreenshotMachine API from Python or Node.js
These examples use Python’s requests library and the built-in fetch available in current Node.js releases. Replace the endpoint and parameter names with those documented for the Website to PDF API if they differ for your account.
Python
import requests
endpoint = "https://api.screenshotmachine.com/"
params = {
"key": "YOUR_CUSTOMER_KEY",
"url": "https://www.gst.gov.in/",
"dimension": "A4",
"orientation": "portrait",
"media": "screen",
"delay": 2000,
}
response = requests.get(endpoint, params=params, timeout=90)
response.raise_for_status()
content_type = response.headers.get("content-type", "")
if "pdf" not in content_type.lower() and not response.content.startswith(b"%PDF"):
raise RuntimeError(
f"Expected a PDF, got content-type {content_type!r}; "
"check the API response and customer key."
)
with open("gst-portal.pdf", "wb") as pdf_file:
pdf_file.write(response.content)
Node.js
const endpoint = new URL("https://api.screenshotmachine.com/");
const params = {
key: "YOUR_CUSTOMER_KEY",
url: "https://www.gst.gov.in/",
dimension: "A4",
orientation: "portrait",
media: "screen",
delay: "2000",
};
for (const [name, value] of Object.entries(params)) {
endpoint.searchParams.set(name, value);
}
const response = await fetch(endpoint, { signal: AbortSignal.timeout(90_000) });
if (!response.ok) {
throw new Error(`ScreenshotMachine returned HTTP ${response.status}`);
}
const bytes = Buffer.from(await response.arrayBuffer());
const contentType = response.headers.get("content-type") ?? "";
if (!contentType.toLowerCase().includes("pdf") && bytes.subarray(0, 4).toString() !== "%PDF") {
throw new Error(`Expected a PDF, got content-type ${contentType || "(missing)"}`);
}
await import("node:fs/promises").then(({ writeFile }) => writeFile("gst-portal.pdf", bytes));
Keep the customer key on a server or in a local environment variable in real applications. Avoid committing it to source control or placing it in a public webpage.
4. Save a page that requires GST Portal login
For a page that is only available after login, use the browser session in which you are authorized to view it. The GST Portal may ask for CAPTCHA and may require OTP in circumstances described by its login manual. Complete those steps yourself in the portal; a rendering delay or PDF API request is not an authentication method.
- Sign in to the GST Portal through its normal login flow and complete any CAPTCHA or OTP checks.
- Navigate to the specific page or record you are allowed to access.
- Use the browser’s print command and select its option to save or print to PDF. Choose a paper size and orientation that preserve the page’s important content.
- Open the saved PDF and check that tables, dates, totals, and page breaks are legible and complete.
- Store and share the file according to your organization’s handling requirements for tax records.
This browser procedure avoids handing your GST password or active session cookie to an API provider. Whether a particular PDF is accepted for a support request or another official purpose depends on that process; the GST support page reviewed here mentions screenshot uploads for portal complaints but does not establish that a PDF from ScreenshotMachine is accepted.
5. Optional ScreenshotMachine controls and their limits
ScreenshotMachine’s documentation also describes cookie input, click and hide selectors, and an accept-language option. These can affect rendering for supported captures. They do not establish that the API can pass GST Portal authentication, CAPTCHA, OTP, or other access controls. Do not use these controls as a reason to share sensitive login material.
For public pages, a hide selector may help remove an unwanted on-page element, and a click selector may activate a control before capture. Confirm that any interaction is appropriate for the page and does not submit a form or change account data. A language header can affect localized content when the site honors it.
6. Review the PDF before relying on it
- Confirm the PDF opens and has the expected page count.
- Check that the URL and the intended public page are the ones captured.
- Inspect wide tables at normal zoom; switch to landscape if columns are clipped or cramped.
- Compare screen and print output if styling or background colors carry meaning.
- Look for missing late-loaded content, blank sections, or page breaks through important rows.
- Review for personal or tax information before sharing or uploading.
7. Troubleshooting
| Symptom | Likely cause | What to do |
|---|---|---|
| PDF shows a login page | The target page requires an authenticated session, or the API did not have access. | Use the authorized browser workflow. The reviewed docs do not confirm GST login compatibility. |
| Page asks for CAPTCHA or OTP | The GST Portal’s authentication flow requires user verification. | Complete verification through the portal’s normal login process. A delay does not bypass it. |
| Request is rejected or returns an error | Missing/invalid customer key, malformed target URL, or unsupported option value. | Check the key, encode the URL as a query parameter, and verify option names and values in the API reference. |
| Downloaded file is not a PDF | The server returned an error body or another response instead of PDF bytes. | Check HTTP status, content type, and response body before saving; validate the PDF signature. |
| PDF is blank or incomplete | The page may be blocked, unavailable, dependent on late content, or unsuitable for remote URL capture. | Confirm it loads publicly in a normal browser; use a modest delay only for rendering time, then inspect the output. |
| Text or columns are too small | Portrait layout or print rendering may not suit a wide page. | Try landscape, a different listed paper size, or screen media; verify legibility afterward. |
| Colors or decorative elements are missing | Print media may omit web styling intended only for screen display. | Try screen media or enable the documented background option. |
8. Performance, reliability, and cost considerations
A public URL capture depends on the page being reachable by the service and finishing its rendering. Keep the requested delay only as long as the page needs; waiting longer can increase capture time without fixing access restrictions or failed resources. For important records, inspect the output and keep the source URL and capture context with the PDF where appropriate.
Do not assume a successful HTTP response means the intended GST content was captured. A login screen or incomplete page can still produce a file, which is why checking the PDF is part of the workflow.
The supplied ScreenshotMachine documentation establishes that a customer key is required, but the reviewed research does not establish current pricing, quotas, or billing behavior. Check the provider’s current account and pricing terms before automating repeated captures. For sensitive authenticated pages, a local browser-to-PDF workflow may avoid sending the page session to a remote capture API.
9. Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server. For a public GST Portal page, one GET request can return an image or PDF. See the ScreenshotNeo API documentation for the PDF parameters and current request options.
curl -G "https://api.screenshotneo.com/v1/shot" \
-d access_key=YOUR_API_KEY \
--data-urlencode url=https://www.gst.gov.in/ \
-d format=pdf \
-o gst-portal.pdf
ScreenshotNeo removes known cookie banners, newsletter popups, and chat widgets before the shot. Bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots, and the free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. These features do not make a private GST page accessible or complete the portal’s CAPTCHA or OTP flow, so use an authorized browser session for pages behind sign-in.
Sign up free for 1,000 screenshots a month, with no card required.
10. FAQ
Can ScreenshotMachine capture any GST Portal page?
The documentation reviewed confirms URL-to-PDF capture, not access to every GST Portal page. Public availability is the key condition; private-page compatibility is not established.
Does adding cookies solve GST login?
No such capability is established by the reviewed documentation. Cookie input alone does not demonstrate that CAPTCHA, OTP, or portal access checks will work.
Will a delay make an authenticated page available?
No. A delay is for waiting before conversion when rendering needs time. It does not perform authentication.
Is a ScreenshotMachine-generated PDF guaranteed to be accepted by GST support?
The reviewed GST support guidance mentions screenshot uploads for portal complaints, but it does not state that a particular generated PDF is accepted.
Sources
- ScreenshotMachine: Website to PDF API — endpoint purpose, key requirement, and PDF rendering options.
- ScreenshotMachine: Website Screenshot API — documented capture controls including cookies, selectors, and language.
- GST Portal: Logging in and Managing Username and Password — login, CAPTCHA, and OTP procedures.
- GST Self Service Portal — portal complaint support information, including screenshot uploads.


