Curl support creations of a header file when making requests, this is quite useful for shell scripting, as some services provide metadata only via the headers. An exampe of this is the GitHub API, which provides the rate limit and pagination information in the headers.
To create a header file, you can use the -D flag, which will write the headers to a file. An example of this is:
This will create a file called headers.txt with the headers of the request. If you want to see the headers in the terminal, you can use the -i flag, which will include the headers in the output.
From this point, you can now apply further processing on the headers, such as extracting the rate limit information.