npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

fakexy-to-json

v1.0.0

Published

Fetch and parse fakexy.com data to JSON. Fake addresses, profiles, credit cards by country.

Readme

fakexy-to-json

Fetch and parse fakexy.com data to JSON. Get fake addresses, profiles, and credit cards by country.

Important: fakexy.com is protected by Cloudflare. You must pass a valid cf_clearance cookie to get real data. Without it, requests will return 403. See Cloudflare cookie below for how to obtain it.

Install

npm install fakexy-to-json

Usage

import { getAddress, getProfile, getCreditCard } from 'fakexy-to-json';

// Pass the cf_clearance cookie (required - see Cloudflare section below)
const address = await getAddress({
  countryCode: 'us',
  headers: {
    Cookie: 'cf_clearance=YOUR_COOKIE_VALUE',
  },
});
console.log(address);
// { street, city, region, zipcode, phone, country, latitude?, longitude?, person?, creditcard? }

// Get a fake profile (US with state)
const profile = await getProfile({
  countryCode: 'us',
  stateCode: 'ca',
  headers: { Cookie: 'cf_clearance=YOUR_COOKIE_VALUE' },
});
console.log(profile);
// { name, gender, birthday, ssn }

// Get a fake credit card
const card = await getCreditCard({
  brand: 'visa',
  headers: { Cookie: 'cf_clearance=YOUR_COOKIE_VALUE' },
});
console.log(card);
// { brand, number, expire, cvv }

Cloudflare cookie

fakexy.com is behind Cloudflare. To get the cf_clearance cookie:

  1. Open fakexy.com in your browser
  2. Pass the "Just a moment..." challenge (wait for the page to load)
  3. Open DevTools → Application → Cookies → https://www.fakexy.com
  4. Copy the cf_clearance value
  5. Pass it in the headers option: headers: { Cookie: 'cf_clearance=YOUR_VALUE' }

The cookie expires after some time; you'll need to refresh it when requests start failing again.

API

getAddress(options?)

Fetches a fake address. Options:

  • countryCode – Two-letter country code (e.g. 'us', 'uk', 'de'). Default: 'us'
  • stateCode – State/region for countries that support it (e.g. 'ca', 'mi' for US)
  • headers – Custom HTTP headers. Required: include Cookie: cf_clearance=... (see Cloudflare cookie)
  • timeout – Request timeout in ms (default: 10000)

getProfile(options?)

Fetches a fake person profile. Options: same as getAddress.

getCreditCard(options?)

Fetches a fake credit card. Options:

  • brand'visa', 'mastercard', 'amex', 'discover'. Default: 'visa'
  • headers, timeout – Same as above

Error Handling

The package throws typed errors you can catch and handle:

import {
  getAddress,
  FakexyNetworkError,
  FakexyHttpError,
  FakexyParseError,
} from 'fakexy-to-json';

try {
  const address = await getAddress({
    countryCode: 'us',
    headers: { Cookie: 'cf_clearance=YOUR_VALUE' },
  });
} catch (err) {
  if (err instanceof FakexyNetworkError) {
    console.error('Network failed:', err.url, err.cause);
  } else if (err instanceof FakexyHttpError) {
    console.error('HTTP error:', err.status, err.url);
  } else if (err instanceof FakexyParseError) {
    console.error('Parse failed - site structure may have changed');
  }
}

Chrome Extension

The package works in Chrome extension background scripts or service workers. Add host_permissions to your manifest.json:

{
  "manifest_version": 3,
  "host_permissions": ["https://www.fakexy.com/*"]
}

Note: Content scripts run in page context and are subject to CORS. Call the package from the background script and use chrome.runtime.sendMessage to pass results to content scripts or popup. Use the chrome.cookies API to read cf_clearance for fakexy.com and pass it in headers.

Types

All types are exported for use in your code:

import type {
  AddressResult,
  PersonResult,
  CreditCardResult,
} from 'fakexy-to-json';

Supported Countries

Use SUPPORTED_COUNTRIES for the full list:

import { SUPPORTED_COUNTRIES } from 'fakexy-to-json';
// ['ar', 'au', 'bd', 'be', 'br', 'ca', 'cn', ...]

Disclaimer

This package is unofficial and not affiliated with, endorsed by, or sponsored by fakexy.com. You are responsible for complying with fakexy.com's terms of service and acceptable use policies when using this library, and for using any data only in lawful ways.

License

MIT