BYTETOOLS

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.

No API key requiredHTTPSFree tier

Endpoint tested and returned HTTP 200 on 2026-08-21

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 2026-08-21, 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
curl 'https://www.toptal.com/developers/gitignore/api/node,macos'
JavaScript (fetch)
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);
Python (requests)
import requests

res = requests.get("https://www.toptal.com/developers/gitignore/api/node,macos", timeout=20)
res.raise_for_status()
print(res.json())
Response — HTTP 200
# 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

ParameterTypeRequiredDescription
{templates}pathRequiredComma-separated template names. Case-insensitive, and order is not preserved in the output. node,macos
/api/listpathOptionalReturn every available template name, comma-separated across several lines. /api/list
/api/list?format=linespathOptionalSame 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.io is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-21; always check the official documentation before relying on this API in production, as terms and limits can change.