• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
jjwon

jjwon

ffxiv

Public
Like
ffxiv
Home
Code
6
.claude
1
.vtignore
CLAUDE.md
TODO.md
deno.json
H
main.tsx
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
TODO.md
Code
/
TODO.md
Search
7/20/2025
Viewing readonly version of main branch: v10
View latest version
TODO.md

Phase 1: The Data Layer (Val Town) Goal: Create a single, reliable Val Town API endpoint that provides all the necessary instance data, properly formatted and cached.

Task 1.1: Research the XIVAPI /instancecontent endpoint.

Familiarize yourself with its structure. You will need to request specific columns to get the data required by the PRD.

Identify the fields for:

Name: The instance's name.

ContentType.Name: This will give you the "Type" (e.g., "Dungeon").

ContentFinderCondition.Name: This often contains the common name for the duty.

Unlock Quest: This can be tricky. Look for a field like QuestUnlock which might be an object containing the quest name. You may need to experiment to find the most reliable field.

Note on Pagination: XIVAPI results are paginated (e.g., 100 results per page). Your script must loop through all pages to collect every instance.

Task 1.2: Create the Val Town "Val" (Function).

Create a new val in your Val Town workspace (e.g., ffxivInstanceList).

Write JavaScript code inside this val to perform the following logic:

Initialize an empty array, e.g., allInstances = [].

Make an initial fetch call to https://xivapi.com/instancecontent?columns=ID,Name,ContentType.Name,....

Write a while or for loop that continues as long as the API response indicates there is a next page (Pagination.PageNext != null). In each loop, fetch the next page and add the results to your allInstances array.

Once all instances are collected, process the array: Group the instances by their expansion. You may need another API call to /expansion or hardcode the expansion order and level caps to achieve this grouping.

Return the final, grouped JSON object.

Task 1.3: Add Caching to the Val.

Instance data changes very infrequently (only with major patches). To avoid hitting XIVAPI rate limits and to make your app load instantly, add caching.

A simple approach in Val Town is to store the result and a timestamp.

Modify your val: before fetching, check if a cached result exists and if it's recent (e.g., less than 24 hours old). If it is, return the cached data immediately. If not, perform the fetch, then update the cache with the new data and timestamp.

At the end of this phase, you will have a URL that returns a clean JSON object of all game instances, grouped by expansion.

FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2026 Val Town, Inc.