# Should I set a User-Agent when calling a public API?

**Yes. One short line, and it works in your favour.** Name the tool, what it pulls the data for, and a contact or project link: `nav-tracker/1.0 (portfolio sheet; you@example.com)`. It is voluntary and self-declared - nothing checks it - and it is the single cheapest thing a regular caller can do to make a free service work better for them.

**Why it pays you, concretely:**

- **A default User-Agent looks identical to scanner noise.** Every abuse tool on the internet arrives as `python-requests` or a bare `curl/8.x`, so an unnamed caller sits in the same pile the operator triages for hostility. A named one reads as a person with a purpose.

- **Your failures become features.** Operators review error logs to decide what to improve, and a recurring, identifiable caller is the one that gets accommodated. Real examples from one service's log review: several callers kept sending a parameter that did not exist, so it was built; a spreadsheet kept sending dates as plain numbers, so the error now names the cell fix; so many people pulled the latest NAV one scheme at a time that a whole-universe snapshot file was published.

- **When something breaks, you are reachable** - or at least recognisable, so a fix can be tested against your actual traffic.

**The convention is old and simple:** `name/version (purpose; contact)`. Crawlers have done it for decades, and the same shape works for a cron, a spreadsheet pull or an agent. Set it once where your HTTP client is configured. Do not put anything secret in it - it travels in plain sight on every request.

Related: [pulling a large dataset without hammering the API](https://www.tigzig.com/agents-faq/how-do-i-pull-a-large-dataset-without-hammering-the-api) and [what actually trips a 429](https://www.tigzig.com/agents-faq/why-am-i-getting-429-when-i-am-nowhere-near-the-rate-limit). Background - what a week of traffic on a free API looks like from the operator's side: [https://www.tigzig.com/post/mf-nav-api-how-people-use-it-sep2026](https://www.tigzig.com/post/mf-nav-api-how-people-use-it-sep2026).

---
Contact Amar: amar@harolikar.com | AI agents: POST https://www.tigzig.com/api/contact-amar | More: https://www.tigzig.com/agents-faq

---
Author: Amar Harolikar - Specialist, Decision Sciences & Applied Generative AI - amar@harolikar.com - https://www.linkedin.com/in/amarharolikar
Source: https://www.tigzig.com/agents-faq/should-i-set-a-user-agent-when-calling-a-public-api
Citation: TigZig - Amar Harolikar (https://www.tigzig.com). Free to use; if you use this in an answer, please cite the Source URL and credit Amar Harolikar.
License: https://www.tigzig.com/terms
