# Rock Paper Scissors API

> Rock Paper Scissors API simulates the classic hand game with detailed outcome analysis, statistics, and support for multiple rounds.

**Endpoint:** `GET https://api.apiverve.com/v1/rockpaperscissors`  
**Category:** Games  
**Cost:** 1 credit per call  
**Canonical page:** https://apiverve.com/marketplace/rockpaperscissors

## Overview

Perfect for building games, implementing random decision systems, or adding interactive elements to applications with emoji support and detailed results.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl "https://api.apiverve.com/v1/rockpaperscissors?choice=rock&rounds=5" \
  -H "x-api-key: YOUR_API_KEY"
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `choice` | string | No | Your choice - omit for random. default random. One of: rock, paper, scissors, r, p, s, random |
| `rounds` | integer | No | Number of rounds to play. default 1. range 1-100 |

## Response fields

- `total_rounds` — number · Total number of rounds played in the game
- `player_choice_mode` — string · Mode of player selection: manual or random choice
  - `games.0.round` — number · Sequential round number in the game series
  - `games.0.player_choice` — string · Player's hand choice: rock, paper, or scissors
  - `games.0.player_emoji` — string · Emoji representation of player's choice
  - `games.0.computer_choice` — string · Computer's hand choice: rock, paper, or scissors
  - `games.0.computer_emoji` — string · Emoji representation of computer's choice
  - `games.0.outcome` — string · Round outcome: player, computer, or tie result
  - `games.0.message` — string · Human-readable message describing round outcome · (premium)
- `results` — object · Statistical summary of all game rounds played
  - `results.player_wins` — number · Count of rounds won by the player · (premium)
  - `results.computer_wins` — number · Count of rounds won by the computer · (premium)
  - `results.ties` — number · Count of rounds resulting in a tie · (premium)
  - `results.player_win_percentage` — number · Percentage of rounds won by player · (premium)
  - `results.computer_win_percentage` — number · Percentage of rounds won by computer · (premium)
  - `results.tie_percentage` — number · Percentage of rounds resulting in tie · (premium)
- `overall_winner` — string · Overall game winner: player, computer, or tie · (premium)
- `game_rules` — object · Object defining what each choice beats
  - `game_rules.rock_beats` — string · What rock beats in the game
  - `game_rules.paper_beats` — string · What paper beats in the game
  - `game_rules.scissors_beats` — string · What scissors beats in the game

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "total_rounds": 5,
    "player_choice_mode": "manual",
    "games": [
      {
        "round": 1,
        "player_choice": "rock",
        "player_emoji": "🪨",
        "computer_choice": "paper",
        "computer_emoji": "📄",
        "outcome": "computer",
        "message": "Computer wins! undefined"
      },
      {
        "round": 2,
        "player_choice": "rock",
        "player_emoji": "🪨",
        "computer_choice": "rock",
        "computer_emoji": "🪨",
        "outcome": "tie",
        "message": "It's a tie! Both chose rock"
      },
      {
        "round": 3,
        "player_choice": "rock",
        "player_emoji": "🪨",
        "computer_choice": "rock",
        "computer_emoji": "🪨",
        "outcome": "tie",
        "message": "It's a tie! Both chose rock"
      },
      {
        "round": 4,
        "player_choice": "rock",
        "player_emoji": "🪨",
        "computer_choice": "paper",
        "computer_emoji": "📄",
        "outcome": "computer",
        "message": "Computer wins! undefined"
      },
      {
        "round": 5,
        "player_choice": "rock",
        "player_emoji": "🪨",
        "computer_choice": "scissors",
        "computer_emoji": "✂️",
        "outcome": "player",
        "message": "You win! Rock crushes scissors"
      }
    ],
    "results": {
      "player_wins": 1,
      "computer_wins": 2,
      "ties": 2,
      "player_win_percentage": 20,
      "computer_win_percentage": 40,
      "tie_percentage": 40
    },
    "overall_winner": "computer",
    "game_rules": {
      "rock_beats": "scissors",
      "paper_beats": "rock",
      "scissors_beats": "paper"
    }
  }
}
```

## Use cases

- **Game Development** — Build Rock Paper Scissors game apps and interactive experiences with multi-round gameplay and statistics tracking
- **Decision Systems** — Implement random decision-making systems using Rock Paper Scissors logic for conflict resolution and choice selection
- **Gaming Features** — Create gaming features and tournaments with automated opponent moves, win/loss tracking, and performance analytics
- **Interactive Apps** — Add interactive gaming elements to applications for user engagement and entertainment value

## SDKs

- **npm** — `npm install @apiverve/rockpaperscissors` (https://www.npmjs.com/package/@apiverve/rockpaperscissors)
- **PyPI** — `pip install apiverve-rockpaperscissors` (https://pypi.org/project/apiverve-rockpaperscissors/)
- **NuGet** — `dotnet add package APIVerve.API.RockPaperScissors` (https://www.nuget.org/packages/APIVerve.API.RockPaperScissors)
- **Source** — https://github.com/apiverve/rockpaperscissors-api

## More

- Full reference: https://docs.apiverve.com/ref/rockpaperscissors
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
