ScreenshotNeo

BlogHow-to

PDFCrowd API Authentication Error: How to Fix Invalid Username or API Key

Fix PDFCrowd authentication errors by checking your username, API key, Basic Auth format, HTTP status, and PDFCrowd reason code.

By the ScreenshotNeo team4 October 20268 min read

For PDFCrowd API requests, use your PDFCrowd username as the HTTP Basic Auth username and your PDFCrowd API key as the password. Your account password is not the API key. If authentication fails, check both the HTTP status and the PDFCrowd reason code: a 401 can indicate missing credentials or an inactive license, while reason codes identify issues such as an invalid username, expired license, or missing credits. PDFCrowd’s HTTP API guide documents the credential pair and Basic Auth format.

What “invalid username or API key” means

PDFCrowd authenticates API calls with HTTP Basic authentication. The HTTP client sends the username and API key as a credential pair. Conceptually, the header contains Base64 encoding of username:api_key, prefixed with Basic. Let your HTTP library create this header when possible; manually editing a Base64 value is easy to get wrong.

Keep these credentials distinct:

  • Username: the username associated with your PDFCrowd account.
  • Password field in Basic Auth: your PDFCrowd API key.
  • Account password: used to sign in to the account; it does not replace the API key in an API request.

PDFCrowd’s current HTTP API guide uses the versioned endpoint https://api.pdfcrowd.com/convert/24.04/. The examples below make a minimal HTML-to-PDF request so you can verify authentication with a real API call. Replace the demo credentials with your own for production.

Minimal authentication examples

These examples submit a URL for conversion. Successful calls return PDF bytes, which the examples save to a file. PDFCrowd documents demo/demo for testing; use your account username and API key for normal use. See the HTTP API guide and its code examples for request details.

cURL

curl --fail-with-body \
  --user 'YOUR_PDFCROWD_USERNAME:YOUR_PDFCROWD_API_KEY' \
  --form-string 'url=https://example.com' \
  --output example.pdf \
  'https://api.pdfcrowd.com/convert/24.04/?errfmt=json'

--user constructs Basic Auth. The API accepts conversion settings as form fields; this example uses --form-string for the URL field. On an error, --fail-with-body keeps the response body available while returning a failing command status. Avoid placing real credentials in shell history on shared machines; use a secret manager or a protected environment in automated jobs.

Python

import os
import requests

username = os.environ["PDFCROWD_USERNAME"]
api_key = os.environ["PDFCROWD_API_KEY"]
endpoint = "https://api.pdfcrowd.com/convert/24.04/?errfmt=json"

try:
    response = requests.post(
        endpoint,
        auth=(username, api_key),
        data={"url": "https://example.com"},
        timeout=120,
    )
    response.raise_for_status()
except requests.HTTPError:
    print("HTTP status:", response.status_code)
    print("PDFCrowd response:", response.text[:2000])
    raise

with open("example.pdf", "wb") as pdf:
    pdf.write(response.content)

Install the dependency with python -m pip install requests. Set PDFCROWD_USERNAME and PDFCROWD_API_KEY in the process environment before running the script. Requests’ auth parameter supplies HTTP Basic Auth.

Node.js

const username = process.env.PDFCROWD_USERNAME;
const apiKey = process.env.PDFCROWD_API_KEY;
if (!username || !apiKey) throw new Error("Set PDFCROWD_USERNAME and PDFCROWD_API_KEY");

const form = new FormData();
form.set("url", "https://example.com");
const basic = Buffer.from(`${username}:${apiKey}`).toString("base64");

const response = await fetch(
  "https://api.pdfcrowd.com/convert/24.04/?errfmt=json",
  {
    method: "POST",
    headers: { Authorization: `Basic ${basic}` },
    body: form,
    signal: AbortSignal.timeout(120_000),
  },
);

if (!response.ok) {
  console.error("HTTP status:", response.status);
  console.error("PDFCrowd response:", (await response.text()).slice(0, 2000));
  throw new Error("PDFCrowd conversion failed");
}

const fs = await import("node:fs/promises");
await fs.writeFile("example.pdf", Buffer.from(await response.arrayBuffer()));

This uses the built-in fetch, FormData, and Buffer APIs in modern Node.js. The API key is used as the Basic Auth password. Do not set the multipart Content-Type yourself: fetch supplies the boundary for FormData.

Fix the error step by step

  1. Check the exact credential values. Confirm the username belongs to the account whose API key you copied. Recopy the API key from the account rather than using the account login password. Check for leading or trailing spaces, line breaks, empty environment variables, and credentials from a different account.
  2. Check the authentication scheme. The API expects HTTP Basic Auth. In a client library, use its Basic Auth option. If you construct the header yourself, encode the exact UTF-8 bytes of username:api_key with Base64 and send Authorization: Basic …. Do not Base64-encode the username and key separately, omit the colon, or include extra quotes.
  3. Check the endpoint and request. Use the documented versioned conversion endpoint and send the conversion input as form data. Authentication problems and malformed requests are different; retain the response body to distinguish them.
  4. Read the HTTP status and PDFCrowd reason code together. The status tells you the general class of failure; the reason code points to a more specific cause. Consult PDFCrowd’s API status codes.
  5. Check the account and license state. If the credentials appear correct, inspect license validity and available credits. An inactive or expired license is not fixed by repeatedly changing the password field.
  6. Isolate the client if needed. Try a minimal request with PDFCrowd’s documented demo/demo test credentials, where supported. This can help determine whether the issue is in request construction or in your account credentials. Do not use demo credentials for production.

Interpret the status and reason code

PDFCrowd recommends checking both values. Its status reference identifies these authentication and account-related reason codes:

HTTP status or reason Meaning What to check
HTTP 401 Credentials were not provided or the license is not active. Confirm the Basic Auth pair and account/license state; then inspect the reason code.
HTTP 403 The service is suspended or there are no credits left. Check account status and remaining credits.
Reason 101 Invalid credentials format; Base64 is required. Use a Basic Auth helper or correct the authorization header format.
Reason 102 Invalid credentials format. Check the scheme, encoding, colon separator, and credential values.
Reason 103 The license has expired. Check the license and renew or restore access as appropriate.
Reason 104 The license has been temporarily disabled. PDFCrowd directs users to contact its support.
Reason 105 No license credits remain. Check the account’s credit balance.
Reason 106 No license or invalid username. Verify the username and that the account has API access.
Reason 107 Missing or invalid PDFCrowd API/WordPress key. Supply the API key in the Basic Auth password field; verify it is current.
Reason 123 The username or API/WordPress key does not match. Check that the username and key are a matching pair from the same account.

Reason codes are identifiers, not a measure of how often an error occurs. The authoritative list can change, so check the live status code reference if your response contains a code not listed here.

Postman: check credentials and selected environment

In Postman, authentication can fail even when the values exist because the request is using a different or unselected environment.

  1. Set the username environment variable to your PDFCrowd username.
  2. Set api_key to the PDFCrowd API key, not your account password.
  3. Select the intended environment in Postman before sending the request.
  4. Check the request’s Authorization settings and ensure Basic Auth uses those variables as username and password.
  5. Keep the API key in Postman’s Current Value field if you do not want it synced to the cloud.

PDFCrowd’s Postman guide documents this setup, notes that each API request counts against usage limits, and explains that the key can be regenerated from the account. If you regenerate it, update every environment, secret store, and deployment that used the old key.

Credential handling and operational notes

  • Keep keys out of source control. Load them from environment variables or a secret manager. Redact authorization headers and API keys from request logs, error reports, and support tickets.
  • Do not retry unchanged 401 requests. Retries will not fix a wrong key or inactive license. Correct the credential or account state first.
  • Use bounded timeouts. PDF generation can take longer than a simple JSON API call. Set a timeout suitable for the document, and handle timeout errors separately from authentication failures.
  • Retry only transient failures. PDFCrowd’s status reference describes 503 as a temporary network issue. Apply a bounded retry with backoff for transient errors; do not blindly retry 4xx authentication or account errors.
  • Protect diagnostic data. Keep the HTTP status, reason code, and a redacted response body when debugging. Never attach a production API key to a log or support message.
  • Account for request usage. PDFCrowd’s Postman documentation says each API request counts against usage limits. Avoid repeated manual retries and test calls against production credentials when a local request-format check is enough.

Common errors and fixes

Symptom Likely cause Fix
401 after copying credentials The account password was used instead of the API key, or the pair came from different accounts. Use the account’s username and matching API key.
Reason 101 or 102 The Authorization header is missing, malformed, or encoded incorrectly. Use an HTTP library’s Basic Auth option; verify the header scheme and credential pair.
Reason 103 or 104 The license expired or was temporarily disabled. Resolve the license state; for a temporary disablement, follow PDFCrowd’s support guidance.
Reason 105 or HTTP 403 Credits are exhausted or service access is suspended. Check credits and account status.
Reason 106 Username is incorrect or no applicable license is available. Verify the account username and API access.
Reason 107 The key is absent or invalid. Set the API key as the Basic Auth password and refresh stale configuration.
Works locally, fails in Postman or deployment A different environment, stale secret, or unset variable is active. Inspect the selected Postman environment or deployed secret values.
PDF file contains an error message or is incomplete The client saved an error response as though it were a PDF, or did not check the HTTP status. Check response.ok/raise_for_status() before writing the response as a PDF.

Or skip the browser setup

If your actual task is capturing a webpage as an image or PDF, ScreenshotNeo offers a one-request screenshot API. It is a different product and does not fix PDFCrowd credentials. The call below requests a WebP screenshot:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for request options. Cookie banners, popups, and chat widgets are removed before capture; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000.

Sign up for ScreenshotNeo’s free plan.

FAQ

Is my PDFCrowd login password the API key?

No. Use the PDFCrowd username and API key as the Basic Auth username and password.

Can a 401 mean something other than a typo?

Yes. PDFCrowd documents 401 for credentials that were not provided or a license that is not active. Check the reason code and license state.

Should I create the Basic Auth header manually?

Usually not. Use the HTTP client’s Basic Auth feature so it handles the header format and encoding.

What should I include when asking for help?

Share the HTTP status, reason code, and a redacted response body. Do not share your API key.

Sources