You are browsing as a guest. Sign up (or log in) to start making projects!

D-Pod

@D-Pod

Joined July 3rd, 2026

  • 6Devlogs
  • 1Projects
  • 0Ships
  • 0Votes
Open comments for this post

4h 40m 42s logged

GraphQL Handler Class Finished (Recap)

A quick recap of what my project structure will be like, and what GraphQL does, since I don’t think I stated that too clearly…


How This Should Theoretically Work:

This is a web scraper that gets movie showtimes over different days from https://amctheatres.com/ and renders them as a calendar. But before you can even get the showtimes, you need the theater to get showtimes from (duh). Thankfully, I don’t have to rebuild this from scratch since I found AMC’s graphQL endpoint and their query for fetching theater locations by search term. (If I didn’t find this I would have likely given up on the project.)

Since the query is already pretty much built for me, I can recreate a theater lookup modal, similar to AMC’s, so the user can choose a nearby theater. Using the theater’s backend information returned in the query,
I can then construct a URL for that theater’s showtimes page, then scrape it.

Currently I’m just making the backend, I’ll move to the UI after I’m finished with making the backend components.

My Query Handler

So I decided to make the query handling process object-oriented because I didn’t want a bunch of variables holding long strings laying around. Before I explain how the query handler works, I need to explain how the query itself works (I’ll make this quick I promise).

Query Structure

It basically takes a search query (search term) and looks up matching locations. It returns a list of locations (which can be cities or theaters), the length of which is indicated by a resultCount parameter, with each location also returning a list of theaters around it. The search query and result count are given in a separate variables json. The query structure basically looks like this (simplified version):

query QueryName($query: String, $resultCount: Int = 10) {
  locations(query: $query, first: $resultCount) {
    [here you put in attributes you want returned. ex:]
    title
    latitude
    longitude
    
    theatres { [this is you requesting each location's theatres and their info]
      [here is where you put the THEATRES' attributes you want. ex:]
      name
      theatreId
      city
      
      attributes(type: FILTERS, first: 4) { [and this is if you want the list of theatres' features, like available formats, type of seating, etc.]
        name [just asking for the attributes' names]
      }
    }
  }
}

The Query Handler

As you can see, all of this is incredibly painful. So I made a class that will take lists of attributes you want (location_fields, theatre_fields, attributes_fields) and construct a query, also with a method to send a request with a search term. All of this is shown in the video.

Where to next?

Now it’s time to build the url constructor and web scraper 😩 wish me luck guys

0
0
9
Open comments for this post

1h 13m 18s logged

GraphQL pain

I started researching GraphQL and JSON because I haven’t done much of either in the past. I snooped around in the AMC queries some more to try and make a query of my own, also trying to figure out how I’m going to structure theater lookup in the user experience. this is hard

0
0
6
Open comments for this post

55m logged

endpoint day

after snooping around in the “network” tab of Inspect I found AMC’s graphQL endpoint. after a bit of pain and not knowing how graphQL works, I finally was able to reproduce the request and get it to give me output. this is so that I can hopefully recreate AMC’s “select a theatre” UI from scratch, instead of having the user put in their theatre.

help

0
0
5
Open comments for this post

1h 3m 42s logged

I set up Poetry for python package and env management (including Jupyter notebooks) and started experimenting with fetching AMC’s showtime pages. Here’s what I found:

  1. You can’t request a showtimes page by itself. It will ask for a theater location.
  2. After peeking around in dev tools on the showtimes page, I found that it actually sends a request to the server with a theater set in the url!
  3. There is also a page on AMC to view showtimes for ALL movies, which I could theoretically use later to create a calendar for any movie, instead of just for one specific movie’s showtimes.
    Still much work to do, but I’m getting there! 👍
0
0
2
Open comments for this post

47m 43s logged

Wrote out a development plan for my project with all the packages I will need. phew, this is gonna be a long ride.

0
0
10

Followers

Loading…