CLUB RESULTS

Run it in your software. Put it on USA Foosball.

Building your club's own site or bracket app? Give this prompt to the AI that codes with you. It connects your software to USA Foosball, tests every result against ours, and from then on each tournament you finish goes up by itself: the bracket, the standings, the podium, and Points Race points for every player.

For finished tournamentsSingle elim, double elim, round robin and MonsterSingles, BYP and DYP

THE PROMPT

Paste it here and it goes into the prompt. It stays on this page.

Connect this project to USA Foosball, so every tournament we finish in our software goes up on usafoosball.com by itself: the bracket, the standings, the podium, and Points Race points for every player.

1. Read https://usafoosball.com/integrations.md, all of it, before you change any code. It's the full spec, written for you. If it and this message disagree, it wins.

2. Keep our key out of the code. Read it from an environment variable named USA_FOOSBALL_API_KEY, add that name (not the key) to the project's example env file if there is one, and never commit the key. If the key at the end of this message still reads PASTE_YOUR_KEY_HERE, ask me for it once.
Then check it: GET https://foos-api.com/api/v1/integrations/schema with the header X-Club-Api-Key.
- 200: tell me "Connected to USA Foosball as {club.name from the answer}."
- 401: stop and tell me "USA Foosball didn't take that key. Check it's all there, or make a new one at usafoosball.com/integrations/api-key."

3. Find where this project finishes a tournament, and what it stores about one: the players, the teams, every match and who won it, and the final standings. Tell me in a few lines what you found before you build anything.

4. Build a reporter: one function that takes a finished tournament from our data and returns the JSON the spec describes. Use our own tournament ID as external_ref, so a corrected tournament sent again replaces the one that's up. Fill final_places from our own standings, never worked out from the matches: it's how USA Foosball checks our results are right.

5. Test it until it's right. Send real finished tournaments from our data (at least three, and one of every format we run) to POST https://foos-api.com/api/v1/integrations/tournaments/test. That endpoint never saves anything. It rebuilds the tournament, replays every match and checks the standings against our final_places. Fix the reporter until every one answers "ready": true. If a check fails because our own data is wrong, tell me; don't change what we send just to make it pass. Keep these test sends as tests or a script I can run again.

6. Show me one test answer: the tournament, the top four, and the Points Race points each player would earn. Then ask me before anything goes live.

7. When I say yes, wire it in. Right after a tournament finishes in our software, send it to POST https://foos-api.com/api/v1/integrations/tournaments. Do it in the background, so a slow or failed send never holds up our software; retry a failed send a few times, and log what still fails with USA Foosball's error. Then send our most recent finished tournament for real and give me its bracket_url. Only a real send's links work.

8. Finish with a short note for our README: what you added, the environment variable, how to run the test again, how to resend a corrected tournament, and how to turn it off.

If a tournament can't be sent the way the spec describes (a format it doesn't take yet), send it as it is, with a short note, to POST https://foos-api.com/api/v1/integrations/raw_results. A person at USA Foosball will post it by hand. Tell me when that happens.

Our key: PASTE_YOUR_KEY_HERE

Then paste it into your coding AI, with your software's project open.

How it works

  1. 1. Get your club's key.

    Every club has one. A club admin finds it on the club's key page, with the prompt already filled in.

  2. 2. Give the prompt to your coding AI.

    Cursor, Claude Code, Copilot or whichever AI builds your software with you, in your project. It finds where your tournaments finish and builds the reporter.

  3. 3. It tests until every result is right.

    It sends your past tournaments to our test endpoint, which saves nothing. We replay every match and check your standings against ours, and it fixes what doesn't match.

  4. 4. Then every tournament reports itself.

    Once the test passes and you say go, each tournament you finish goes up on its own and counts in the Points Race.

What your club gets

A real bracket.
Every match, with the same bracket, standings and podium as a tournament run here. Not a screenshot.
Points for every player.
It counts as a 10 in the Points Race. Players with an account get their results and points at once; everyone else when they claim them.
On your club's page.
With the rest of your club's tournaments, where players look for a place to play.
Your old ones too.
Send one from three years ago and it goes in on the day it was played.

Good to know

Test as often as you like.
The test endpoint never saves anything. A real send runs the same checks and refuses a result that doesn't match yours.
Fix it by sending it again.
The same tournament sent twice replaces the one that's up, points and all.
Finished tournaments only.
Swiss and live, match-by-match results aren't in yet. If one won't fit, your software sends it as it is and we post it by hand.
Nothing gets lost.
We keep everything your software sends, even what doesn't go in.
The spec your AI reads usafoosball.com/integrations.md · Plain text, no key needed

Questions? Text (302) 377-7797 or email [email protected].