APIs and API Keys

Goals: connect your own app to an external service and understand what the API key makes possible!

  • Gradescope — submit the indicated portions by Sunday, November 15 at 11:59 pm Pacific.
  • Tutorial — be ready to discuss your work with your TA during tutorial in Week 9.

Hi all! You have used a coding agent to help build things. This week, we will explore how those things can use capabilities from other services. An API lets your code request something, such as an AI response, map data, or event listings. An API key authorizes access to a service and connects usage to an account or project.

In tutorial, we will walk through examples with different levels of difficulty. Then you will choose one to try or add an API feature to your final project. Pick a scope that gives you something new to learn, whether this is your first API call or you already use APIs.

📄 Assignment 8 — full instructions (PDF)

Assignment outline

This document is intended to be started in tutorial and completed for homework if necessary. Work through it in the order given.

  • Submit a short final project update
  • Choose and build an API integration
  • Reflect on what you connected and how it went

Part 1: Individual project work

We want to hear how it is going! Submit a short update on Gradescope:

  • Who are you working with?
  • What have you done, and what is your plan for the remaining work?
  • Will this project be something you will be proud of? If not, how can we help?

Be ready to share your project with a partner in tutorial in Week 9. Plan to finish it for your TA grading session in Week 10. The final poster session is on December 8 at 3:30 pm, with a 36 by 24 inch poster and a demo if possible.

Deliverable: Fill these questions out on Gradescope.

Not sure where to start? Try a sample script

Elise put together two starter prompts you can paste into your AI tool of choice: one for when you only have a rough idea and one for when you know what you want to build but need help getting it done. Fill in the bracketed parts with your own details.

📄 Project sample scripts (PDF)

If you have a rough idea:

Act as my brainstorming partner for CS193T: Thinking with AI. Help me turn my interests in [topic or rough idea] into a useful, reusable AI workflow for [intended users]. A recurring problem or task I would like to address is [problem or task]. My deadline is in 2 weeks. I am unsure about [questions]. Ask me a few focused questions at a time, and help me explore possibilities before choosing a tool or format.

Guide me toward developing my own project idea by asking about my interests, experiences, and tasks I find repetitive, difficult, or meaningful. Ask a few focused questions at a time, building on my answers to help me identify a problem I care about and imagine how AI could help. Encourage me to articulate what I would want to create, who it would serve, and why it would be useful. Help me refine my thinking and assess feasibility without presenting a list of projects to choose from.

Once I have a direction, help me define the smallest useful version by asking me to describe how someone would use it, from input to output. Help me work out what starts the workflow, what could happen automatically, where human review is needed, and what would make it reusable. Offer technical guidance and suitable tools as needed, while leaving the project’s purpose and key decisions with me. Help me define a simple test of success and one concrete first step. Keep your explanations straightforward and help me move forward without taking over the creative process.

If you need help with execution:

Act as my project planning and building partner for CS193T: Thinking with AI. I want to build [project] for [intended users] to address [problem or recurring task]. It should take [inputs] and produce [outputs], ideally as [agent, website, reusable process, or other format]. My deadline is in 2 weeks. I have already completed [existing work] and need help with [challenges].

Ask focused questions to resolve important gaps, then help me define the smallest useful version. Map the workflow from start to finish, including its trigger, inputs, actions, decisions, and outputs. Explain which steps need AI, which can use ordinary automation, what should be saved between runs, and where human approval is needed. Clarify what can run autonomously and what setup that requires.

Recommend suitable tools and turn the project into manageable build stages. For each stage, explain what to do, how to do it, and how to check that it works (providing prompts, code, or setup instructions as needed). Focus initially on one complete working run, then consider reuse and automation. Include realistic tests, ways to handle failures, and brief instructions for rerunning the system. Start with your most important clarifying questions, then guide me through these stages.

Part 2: Group tutorial activity

Choose your build

Choose one of the examples from the slides, or use the same approach in your own project. You only need to attempt one option. Start with the first build and add stretch goals if you have time.

  • Fridge helper (beginner). Enter ingredients and receive three meal suggestions. Stretch: save favorites or generate a shopping list.
  • Interview practice partner (intermediate). Build a three-question text interview with feedback. Adds conversation history and a sequence of steps.
  • Game character (advanced). Build one character with one clue. Adds character knowledge, player progress, and rules that your code enforces.
  • DIY campus map (intermediate). Show five locations with manually entered notes. Adds coordinates and your own location data.
  • Club event finder (intermediate to advanced). Show events from one source with a location and date filter. Adds changing data and missing or empty results.
  • Meet in the middle planner (advanced). Compare three venues for two starting locations. Adds multiple service requests and travel-time comparisons.

Deliverable: Nothing for now! You’ll describe your work in the reflection.

Part 3: Reflection — How did it go?

What did you connect using an API, and what does that connection let your project do? Write one short paragraph, approximately 4–6 sentences, covering:

  • What you built or attempted and which API you used
  • What you got working, including what your app sends and what it receives
  • One challenge you encountered and what you would try next

Deliverable: Copy and paste your reflection into Gradescope.

Submission

You should have two items to submit to Gradescope by Sunday, November 15 at 11:59 pm:

  1. Your API build reflection
  2. Your final project update

Once you’re done, use this time to work on your final project!