DEV Community

Cover image for I turned a joke product generator into a real API (and a CLI, and a faker.js plugin)
kafk
kafk

Posted on

I turned a joke product generator into a real API (and a CLI, and a faker.js plugin)

A while back I built Anycrap — a fake store full of absurdist AI-generated products. It hit #1 on Hacker News, got way more traffic than expected.

Here's what exists now.

REST API

35,000+ products with names, descriptions, AI images, and 23 categories. Free key, no credit card.

curl https://anycrap.shop/api/v1/products/random \
  -H "Authorization: Bearer YOUR_KEY"
Enter fullscreen mode Exit fullscreen mode

60 req/min, CORS included, OpenAPI spec available at /api/v1/docs.

CLI

npx anycrap random
npx anycrap random -c food
npx anycrap search "underwater"
npx anycrap categories
Enter fullscreen mode Exit fullscreen mode

faker.js plugin

Drop-in replacement for faker.commerce.productName() — no API call, bundled data, works offline.

import { faker } from '@faker-js/faker';
import { createAnycrapFaker } from 'anycrap-faker';

const anycrap = createAnycrapFaker(faker);

anycrap.productName()        // "Thought-Cancelling Headphones"
anycrap.productDescription() // "Headphones that don't just block sound — they block thoughts."
anycrap.product()            // { name, slug, description, category }
Enter fullscreen mode Exit fullscreen mode

Useful for seeding databases, test fixtures, anywhere you'd use Lorem Ipsum but want something less boring.

HuggingFace dataset

Full 35k rows available at huggingface.co/datasets/kafked/anycrap if you want to train something cursed.

What you can actually build with it

  • Party/trivia game item generator
  • Absurdist placeholder data
  • Game shop inventory names
  • Creative writing / brainstorming tool
  • "Product of the day" widget

Full docs: anycrap.shop/developers

Top comments (0)