gitignore.io API
Build a .gitignore from any combination of languages, editors and operating systems with one GET request. No key. Verified example and the CORS caveat.
Endpoint tested and returned HTTP 200 on 21 Aug 2026
What is the gitignore.io API?
gitignore.io generates `.gitignore` files over HTTP. `GET https://www.toptal.com/developers/gitignore/api/node,macos` returns a combined ignore file as plain text, and `/api/list` returns every available template name. No API key is required.
This is the endpoint behind the `gi` shell function that a great many developers keep in their dotfiles, and it has outlived several rewrites and one change of custodian. Combining templates is the whole feature: pass a comma-separated list and you get one merged file with each section clearly headed, deduplicated and commented with a link back to the exact query that produced it. That header comment is genuinely useful months later when someone asks why a rule is there.
Templates are emitted in alphabetical order regardless of the order you request them, which surprises people who expect their own precedence to be preserved. Since `.gitignore` semantics are mostly order-independent apart from negation patterns, this rarely matters, but it is worth knowing if you are diffing generated files. The response also carries no CORS header, so a browser-based generator needs a server-side proxy.
Quick facts
- Base URL
https://www.toptal.com/developers/gitignore/api- Authentication
- No key or account. The service is hosted by Toptal, which took over the original gitignore.io project.
- Rate limit
- Not published. A `.gitignore` is generated once per project, so there is no reason to call it repeatedly.
- Pricing
- Free.
- CORS
- Not enabled — call it from your server
- Official docs
- Read the docs
How to use the gitignore.io API
Every request below was executed against the live API on 21 Aug 2026, and the response shown is the real body it returned — not an illustration.
1. Generate a combined .gitignore for Node and macOS
GET https://www.toptal.com/developers/gitignore/api/node,macos
curl 'https://www.toptal.com/developers/gitignore/api/node,macos'const res = await fetch("https://www.toptal.com/developers/gitignore/api/node,macos");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);import requests
res = requests.get("https://www.toptal.com/developers/gitignore/api/node,macos", timeout=20)
res.raise_for_status()
print(res.json())# Created by https://www.toptal.com/developers/gitignore/api/node,macos
# Edit at https://www.toptal.com/developers/gitignore?templates=node,macos
### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
{templates} | path | Required | Comma-separated template names. Case-insensitive, and order is not preserved in the output. node,macos |
/api/list | path | Optional | Return every available template name, comma-separated across several lines. /api/list |
/api/list?format=lines | path | Optional | Same list with one template name per line, which is easier to parse in a script. ?format=lines |
Response fields
(body)text/plain- The generated `.gitignore`. It is the file itself, ready to redirect straight into `.gitignore` from a shell.
(header comment)text- The first two lines record the generating URL and an edit link. Keep them: they document exactly which templates produced the file.
(section headers)text- Each template is introduced by a `### Name ###` comment, so a merged file remains readable and editable.
(ordering)n/a- Sections appear alphabetically, not in the order you requested them. Do not rely on request order for negation patterns.
What you can build with the gitignore.io API
- Bootstrap a `.gitignore` when starting a new repository
- Add ignore rules for a new editor or operating system to an existing project
- Standardise ignore files across a team with a single scripted command
- Generate ignore files inside a project scaffolding tool or template
- Check which templates exist before writing rules by hand
Common errors and how to fix them
404 with an unknown template message
One of the names in the comma-separated list does not exist.
Fix: Fetch `/api/list` and match exactly; names use hyphens, such as `visualstudiocode` and `intellij+all`.
CORS error in the browser
No `Access-Control-Allow-Origin` header is sent.
Fix: Call it from your server or from a CLI. A browser-only generator needs a proxy.
Sections in unexpected order
Output is sorted alphabetically, not by request order.
Fix: If you rely on negation patterns overriding earlier rules, review and reorder the generated file by hand.
gitignore.io API — frequently asked questions
Is the gitignore.io API free?
Yes, with no key or account. It is hosted by Toptal, which maintains the original gitignore.io project.
How do I list all available templates?
Request `/api/list`, or `/api/list?format=lines` for one name per line, which is far easier to parse in a script.
Can I combine several templates?
Yes, that is the main feature. Pass them comma-separated, as in `node,macos,visualstudiocode`, and the service merges and deduplicates the sections.
Can I call it from front-end JavaScript?
Not directly, because there is no CORS header. Use it from a terminal, a build script or your own backend proxy.
Tools that pair with this API
.gitignore Generator
Build a .gitignore file by selecting your stack — Node, Python, Java, Go, Rust, Unity, macOS, Windows, IDEs — merged, de-duplicated and ready to download.
GitHub Actions Workflow Generator
Build a .github/workflows CI file from a form: triggers, runner OS, language version matrix, dependency caching, permissions and lint, test and build steps.
Text Compare
Compare two texts online free and highlight every difference. A private text comparison tool that finds matches and changes right in your browser.
Split Text Into Lines
Split text on a comma, semicolon, custom delimiter or every N characters into one item per line. Great for CSV and lists. 100% in your browser.
Alternatives to gitignore.io API
If gitignore.io does not fit, these developer & testing apis cover similar ground. Every one was called before publishing, and each links to its own reference page with a working curl command and the response it returned.
| API | What it does | Auth | CORS | Last verified |
|---|---|---|---|---|
| GitHub REST API | GitHub REST API with no key for public data: repository details, users, issues, releases and commits. 60 req/hour unauthenticated, 5,000 with a token. | No key | Yes | 19 Aug 2026 |
| JSONPlaceholder | Free fake REST API for testing and prototyping. Posts, comments, users and todos with full GET, POST, PUT and DELETE support. No key. Real curl examples. | No key | Yes | 19 Aug 2026 |
| Postman Echo | Postman Echo reflects your HTTP request back as JSON: headers, body, query params and auth. Free, no key, ideal for debugging clients. Real POST example. | No key | No | 19 Aug 2026 |
| DummyJSON | Free fake REST API with realistic products, users, carts, recipes and auth. Supports search, pagination, sorting and POST. No key. Tested GET and POST examples. | No key | Yes | 19 Aug 2026 |
| GitLab | Free GitLab API with no key for public projects: repositories, issues, merge requests, pipelines and releases. Works on gitlab.com and self-hosted. Tested. | No key | No | 20 Aug 2026 |
| Go Module Proxy | Free Go module proxy API with no key: list versions of any public Go module, get commit info and checksums straight from proxy.golang.org. Tested example. | No key | Yes | 19 Aug 2026 |
gitignore.io is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 21 Aug 2026; always check the official documentation before relying on this API in production, as terms and limits can change.