What This Script Does

This script runs automatically in the background and accepts any quest proposed in your party. You will never miss a quest again!


🔑 Step 1: Get Your Habitica API Keys

  1. Log in to your Habitica account.
  2. Click on your avatar in the top-left corner and select "Settings".
  3. Go to the "API" tab.
  4. Here you will find:

📝 Step 2: Create & Configure the Script

  1. Go to Google Apps Script.
  2. Click on the "New Project" button.
  3. A new editor will open. Delete all the default code you see.
  4. Copy and paste the entire code below into the empty editor.

javascript

function autoAcceptQuests() {
  var habId = "PASTE_YOUR_USER_ID_HERE";
  var habToken = "PASTE_YOUR_API_TOKEN_HERE";

  var params = {
    "method": "GET",
    "headers": {
      "x-api-user": habId,
      "x-api-key": habToken,
      "x-client": habId + "-AutoAcceptQuests"
    }
  };

  var response = UrlFetchApp.fetch("<https://habitica.com/api/v3/groups/party>", params);
  var partyData = JSON.parse(response.getContentText());

  if (partyData.data.quest && partyData.data.quest.key && !partyData.data.quest.active) {
    var acceptParams = {
      "method": "POST",
      "headers": {
        "x-api-user": habId,
        "x-api-key": habToken,
        "x-client": habId + "-AutoAcceptQuests"
      }
    };

    UrlFetchApp.fetch("<https://habitica.com/api/v3/groups/party/quests/accept>", acceptParams);
  }
}
  1. Replace the placeholders in the code:
  2. Click the floppy disk icon 💾 or press Ctrl+S to save the project. Name it (e.g., "Habitica Auto-Accept").

⚙️ Step 3: Set the Automatic Schedule (Trigger)