A URI (Uniform Resource Identifier) is a standardized string of characters used to identify a resource, such as a webpage, file, API endpoint, or digital document.
URIs play an important role in web development, networking, and API communication by providing a consistent way to identify resources.
A URL is a common type of URI.
A URI identifies a resource using a defined syntax.
A typical process includes:
Not every URI provides a direct way to retrieve a resource.
A URI can contain several components:
| Component | Purpose |
|---|---|
| Scheme | Identifies the URI scheme, such ashttps |
| Authority | May specify a host and port |
| Path | Identifies a resource within a hierarchy |
| Query | Provides additional parameters |
| Fragment | Identifies a specific part of a resource |
A URI does not need to include every component.
URI and URL are closely related but have different meanings.
For example, a web address beginning with https is both a URL and a URI.
However, not every URI is a URL.
A URN (Uniform Resource Name) identifies a resource by name rather than its network location.
For example, an ISBN-based URN can identify a book independently of where it is stored.
URIs are fundamental to web scraping because they identify the resources a scraper requests.
A scraping application may use URIs to:
Correct URI parsing and normalization help prevent broken requests and duplicate data collection.
Consider this URI:
https://example.com/products?category=electronics#details
Its components are:
Scheme: https
Authority: example.com
Path: /products
Query: category=electronics
Fragment: details
The scheme specifies HTTPS communication, the authority identifies the host, and the path identifies the resource.
The query provides additional parameters, while the fragment identifies a section within the resource.
Fragments are generally handled by the client and are not included in the HTTP request sent to the server.
A URI (Uniform Resource Identifier) is a standardized way to identify resources across the internet and other systems.
URLs and URNs are types of URIs that serve different identification purposes. Understanding URI syntax is essential for web development, API integration, networking, and web scraping.