Day 3, 30 minutes · beginner
The shift
Steps 1 and 2 were manual browsing — fine for one asset. But the moment you need 20 candidates to pick from, manual scouting is painful. This is where AI tooling earns its keep.
Claude Code is Anthropic''s CLI that runs Claude inside your repo. It reads your project, writes code, runs commands, and commits. For a task like "fetch 30 candidate images from Pexels and write them to a JSON file," you describe the outcome in a sentence and Claude does the plumbing.
If you''d rather stay in the desktop app, Claude Desktop with Cowork folder sync (covered in the 7-Day AI Challenge) gives you the same muscle — Claude writes the script into your synced project folder, you run it.
Step 1 — Get a Pexels API key (free, 30 seconds)
- Sign in at https://www.pexels.com
- Go to https://www.pexels.com/api/new/ and fill in the form
- Copy the key, store it in an env var — never commit it
# in your shell or .env.local
export PEXELS_API_KEY="your-key-here"
Step 2 — The prompt that does the work
Open Claude Code in your project and paste something like this:
Write a Node.js script at
scripts/fetch-stock.mjsthat takes a search query as its first argument, calls the Pexels video search API using thePEXELS_API_KEYenv var, picks the highest-resolution MP4 from each result, and writesmanifest.jsoncontaining filename, CDN URL, poster URL, author name, and Pexels page URL for each pick. Skip clips shorter than 5s or longer than 30s. Don''t download the files themselves.
Claude Code will write the whole script — usually ~40 lines. You review it, commit it, and run it:
PEXELS_API_KEY=xxx node scripts/fetch-stock.mjs "coast aerial"
The resulting manifest.json is your shortlist.
Why this beats manual browsing
- Speed — 30 candidates in 3 seconds instead of 30 browser tabs
- Repeatability — rerun next month with a new query, same script
- Version controlled — your manifest is a reviewable artifact, not tabs in your head
- Composable — the next step turns this manifest into a picker UI automatically
A real example
The source of truth for this course was built exactly this way. One query to Claude Code, 50 candidate clips across 6 categories, total script length about 40 lines.
Today's actions
Ticks are not saved without an accountDo it in your tool
Claude
- Create your free Pexels key as the lesson shows. Keep it out of the chat: everything you type in a prompt is sent to the model.
- Install or open the Claude desktop app, sign in and click the Code tab at the top of the sidebar.
- In the environment selector, hover over the top entry in the Local group (your own computer) and click the gear icon. Enter one line,
PEXELS_API_KEY=followed by your key, and select Save changes. - Select that top entry in the Local group. Then click the project folder control, select Open folder… and choose your project. In the mode selector in the same row, pick Manual.
- Paste this prompt and press Enter.
Write a Node.js script at scripts/fetch-stock.mjs that takes a search query as its first argument, calls the Pexels video search API using the PEXELS_API_KEY environment variable, picks the highest-resolution MP4 from each result, and writes manifest.json containing filename, CDN URL, poster URL, author name and Pexels page URL for each pick. Skip clips shorter than 5 seconds or longer than 30 seconds. Do not download the video files themselves. Also store the search query in a field named query, and the width and height of the chosen file, in each entry. Read the key only from the environment variable PEXELS_API_KEY. Never print it and never write it to a file. First check that Node.js is installed on this computer, and give me the exact command that runs the script in my terminal. - Read the script in the diff (the list of changed lines) before you approve it: it must read the key from the environment and never print it. Then ask Claude
commit my changes with a descriptive message. - Select Terminal and run the command Claude gave you with your search term. If the script says the key is missing, ask Claude how to set
PEXELS_API_KEYin that terminal and type the key there yourself. - Click the path of
manifest.jsonin the chat to open your shortlist. Then ask Claude to commit it too, so the shortlist is in Git.
Note: The lesson text calls Claude Code "Anthropic's CLI". Today it is also the Code tab of the desktop app, used here. The lesson's "Cowork folder sync" is not a name Claude uses, so that route is left out. Commands Claude runs in this session can read the saved key too, so never ask Claude to show or print it. Node.js must be on your computer. No gear icon? Skip the key in step 3, do step 4 as written, and set PEXELS_API_KEY in the Terminal pane yourself, as step 7 says.
Paid planNeeds a paid Claude plan: Pro, Max, Ultra, Team or Enterprise. The Free plan does not include Claude Code.
ChatGPT
- Create your free Pexels key as the lesson shows. Never paste the key into the chat.
- Install or open the ChatGPT desktop app (macOS or Windows), sign in with your ChatGPT account and select Codex from the ChatGPT dropdown.
- Open your project folder: on Windows click Add new project or press Ctrl+O, on macOS press Cmd+O.
- On Windows, select Ask for approval beneath the composer before you send anything, so Codex applies its sandbox protections.
- Paste this prompt in the composer and send it.
Write a Node.js script at scripts/fetch-stock.mjs that takes a search query as its first argument, calls the Pexels video search API using the PEXELS_API_KEY environment variable, picks the highest-resolution MP4 from each result, and writes manifest.json containing filename, CDN URL, poster URL, author name and Pexels page URL for each pick. Skip clips shorter than 5 seconds or longer than 30 seconds. Do not download the video files themselves. Also store the search query in a field named query, and the width and height of the chosen file, in each entry. Read the key only from the environment variable PEXELS_API_KEY. Never print it and never write it to a file. Do not run the script yourself. Give me the exact commands to set PEXELS_API_KEY and to run the script in my own terminal, for Windows PowerShell and for macOS or Linux. Use YOUR_KEY as a placeholder for the key. - Open the review tab (Ctrl+Shift+G on Windows) and read the script before you keep it. On macOS, read the new file in your own editor. Commit it from the review pane or with your own Git tool.
- Decline if Codex asks for approval to run a command that needs network access. Run the commands Codex gave you in your own terminal, with your real key in place of
YOUR_KEYand your own search term. - Open
manifest.jsonin your project folder: that is your shortlist. Commit it too, so the shortlist is in Git.
Note: No paid plan needed: Codex is included on every plan. On Free and Go the Codex allowance is limited, and Codex in the desktop app is subject to rollout. The lesson text calls this Claude Code. In ChatGPT the matching tool is Codex in the desktop app, with your project opened as a local folder. Chat can write the script for you to copy and save, but it cannot run it against Pexels. The app has a terminal in each chat, but ChatGPT can read what it shows, so never print your key there.
Gemini
- Create your free Pexels key as the lesson shows. Never paste the key into the chat.
- On a computer, go to
gemini.google.com. Below the text box at the bottom, click Add Files, then Canvas. - Paste this prompt in the text box and click Submit.
Write a Node.js script at scripts/fetch-stock.mjs that takes a search query as its first argument, calls the Pexels video search API using the PEXELS_API_KEY environment variable, picks the highest-resolution MP4 from each result, and writes manifest.json containing filename, CDN URL, poster URL, author name and Pexels page URL for each pick. Skip clips shorter than 5 seconds or longer than 30 seconds. Do not download the video files themselves. Also store the search query in a field named query, and the width and height of the chosen file, in each entry. Read the key only from the environment variable PEXELS_API_KEY. Never print it and never write it to a file. In your chat reply, also give me the exact commands to set PEXELS_API_KEY and to run the script in my own terminal, for Windows PowerShell and for macOS or Linux. Use YOUR_KEY as a placeholder for the key. - Click Code at the top right of the Canvas panel and read the script. It must read the key from the environment and download no files.
- Copy the code by hand into a new file
scripts/fetch-stock.mjsin your project. You save and run it yourself. - Commit the script with your own Git tool. Then run the commands Gemini gave you in your own terminal, with your real key in place of
YOUR_KEYand a search term such ascoast aerial. - Open
manifest.jsonin your project folder: that is your shortlist. Commit it too, so the shortlist is in Git.
Note: No paid plan needed: Canvas works without a Google AI plan. The lesson text calls this Claude Code, which works inside your project. Canvas only writes the script: you save and run it yourself. Check its field names against the Pexels API docs. Antigravity CLI is Google's tool for work inside a project folder. This course has no checked guide for it.
Microsoft Copilot
- Open the Microsoft Copilot desktop app with your work account and select Code, at the top of the app or in the left navigation. Check this first: Copilot Code is a paid preview, and personal accounts in the Netherlands cannot get it.
- No Code tab, or only Request access or Learn more? Your licence or admin setting does not include it. Only cloud projects? Your admin may allow cloud only. In both cases use the Chat route in the last step.
- Create your free Pexels key as the lesson shows. Never paste the key into a Copilot prompt or a project file.
- Open your project folder as a local project. Then paste this prompt and send it. It asks for a plan first, so you can read what Copilot Code will do. Answer its questions.
First show me a plan, and wait for my OK before you change anything. Then write a Node.js script at scripts/fetch-stock.mjs that takes a search query as its first argument, calls the Pexels video search API using the PEXELS_API_KEY environment variable, picks the highest-resolution MP4 from each result, and writes manifest.json containing filename, CDN URL, poster URL, author name and Pexels page URL for each pick. Skip clips shorter than 5 seconds or longer than 30 seconds. Do not download the video files themselves. Also store the search query in a field named query, and the width and height of the chosen file, in each entry. Read the key only from the environment variable PEXELS_API_KEY. Never print it and never write it to a file. Do not run the script yourself. Give me the exact commands to set PEXELS_API_KEY and to run the script in my own terminal, for Windows PowerShell and for macOS or Linux. Use YOUR_KEY as a placeholder for the key. - Read the dialog when Copilot Code asks for approval for a network call or a terminal command. Approve only what you understand.
- Read the script in the code view before you run it: Copilot Code's sandbox does not cover a script you start yourself. It must read the key from the environment variable and write only a manifest, with no downloads.
- Commit the script with your own Git tool. Then run the commands Copilot Code gave you in your own terminal, with your real key in place of
YOUR_KEY. Openmanifest.json, your shortlist, and commit it too. - Chat route: in Microsoft Copilot Chat, ask for the same script as text, save it yourself as
scripts/fetch-stock.mjs, then commit and run it the same way.
Note: The lesson text calls this Claude Code. In Microsoft Copilot the closest is Copilot Code, the Code tab of the Microsoft Copilot desktop app. Copilot Code is a preview (Frontier), in English at this release. Personal accounts: United States and Canada only at launch, so not the Netherlands. Work accounts in the Netherlands: not confirmed. Microsoft's Cowork is a different feature, not a folder sync.
Paid planBilled by usage. Work: a Copilot licence (Microsoft pages differ on which), Frontier access, admin turns on the Code tab, a spending policy. Personal: Microsoft 365 Premium or Pro, US and Canada only.
Claude Code
- Create your free Pexels key as the lesson shows. Never paste the key into the chat or into a file you commit.
- Install Claude Code if you have not yet: in Windows PowerShell run
irm https://claude.ai/install.ps1 | iex, on macOS, Linux or WSL runcurl -fsSL https://claude.ai/install.sh | bash. Then runclaude --versionin a new terminal. - Go to your project folder in the terminal and run
claude. Log in when it asks you to. - Paste this prompt in Claude Code.
Write a Node.js script at scripts/fetch-stock.mjs that takes a search query as its first argument, calls the Pexels video search API using the PEXELS_API_KEY environment variable, picks the highest-resolution MP4 from each result, and writes manifest.json containing filename, CDN URL, poster URL, author name and Pexels page URL for each pick. Skip clips shorter than 5 seconds or longer than 30 seconds. Do not download the video files themselves. Also store the search query in a field named query, and the width and height of the chosen file, in each entry. Read the key only from the environment variable PEXELS_API_KEY. Never print it and never write it to a file. Do not run the script yourself. Give me the exact commands to set PEXELS_API_KEY and to run the script in my own terminal, for Windows PowerShell and for macOS or Linux. Use YOUR_KEY as a placeholder for the key. - Read the script Claude Code shows you before you run anything. If it asks before making the change, select Yes.
- Ask
commit my changes with a descriptive message. Then run the commands Claude Code gave you in a second terminal, with your real key in place ofYOUR_KEYand a search term such ascoast aerial. - Open
manifest.jsonand check that each pick has a filename, CDN URL, poster URL, author, Pexels page URL, search query, width and height. Commit it too: that is your version-controlled shortlist.
Note: This is the terminal route. If you prefer a window, the Claude tab of this lesson shows the same task in the Code tab of the Claude desktop app. The lesson text calls Claude Code "Anthropic's CLI", and its docs link now redirects to the Claude Code docs at code.claude.com. In the terminal, Claude Code v2.1.283 or later starts in auto mode: a background check replaces your approval, so it may change a file without asking. The status bar shows the current mode. Read every change yourself.
Paid planNeeds a paid Claude plan (Pro, Max, Ultra, Team or Enterprise) or a Claude Console account. The Free plan does not include Claude Code.
Create a free account to save your progress
Free, and no payment details. Your ticks and finished lessons are kept, on every device.
Create a free account I already have an accountCreate a free account to save your progress. Sign in or sign up