# stripe-analysis

This repo mainly contains scripts for analyzing Stripe data to find relevant webs of accounts.

To get started with the scripts, copy `example.env` to `.env` and fill in the relevant credentials and API keys. Ask Nat if you need help here.

First find some interesting pool of stripe customer ids by manually looking at app/song data.
Send through the magic bot string `99fee36393b59ba3a9f770a3c349ba01` along with some very specific lyrics to find the clips in ES.
Once you have some users look through snowflake/postgres to find some Stripe customer ids.

Then use `stripe_find_related_accounts.py` to find all related accounts in the network by email and card fingerprint like:

```
uv run stripe_find_related_accounts.py --output-prefix=aiby --customer-ids cus_QTmBdgumz4ds8q cus_QLvgh66qsvDAXI
```

This will output a number of prefixed files that should have:

- suno user ids
- stripe customer ids
- stripe email addresses
- stripe card fingerprints

You can then take some action based on these.

You can create Stripe card fingerprint lists with:

```
uv run stripe_update_fingerprint_lists.py --fingerprints-file=mozart-2024-10-29_fingerprints.txt --stripe-list-prefix=mozart_initial
```

Or you can BotJail these users (database setup required). Add `--execute` to actually add them to jail.

```
uv run add_users_to_botjail.py --user-id-file api_wrapper_user_ids.txt --copycat-name misc-api-bots
```
