Overview
cURL is a software project providing a command-line tool, curl, and a C library, libcurl, for transferring data using various network protocols. Founded in 1997, it has become a widely adopted utility for developers, system administrators, and network engineers due to its flexibility and broad protocol support. The project is open-source and freely available, making it a foundational component in many software environments and scripting workflows.
The curl command-line tool allows users to make network requests directly from the terminal. It supports protocols such as HTTP, HTTPS, FTP, FTPS, SCP, SFTP, and more, enabling operations like downloading files, uploading data, interacting with web APIs, and testing network services. Its extensive options allow for fine-grained control over requests, including setting headers, handling cookies, managing authentication, and configuring proxies. This makes curl an essential tool for tasks ranging from simple data retrieval to complex API interactions and debugging web applications in development and production environments.
libcurl is the underlying C library that powers the command-line tool. It provides a programmatic interface for developers to integrate data transfer capabilities into their own applications. With bindings available for numerous programming languages, libcurl allows applications to perform network communications without having to implement protocol details from scratch. This enables a wide range of applications, from desktop clients and server-side services to embedded systems, to interact with network resources reliably. Its stability and performance contribute to its use in critical infrastructure and high-traffic systems.
cURL excels in scenarios requiring automated data transfer and network debugging. Its command-line interface is well-suited for shell scripts and continuous integration pipelines, where automated tasks need to fetch or send data to remote servers. Developers frequently use curl to examine HTTP responses, test API endpoints, and diagnose connectivity issues. The project's commitment to stability and backward compatibility ensures that scripts written years ago often continue to function without modification. For instance, comparing the functionality of curl with alternatives like Wget often highlights curl's broader protocol support and more extensive options for HTTP/HTTPS interactions, making it a preferred choice for intricate web-related tasks.
The project's active development and large community contribute to its continuous improvement and robust feature set. Documentation for the command-line tool and libcurl is comprehensive, offering detailed explanations of options and functions, as well as numerous examples to guide users through various use cases. Its cross-platform availability means it can be found on most Unix-like operating systems, Windows, and macOS, ensuring consistent behavior across different environments.
Key features
- Extensive Protocol Support: Transfers data using HTTP, HTTPS, FTP, FTPS, SCP, SFTP, TFTP, DICT, TELNET, LDAP, LDAPS, FILE, IMAP, SMTP, POP3, RTSP, RTMP, SMB, SMBS, and more (curl.se features).
- Command-Line Interface (CLI): Provides a versatile command-line tool for direct interaction with network resources, supporting a wide array of options for request customization.
- libcurl C Library: Offers a robust, embeddable C library for programmatic data transfer, enabling developers to integrate network capabilities into their applications.
- Cross-Platform Compatibility: Available on most operating systems, including Linux, macOS, Windows, and various Unix-like systems.
- Authentication Methods: Supports various authentication schemes including Basic, Digest, NTLM, Kerberos, and others.
- HTTP/HTTPS Features: Handles cookies, redirects, proxies, HTTP/2, HTTP/3 (QUIC), and supports custom headers.
- File Transfer Operations: Capable of uploading and downloading files, resuming broken transfers, and handling large files efficiently.
- SSL/TLS Support: Provides secure communication over HTTPS and other secure protocols with configurable certificate validation (curl.se SSL certs).
- Progress Meter: Displays transfer progress, speed, and time estimates during data operations.
- Scripting and Automation: Designed for use in shell scripts, cron jobs, and automated workflows due to its stable interface and exit codes.
Pricing
cURL and libcurl are open-source projects distributed under a permissive license, making them free to use for both personal and commercial purposes. There are no licensing fees, subscription costs, or usage-based charges associated with either the command-line tool or the library.
| Product/Service | Details | Cost | As Of |
|---|---|---|---|
| curl (command-line tool) | Data transfer utility for various protocols. | Free | 2026-05-07 |
| libcurl (C library) | C library for embedding data transfer functionality into applications. | Free | 2026-05-07 |
The project is maintained by a community of contributors and supported by donations. All source code is publicly available on GitHub.
Common integrations
- Shell Scripts: Widely integrated into Bash, Zsh, and other shell scripts for automating web requests, file downloads, and API interactions (curl manual).
- Build Systems and CI/CD Pipelines: Used in build tools like Makefiles, Jenkins, GitLab CI, and GitHub Actions to fetch dependencies, deploy artifacts, or trigger webhooks.
- Monitoring and Alerting Systems: Employed to check the availability and responsiveness of web services, often paired with tools like Nagios or Prometheus.
- Docker and Containerization: Frequently included in Docker images as a fundamental utility for network communication within containers.
- Web Servers: Can be used within server-side scripts (e.g., PHP, Python, Node.js through bindings) to make outbound HTTP requests.
- Embedded Systems: libcurl is integrated into various embedded devices and IoT solutions for network connectivity, due to its small footprint and robust performance.
Alternatives
- Wget: A free utility for non-interactive download of files from the web, supporting HTTP, HTTPS, and FTP protocols, primarily focused on recursive downloads.
- Postman: A GUI-based platform for API development, testing, and documentation, offering a visual interface for constructing and executing HTTP requests.
- HTTPie: A command-line HTTP client with a simplified syntax, JSON support, and colored output, designed for user-friendly API interaction.
Getting started
To get started with curl, you typically don't need to install it separately on most Unix-like systems (Linux, macOS), as it often comes pre-installed or is readily available through package managers. For Windows, you can download pre-built binaries from the curl website or use package managers like Chocolatey.
Here's a basic example of using curl to fetch the content of a webpage:
curl https://example.com
This command will output the HTML content of example.com to your terminal. To save the output to a file, you can use the -o (output file) or -O (remote file name) options:
# Save to a specified file name
curl -o example.html https://example.com
# Save with the remote file name
curl -O https://example.com/image.jpg
To make a POST request with JSON data, you can use the -X POST option to specify the method, and -H to set the Content-Type header, along with -d to provide the data:
curl -X POST \
-H "Content-Type: application/json" \
-d '{"name":"John Doe","job":"developer"}' \
https://jsonplaceholder.typicode.com/posts
This command sends a JSON payload to a test API endpoint. The -v (verbose) option is frequently used for debugging, providing detailed information about the request and response headers:
curl -v https://api.github.com
For integrating libcurl into a C application, you would include the curl/curl.h header and link against the libcurl library. Here's a simple C example that fetches a URL using libcurl:
#include <stdio.h>
#include <curl/curl.h>
int main(void)
{
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
/* Perform the request, res will get the return code */
res = curl_easy_perform(curl);
/* Check for errors */
if(res != CURLE_OK)
fprintf(stderr, "curl_easy_perform() failed: %s\n",
curl_easy_strerror(res));
/* Always cleanup */
curl_easy_cleanup(curl);
}
return 0;
}
To compile this C code, you would typically use a command like gcc myprogram.c -lcurl -o myprogram, assuming libcurl development headers are installed on your system. This program initializes a curl session, sets the URL, performs the request, and then cleans up the resources. The libcurl API reference provides more advanced examples for various use cases.