{
 "kind": "tool",
 "slug": "node-fetch",
 "path": "tools/node-fetch/",
 "name": "node-fetch",
 "maker": null,
 "density": "full",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "HTTP clients and networking",
   "tools/http-clients/"
  ]
 ],
 "lead": "Browser-style fetch() for older Node.js code.",
 "chips": [
  {
   "label": "HTTP clients and networking",
   "path": "tools/http-clients/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install node-fetch"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/node-fetch/node-fetch"
  },
  {
   "label": "Website",
   "href": "https://github.com/node-fetch/node-fetch"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "MIT",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": "to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software",
   "note": "MIT allows use in paid and closed-source products.",
   "src": "https://github.com/node-fetch/node-fetch/blob/main/LICENSE.md"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change May 12, 2026",
   "note": "Latest GitHub release Jul 25, 2023. ",
   "src": "https://github.com/node-fetch/node-fetch"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "106 projects",
   "status": "info",
   "sub": "#10 of 126 in its category",
   "note": "Dependency in 106 public GitHub projects set up for AI coding agents that we scanned (1.7%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Install only",
   "status": "info",
   "sub": null,
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": null
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily; card checked Nov 11, 2026.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What node-fetch does",
   "parts": [
    {
     "t": "prose",
     "text": "node-fetch lets a Node.js program load web pages and call online services with fetch(), the same command web pages use. Node.js 18 and newer has fetch() built in, so today it mostly keeps older projects working. It is free under the MIT license."
    },
    {
     "t": "h3",
     "text": "What people build with it"
    },
    {
     "t": "uses",
     "items": [
      {
       "title": "Read data from an online service",
       "text": "Your server script asks another service for data, like a list of products, and gets it back as a ready object.",
       "idea": false
      },
      {
       "title": "Send form or order data onward",
       "text": "When a visitor submits a form, your server passes the details on to another service, for example a mailing list or a shop system.",
       "idea": false
      },
      {
       "title": "Save a large download to disk",
       "text": "Your server downloads a big file, like a report or a video, and writes it to disk piece by piece instead of holding it all in memory.",
       "idea": false
      },
      {
       "title": "Give up on slow requests",
       "text": "A partner service sometimes hangs; your code cancels the request after a set time and shows a friendly error instead of waiting forever.",
       "idea": false
      },
      {
       "title": "Read every cookie a server sets",
       "text": "A test or a login helper needs each Set-Cookie line a server sends; node-fetch gives them as a list.",
       "idea": false
      },
      {
       "title": "Keep an older project working",
       "text": "An older app that still uses require() keeps its web requests working on the version 2 line while you plan an upgrade.",
       "idea": false
      }
     ]
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "node-fetch popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "75",
       "of": "/ 100",
       "l": "Gid Score, #203 overall"
      },
      {
       "n": "301M",
       "l": "downloads a week, npm"
      },
      {
       "n": "8,845",
       "l": "GitHub stars"
      },
      {
       "n": "106",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How node-fetch is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "node-fetch is a dependency in 106 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (2.2% of the 4,867 JavaScript/TypeScript ones), #10 of 126 in http clients and networking.",
      "Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 390; those are left out of every share on this page.",
      "The most used alternative in our scan is Axios (470 projects).",
      "Projects that use it most often also use dotenv (67.9%), Axios (34.0%), Express (31.1%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "63 projects, 2.6%",
       "v": "Cursor",
       "path": "agents/cursor/"
      },
      {
       "l": "49 projects, 1.6%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      },
      {
       "l": "42 projects, 1.3%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "9 projects, 1.9%",
       "v": "Gemini CLI",
       "path": "agents/gemini-cli/"
      },
      {
       "l": "7 projects, 2.1%",
       "v": "OpenClaw",
       "path": "agents/openclaw/"
      },
      {
       "l": "7 projects, 2.5%",
       "v": "Devin Desktop",
       "path": "agents/devin-desktop/"
      },
      {
       "l": "6 projects, 1.3%",
       "v": "OpenAI Codex",
       "path": "agents/openai-codex/"
      },
      {
       "l": "5 projects, 1.5%",
       "v": "OpenCode",
       "path": "agents/opencode/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 67.9% of its projects",
       "v": "dotenv",
       "path": "tools/dotenv/"
      },
      {
       "l": "In 34.0% of its projects",
       "v": "Axios",
       "path": "tools/axios/"
      },
      {
       "l": "In 31.1% of its projects",
       "v": "Express",
       "path": "tools/express/"
      },
      {
       "l": "In 34.0% of its projects",
       "v": "date-fns",
       "path": "tools/date-fns/"
      },
      {
       "l": "In 34.9% of its projects",
       "v": "Supabase JS",
       "path": "tools/supabase-supabase-js/"
      },
      {
       "l": "In 77.4% of its projects",
       "v": "TypeScript",
       "path": "tools/typescript/"
      },
      {
       "l": "In 26.4% of its projects",
       "v": "Jest",
       "path": "tools/jest/"
      },
      {
       "l": "In 25.5% of its projects",
       "v": "ts-node",
       "path": "tools/ts-node/"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "usage",
   "h2": "More about node-fetch",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "Funding",
       "path": "tools/funding/",
       "items": [
        "GitHub Sponsors: https://github.com/node-fetch",
        "Open Collective: https://opencollective.com/node-fetch",
        "5 GitHub sponsors"
       ]
      },
      {
       "title": "Head to head",
       "items": [
        {
         "text": "Axios vs node-fetch",
         "note": "used together in 36 projects",
         "path": "tools/compare/axios-vs-node-fetch/"
        }
       ]
      },
      {
       "title": "More in HTTP clients and networking",
       "path": "tools/http-clients/",
       "items": [
        {
         "text": "Requests",
         "path": "tools/requests-py/"
        },
        {
         "text": "httpx",
         "path": "tools/httpx/"
        },
        {
         "text": "ws",
         "path": "tools/ws/"
        },
        {
         "text": "postgres",
         "path": "tools/postgres/"
        },
        {
         "text": "aiohttp",
         "path": "tools/aiohttp/"
        },
        {
         "text": "websockets",
         "path": "tools/websockets/"
        },
        {
         "text": "redis (Python)",
         "path": "tools/redis-pypi/"
        },
        {
         "text": "ioredis",
         "path": "tools/ioredis/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "node-fetch",
       "me": true,
       "facts": [
        "MIT",
        "Gid 75",
        "301M/wk"
       ]
      },
      {
       "name": "undici",
       "why": "Pick undici, the HTTP client from the Node.js project, when you want the same engine as Node's built-in fetch plus pooling and proxy options.",
       "path": "tools/undici/",
       "facts": [
        "MIT",
        "Gid 76",
        "355M/wk"
       ]
      },
      {
       "name": "Axios",
       "why": "Pick axios when you want one client for browser and Node.js with request and response interceptors.",
       "path": "tools/axios/",
       "facts": [
        "MIT",
        "Gid 91",
        "15M/wk"
       ]
      },
      {
       "name": "Ky",
       "why": "Pick ky when you like fetch but want retries, timeouts and JSON helpers on top, in the browser or Node.js.",
       "path": "tools/ky/",
       "facts": []
      },
      {
       "name": "cross-fetch",
       "why": "Universal WHATWG Fetch API implementation for Node, browsers and React Native.",
       "path": "tools/cross-fetch/",
       "facts": [
        "MIT",
        "Gid 60",
        "53.9M/wk"
       ]
      }
     ],
     "more": "Compare node-fetch with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "prompt",
     "text": "On Node.js 18+ use the built-in fetch; only if this project must keep node-fetch, pin node-fetch@3.3.2 (ES modules) or node-fetch@2.7.0 (require), check response.ok, and cancel slow calls with an AbortController."
    },
    {
     "t": "steps",
     "items": [
      {
       "text": "Add node-fetch to your project; version 3 needs Node.js 12.20 or newer.",
       "code": "npm install node-fetch",
       "src": "https://github.com/node-fetch/node-fetch/blob/main/README.md"
      },
      {
       "text": "Import it as an ES module. For a require() project, install node-fetch@2 instead.",
       "code": "import fetch from 'node-fetch';",
       "src": "https://github.com/node-fetch/node-fetch/blob/main/README.md"
      },
      {
       "text": "Treat error statuses yourself; a 404 or 500 does not throw, so check response.ok.",
       "code": null,
       "src": "https://github.com/node-fetch/node-fetch/blob/main/README.md"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Mistakes to avoid"
    },
    {
     "t": "mistakes",
     "items": [
      {
       "dont": "const fetch = require('node-fetch')   // with node-fetch 3",
       "fix": "import fetch from 'node-fetch' (or the built-in fetch on Node.js 18+); for require() code install node-fetch@2",
       "why": "Version 3 is ESM-only and cannot be loaded with require()."
      },
      {
       "dont": "fetch(url, { timeout: 5000 })",
       "fix": "Pass signal from an AbortController and call controller.abort() after 5 seconds",
       "why": "The timeout option was dropped in version 3 because it is not part of the fetch standard."
      },
      {
       "dont": "try { await fetch(url) } catch { /* treat as failed */ } and nothing else",
       "fix": "Also check response.ok (or response.status) and handle 4xx and 5xx answers",
       "why": "Error statuses do not throw; only network and operational errors do."
      },
      {
       "dont": "fetch('/api/users')",
       "fix": "fetch(new URL('/api/users', baseUrl))",
       "why": "Only absolute addresses work on the server."
      },
      {
       "dont": "npm install node-fetch in a new project on Node.js 18 or newer",
       "fix": "Use the global fetch that Node.js provides",
       "why": "Node.js has shipped fetch without a flag since version 18, and node-fetch has had no release since 2023."
      }
     ]
    }
   ]
  },
  {
   "id": "faq",
   "nav": "Questions",
   "h2": "Questions",
   "parts": [
    {
     "t": "faq",
     "items": [
      {
       "q": "Do I still need node-fetch?",
       "a": "Usually not on Node.js 18 or newer, which has fetch() built in. It still helps older Node.js versions and code that uses its extras.",
       "evidence": {
        "url": "https://nodejs.org/api/globals.html",
        "quote": "A browser-compatible implementation of the fetch() function."
       }
      },
      {
       "q": "Why does require('node-fetch') fail?",
       "a": "Version 3 is ESM-only. Use import, a dynamic import(), or install version 2.",
       "evidence": {
        "url": "https://github.com/node-fetch/node-fetch/blob/main/README.md",
        "quote": "node-fetch from v3 is an ESM-only module - you are not able to import it with require()."
       }
      },
      {
       "q": "How do I set a timeout?",
       "a": "The old timeout option was removed in version 3; pass an AbortController's signal and abort it after the time you choose.",
       "evidence": {
        "url": "https://github.com/node-fetch/node-fetch/blob/main/docs/v3-UPGRADE-GUIDE.md",
        "quote": "The timeout option was removed."
       }
      },
      {
       "q": "Why did a 404 not throw an error?",
       "a": "Error statuses are normal responses; check response.ok or response.status yourself.",
       "evidence": {
        "url": "https://github.com/node-fetch/node-fetch/blob/main/README.md",
        "quote": "3xx-5xx responses are NOT exceptions, and should be handled in then(), see the next section."
       }
      },
      {
       "q": "Can I call a relative address like /api/users?",
       "a": "No. Give a full address such as https://example.com/api/users; relative ones are rejected.",
       "evidence": {
        "url": "https://github.com/node-fetch/node-fetch/blob/main/README.md",
        "quote": "url should be an absolute URL, such as https://example.com/."
       }
      }
     ]
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm node-fetch"
  ],
  [
   "Category",
   "HTTP clients and networking"
  ],
  [
   "License",
   "MIT"
  ],
  [
   "Gid Score",
   "75.1"
  ],
  [
   "Rank in category",
   "#10 of 126"
  ],
  [
   "GitHub",
   "node-fetch/node-fetch"
  ],
  [
   "Last change",
   "May 12, 2026"
  ]
 ],
 "good": [
  "Node.js 18 and newer have fetch() built in, so new projects usually do not need node-fetch.",
  "There has been no new release since July 2023 (3.3.2, and 2.7.0 on the old line).",
  "Version 3 works only with import, not require(); the maintainers keep version 2 for older code."
 ],
 "checked_line": "Read by AgentGid from 7 official pages, card checked Nov 11, 2026; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/node-fetch.png"
}