What Is an API?
An API is essentially like a restaurant order form. At a restaurant, you look at the menu, write down your order, and hand it to the kitchen. The chef makes your food and sends it out.
APIs work the same way. You send a “request,” and the server returns “data.” For example, if you request “give me the disclosure list for Samsung Electronics,” the FSS server sends back the disclosure data.
| Restaurant | API |
|---|---|
| Menu | API documentation (what requests are available) |
| Order form | API request (URL + parameters) |
| Kitchen | Server (where data is processed) |
| Food | Response data (JSON, HTML, etc.) |
| Membership card | API key (authentication credential) |
The key point is — you’re using functionality someone else built. If Google built an AI model, you can call that AI via API. If the FSS organized disclosure data, you can fetch that data via API.
Popular Free APIs
| API | Purpose | Price |
|---|---|---|
| Gemini | Google AI (text/image/video generation) | Free tier (daily limits apply) |
| DART | Korea FSS corporate disclosure lookup | Free |
| Naver Search | Naver search result collection | Free |
| Data.gov | Government public data (weather, transit, etc.) | Free |
| Open Exchange Rates | Currency exchange rates | Free tier |
API key = restaurant membership card
Most APIs require an API key. Like a restaurant membership card, it authenticates you as a legitimate user. Getting one is usually free—just sign up on the service’s website.
Pointing AI to Official Documentation
The most important thing when using APIs is the official documentation. No matter how smart AI is, without official docs it might not know the exact API call format. Parameter names and authentication methods in particular need the docs to be accurate.
There are 4 ways to give AI the official documentation.
Method 1: Save docs as a file
Save the DART API official documentation as dart-api-docs.md.
Then reference that document to write the code.Claude Code fetches the docs from the official site, saves them as a file, and references that file to write code. Save once and it stays available for future reference.
Method 2: Pass the URL directly
Reference this documentation:
https://opendart.fss.or.kr/guide/main.doMethod 3: Use context7
use context7
Create code that generates images using the Google Gemini API.Adding “use context7” to your prompt makes Claude Code automatically find and reference the latest library docs. Especially useful for libraries that update frequently.
Method 4: Record in CLAUDE.md
## API Info
- DART API docs: https://opendart.fss.or.kr/guide/main.do
- Gemini API docs: https://ai.google.dev/docs
- Read API keys from .env fileRecord API info in CLAUDE.md and Claude Code automatically references it every time, no need to explain again. Definitely record APIs you use frequently in your project.
Why are official docs important?
AI answers based on training data, so it might not know about the latest API changes. Providing official docs alongside your prompt dramatically increases the chance of getting accurate code without hallucination.
APIs = LEGO Blocks
The more blocks you combine, the more possibilities open up.
Content Generation With Gemini API
Google’s Gemini API can handle text, images, and video—it’s a powerful multi-modal AI API. The free tier is sufficient for personal projects, though there are per-minute request limits. Heavy usage requires a paid upgrade.
Getting an API Key
Navigate to Google AI Studio
Use your existing Google account
Your API key is generated immediately
Never put it directly in code!
GEMINI_API_KEY=your-api-key-hereText Generation Example
Using the Gemini API,
create a 60-second Shorts script
on "vibe coding for office workers".
Include per-scene narration + visuals + subtitles.
Read the API key from .env.Claude Code writes code to call the Gemini API, runs it, and creates the script file for you. You just check the result.
What Gemini Can Do
| Capability | Description | Example use |
|---|---|---|
| Text generation | Scripts, summaries, translations, classification | Shorts scripts, blog drafts — Free |
| Image generation | Generate images with Gemini models | Thumbnails, card news — Free (limited) |
| Image analysis | Describe/analyze images | Receipt OCR, chart interpretation — Free |
| Video generation (Veo) | Generate video clips from prompts | Shorts background video — Paid only |
API key security warning
Never put API keys directly in your code! Always save them in a .env file and add .env to your .gitignoreto prevent exposure. If your API key leaks, others can use your account to make API calls.
Automated DART Disclosure Collection
DART is the Electronic Disclosure System operated by Korea’s Financial Supervisory Service. It provides free access to all public filings—annual reports, quarterly reports, material disclosures, and more—for listed companies.
Instead of manually visiting the DART website and clicking through one by one, you can fetch everything at once via API.
Getting an API Key
DART Open API website
Email registration, no certificate needed
Apply via the "Open API Application" menu
Usually issued immediately
DART_API_KEY=your-api-key-hereDisclosure Collection + Analysis
Use the DART API to fetch Samsung Electronics'
disclosures from the last 3 months,
select the important ones,
and create an analysis report as report.html.
Read the API key from .env.Claude Code calls the DART API to fetch the disclosure list, evaluates importance, selects key filings, and creates a polished HTML report. Investment research that used to take 2 hours daily now finishes in 2 minutes.
More possibilities
- Financial statement comparison
“Create a comparison chart of Samsung and SK Hynix’s revenue/operating profit over the last 3 years”
- Disclosure alert system
“Check new disclosures for my 10 watchlist stocks every morning and summarize”
- Annual report key extraction
“Extract just the risk factors and new business initiatives from this company’s annual report”
DART API free limit
The DART API allows up to 10,000 free calls per day. More than enough for personal investment research. Note: the daily limit is per API key, so check your call count if you need bulk collection.
Shorts Automation Pipeline
Combine the APIs we’ve learned so far and you can build something amazing: a Shorts content auto-production pipeline. From script to video, the entire process can be automated.
Full Pipeline
Given a topic, auto-writes a 60-second script with per-scene narration + subtitles
AI-generates background images or illustrations matching each scene
Generates short video clips from images (with dynamic effects)
AI-generated voiceover + subtitle overlay + final editing
Create a 60-second Shorts script on
"How to earn $1000/month with vibe coding after work".
Split into 5 scenes with narration, visual description, and subtitles per scene.
Also generate background images for each scene using the Gemini API.One prompt generates both the script and images simultaneously. What would take a human half a day can be done in under 10 minutes.
| Stage | Manual production | API automation |
|---|---|---|
| Script writing | 2-3 hours | 2 min (Claude Code) |
| Image sourcing | 1-2 hours (search/edit) | 3 min (Imagen API) |
| Video editing | 3-4 hours | 10 min (Veo + auto-edit) |
| Total | 6-9 hours | ~15 minutes |
Don't try to perfect it all at once
Don’t try to complete the entire pipeline in one shot. Start with script generation, then add image generation, then attach video and TTS later. Automating each stage one at a time is the key.
Try It Yourself
Pick one challenge below and try it yourself. All use free APIs.
Challenge 1: Gemini API Text Generation
Get a Gemini API key and test simple text generation.
The Gemini API key is in .env.
Generate 5 "motivational messages for office workers".
Each in a different tone (humor, serious, touching, motivational, witty).Challenge 2: DART API Disclosure Lookup
Get a DART API key and look up disclosures for a company you’re interested in.
The DART API key is in .env.
Fetch Kakao's disclosures from the last month
and organize title, date, and type in a table.Challenge 3: Today’s News Summary
Use a search API or RSS to summarize today’s news.
Collect today's "AI" related news,
organize the top 5 stories with title, summary, and source,
and create news-briefing.html.Verification Checklist
Don’t worry if you get errors. Tell Claude Code “there’s an error, check it” and it will analyze the cause and fix the code. API errors are usually one of: wrong key, wrong parameters, or rate limit exceeded— things AI can diagnose quickly.
API Best Practices
Essential tips for using APIs safely and efficiently. Follow these and you’ll work cleanly from the start.
1. Store API keys in .env files
Putting API keys directly in code is a security risk. Always store them separately in a .env file and load them as environment variables. Don’t forget to add .env to .gitignore.
GEMINI_API_KEY=your-api-key-here
DART_API_KEY=your-api-key-here
NAVER_CLIENT_ID=your-client-id-here2. Record API info in CLAUDE.md
Record frequently used API docs, URLs, usage rules, and caveats in CLAUDE.md. No need to explain every time—Claude Code references it automatically.
## API Integration
- DART: https://opendart.fss.or.kr/guide/main.do
- Gemini: https://ai.google.dev/docs
- All API keys read from .env
- DART daily call limit: 10,0003. Always include official docs URL
To prevent AI hallucination generating wrong API calls, include the official docs URL in your prompt. Just adding “reference this doc” dramatically improves accuracy.
4. Start with free APIs
Jumping straight to paid APIs risks accidental charges. Practice first with free APIs (Gemini, DART, public data portals, etc.), then move to paid ones once comfortable.
5. Let AI handle errors
When API calls fail, show the exact error message to Claude Code. One sentence—“fix this error”—handles everything from cause analysis to code correction. Most API errors are key issues, parameter issues, or rate limits, which AI resolves quickly.
| Mistake | Consequence | Prevention |
|---|---|---|
| API key hardcoded in source | Key exposure if pushed to GitHub | Store in .env file separately |
| Requesting without official docs | AI generates incorrect API calls | Include docs URL in prompt |
| Starting with paid APIs | Accidental charges from mistakes | Practice with free APIs first |
| Trying to fix errors yourself | Wasted time | Pass error messages to AI |
APIs are LEGO blocks
Each API is like a LEGO block. Combine Gemini (AI generation) + DART (data) + TTS (voice) blocks and you get a news briefing bot or a Shorts automation pipeline. The more blocks you collect, the more you can build. Start collecting free blocks.
References
- Gemini API — ai.google.dev/docs
- DART OpenAPI — opendart.fss.or.kr
- Naver API — developers.naver.com