Back to .md Directory

AoC Puzzle Description and Input Data

Configures HTTP requests to fetch Advent of Code puzzle descriptions and input data from the official website.

May 2, 2026
0 downloads
1 views
ai agent rag
View source

What this file does

Configures HTTP requests to fetch Advent of Code puzzle descriptions and input data from the official website.

When to use it

  • Setting up automated puzzle data retrieval for AoC
  • Writing a script or agent that needs to download daily puzzle inputs
  • Creating a local AoC project structure with sample and user inputs

Assumes this stack

PythonHTTPAdvent of Code

trigger: always_on

AoC Puzzle Description and Input Data

When asked to retrieve any information from the Advent of Code (AoC) website, use the following configuration for API calls to https://adventofcode.com.

Obtain AOC_SESSION_COOKIE

  • This environment variable may already be set. If not, find it in .env.

HTTP Headers

  • Cookie: session=<AOC_SESSION_COOKIE>
  • User-Agent: github.com/derailed-dash/Advent-of-Code by derailed.dash@gmail.com (Recommended by AoC)

Retrieving Puzzle Description

  • URL: https://adventofcode.com/{year}/day/{day} (e.g., https://adventofcode.com/2018/day/2)
  • Note: The description usually has two parts. Part 2 is only available after Part 1 is solved.

Retrieving Sample Puzzle Input

  • Source: The "sample input" is usually found within the puzzle description HTML, often in a <pre><code> block.
  • Part 1 vs Part 2: Sample inputs may differ between parts. Part 2 description is locked until Part 1 is complete.
  • Storage: Save as /src/AoC_{year}/d{nn}/input/sample_input_part_n.txt
    • Ensure d{nn} is zero-padded (e.g., d04).

Retrieving (User-Specific) Puzzle Input Data

  • URL: https://adventofcode.com/{year}/day/{day}/input
  • Storage: Save as /src/AoC_{year}/d{nn}/input/input.txt
    • Ensure d{nn} is zero-padded.

Operational Rules

  • No Unsolicited Actions: Do NOT perform additional steps (like solving the puzzle) unless asked.
  • Cleanup: Do NOT persist the downloaded desc.html file. If you download it for processing, you MUST delete it immediately after the task is complete.

What's inside

5 operational sections: session cookie, HTTP headers, puzzle description retrieval, sample input retrieval, user input retrieval, plus cleanup rules.

Change this for your project

  • Replace github.com/derailed-dash/Advent-of-Code with your own repository URL
  • Replace derailed.dash@gmail.com with your own email
  • Replace /src/AoC_{year}/d{nn}/input/ with your own project path

Where it goes

Keep it in your repository where the agent or team that needs it will read it.

Related Documents