What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Start with the official dataset record, not a random web page. Find the publisher through a government catalog, read its access and use terms, choose the documented API or bulk download when available, then collect slowly and validate the fields before analysis. Page scraping is a fallback—not a blanket permission granted by public visibility.

What “scraping public government data” actually involves

Scraping can mean downloading a CSV, calling a JSON API, retrieving bulk XML, or parsing an HTML table. These methods are not interchangeable. An API or bulk file is usually more stable and more clearly authorized than extracting values from rendered pages. The correct method depends on what the publisher documents, the volume you need, the update schedule, and the dataset’s terms.

This workflow uses U.S. federal examples. State, local, and non-U.S. portals can impose different licenses, authentication requirements, formats, and restrictions. The steps are practical guidance, not legal advice; check the live terms and documentation for every service you use.

1. Find the authoritative dataset

Use a catalog for discovery

Begin with Data.gov when looking for federal datasets. Its search and metadata APIs help you locate records, but a catalog entry is only a discovery aid. Follow the record to the agency or publisher that owns the data. Confirm that you have the intended edition, geography, coverage period, update date, and publisher.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Check specialist government collections

For government publications and selected legislative or regulatory collections, GovInfo provides a documents API and bulk-data options. Selected collections include bulk XML and JSON resources. Availability is collection-specific; do not assume that every GovInfo item or every federal agency provides the same formats.

Record provenance

  • Publisher and agency name
  • Dataset title, identifier, and canonical landing page
  • Coverage dates and update cadence
  • Format, schema, data dictionary, and known limitations
  • The exact access route you intend to use

2. Read the record before collecting anything

Open the dataset’s “Access and Use Information” and the service’s own terms. Data.gov explains that federal data is generally free and generally not subject to domestic copyright restrictions, but exceptions exist. Non-federal records in a catalog can have different licenses. “Public” therefore does not mean that every record has identical reuse rights.

Look for attribution requirements, restrictions on redistribution or sensitive fields, privacy provisions, retention rules, and any prohibition on automated collection. Commerce API terms, for example, call for attribution, prohibit false representation of API content, and permit access limitations. SAM.gov provides a contrasting service-specific rule: it directs users to selected APIs and extracts for some information and says automated gathering and scraping tools are prohibited on that service. Treat those statements as conditions for those services, not as a universal federal rule.

3. Choose an access method

Route Use it when Advantages Risks or checks
Documented API You need selected records, filters, or recurring updates Structured responses, explicit parameters, predictable automation Keys, quotas, pagination, endpoint-specific terms
Bulk download You need most or all records, or an agency publishes periodic archives Fewer requests and efficient large-scale processing Large files, update timing, checksums, schema changes
Page-level scraping No API or bulk route exists and the terms permit collection Can retrieve information exposed only in an interface Fragile selectors, JavaScript rendering, bot controls, redesigns, unclear permission

Compare the publisher’s documented route, authentication and limits, format and metadata quality, update cadence, terms, and resistance to page redesign. If an API or bulk file satisfies the requirement, do not scrape the presentation layer merely because it is visible in a browser.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

4. Obtain credentials and respect limits

Data.gov APIs use api.data.gov for authentication, rate limiting, and usage tracking. The Data.gov API page lists a free personal key with a limit of 1,000 requests per hour. Its DEMO_KEY has lower limits of 30 requests per IP per hour and 50 per IP per day. These are operating limits for those credentials, not a general allowance for all government services; service-specific limits can differ. Read the current documentation and inspect rate-limit headers.

Minimal Python API client

import time
import requests

API_URL = "https://api.example.gov/v1/records"
params = {
    "api_key": "YOUR_API_KEY",
    "page": 1,
    "page_size": 100,
}

rows = []
while True:
    response = requests.get(API_URL, params=params, timeout=30)
    response.raise_for_status()
    payload = response.json()
    batch = payload.get("results", [])
    rows.extend(batch)
    if not payload.get("next") or not batch:
        break
    params["page"] += 1
    time.sleep(1)

print(f"Downloaded {len(rows)} records")

Replace the endpoint, parameter names, and pagination fields with those in the agency’s documentation. Store the raw responses and request timestamp so your analysis can be reproduced.

cURL pattern

curl --fail --retry 3 --retry-delay 2 
  -G "https://api.example.gov/v1/records" 
  --data-urlencode "api_key=YOUR_API_KEY" 
  --data-urlencode "page=1" 
  --data-urlencode "page_size=100" 
  -o page-1.json

Node.js pattern

const url = new URL("https://api.example.gov/v1/records");
url.search = new URLSearchParams({
  api_key: process.env.API_KEY,
  page: "1",
  page_size: "100"
});

const res = await fetch(url);
if (!res.ok) throw new Error(`${res.status} ${res.statusText}`);
const data = await res.json();
console.log(data.results?.length ?? 0);

Keep keys in environment variables or a secret manager, never in a public repository. Use exponential backoff for transient 429 and 5xx responses, honor a Retry-After header, and stop rather than repeatedly retrying a persistent 4xx error.

5. If page scraping is unavoidable

Inspect the site first

  1. Read the terms, privacy notice, and any automation policy.
  2. Inspect robots.txt for crawling guidance and crawl-delay directives.
  3. Identify whether the page loads data from an underlying JSON request or downloadable file; use that documented route instead when permitted.
  4. Use a descriptive user agent and a contact address where appropriate.
  5. Request at a low rate, cache responses, and schedule larger jobs off-peak.

Digital.gov describes robots.txt as bot guidance. It does not grant permission by itself and does not replace API documentation, terms, or access restrictions. A GSA blog discussion recommends considering robots.txt, terms, low-impact tooling, and off-peak requests, while noting that its views are not official federal guidance.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Make extraction resilient

  • Prefer stable attributes and semantic labels over positional CSS selectors.
  • Save the original HTML and response headers with each batch.
  • Detect empty pages, login redirects, consent screens, and changed column counts.
  • Set connection and total-job timeouts; never run an unbounded loop.
  • Hash downloaded files and retain the hash beside your processing record.

6. Download bulk data efficiently

Bulk files are often the best choice for a complete historical extract. Download once, verify the file size or checksum when provided, and process locally. For GovInfo collections that expose bulk XML or JSON, use the published bulk endpoint rather than issuing one request per document. Stream large files where possible and partition your local output by publication date or agency.

Do not infer that a bulk endpoint exists for every collection. Confirm the collection’s documentation, naming convention, update schedule, compression format, and license before automating it.

7. Validate before analysis or publication

Check structure

  • Compare actual columns and data types with the data dictionary.
  • Parse dates with an explicit timezone or documented convention.
  • Check identifiers for duplicates, leading zeros, and changes in format.
  • Measure missing, null, suppressed, and “not applicable” values separately.
  • Confirm units, inflation adjustments, geographic boundaries, and revisions.

Check meaning and limitations

Federal open-data principles call for machine-readable formats plus descriptions of strengths, weaknesses, limitations, and processing needs. Read those notes before making comparisons. A machine-readable field can still be ambiguous, revised, modeled, or incomplete. Preserve the publisher’s definitions and cite the dataset version or retrieval date in your own work.

Reconcile samples

For an API, compare a few records with the agency’s user interface or published example. For a bulk file, compare row counts and representative values with the landing-page description. Investigate discrepancies before publishing results.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

8. Troubleshooting common failures

HTTP 401 or 403

The key may be missing, invalid, expired, or unauthorized for that endpoint. Check the required header or query parameter, account status, and service terms. Do not rotate keys to evade a restriction.

HTTP 429

You exceeded a quota or burst limit. Slow down, honor Retry-After, reduce concurrency, cache results, and inspect rate-limit headers. A personal Data.gov key’s 1,000-per-hour figure does not override another service’s lower limit.

HTML instead of JSON

You may have followed a redirect to a login, consent, error, or bot-check page. Log the final URL and content type, then return to the documented API or bulk route.

Empty or partial results

Check pagination, date filters, maximum page size, and server-side truncation. Record the total-count field when available and test a narrow query whose expected result you can verify.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Selectors suddenly fail

The publisher redesigned the page or moved rendering to JavaScript. Recheck for a documented feed or API, add tests that detect missing fields, and update selectors only after confirming that terms still permit collection.

Or skip the browser setup

If your task is to capture a government page as evidence or a visual record rather than extract structured fields, ScreenshotNeo provides a one-call screenshot API. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be disabled. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server lets Claude, Cursor, and other MCP clients use take_screenshot, get_page_info, and capture_pdf.

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 documentation for options such as full-page capture, CSS selectors, custom waits, headers, cookies, PDF output, caching, and bulk jobs. The free plan includes 1,000 screenshots each month with no card; paid plans start at $5 for 3,000. Create a free ScreenshotNeo account.

Operational checklist

  • Publisher and dataset record identified
  • Access-and-use terms and service rules reviewed
  • API or bulk route selected before page scraping
  • Credentials stored securely and quotas monitored
  • Rate, concurrency, caching, and retry behavior configured
  • Raw responses, retrieval dates, and versions archived
  • Schema, missingness, units, and limitations validated
  • Reproduction notes and attribution prepared

Frequently Asked Questions

Is scraping a government website automatically legal?

No universal answer applies. Permission and restrictions depend on the publisher, service terms, dataset license, privacy obligations, and access controls. Review the specific service rules and use an official API or bulk route when provided.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Should I use robots.txt as permission?

No. It communicates crawling guidance, but it does not replace terms, API documentation, authentication requirements, or other restrictions.

When should I choose a bulk file instead of an API?

Choose bulk data when you need most of a collection or a complete historical snapshot and the publisher provides an archive. Use an API for filtered, incremental, or recurring retrieval.

How do I make a scraping project reproducible?

Save the dataset identifier, landing-page URL, retrieval time, request parameters, raw files, schema version, software version, and any transformations applied.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.