External APIs
External APIs let you add specialized functionality to your app — AI capabilities, payment processing, weather data, and more.What Are External APIs?
APIs (Application Programming Interfaces) let your app communicate with external services:Available Integrations
OpenAI / ChatGPT
Add AI chat, text generation, and completion features
Stripe Payments
Accept payments and manage subscriptions
Maps & Location
Apple Maps, directions, and geocoding
Weather APIs
WeatherKit and OpenWeather data
Other APIs
Generic guide for any API
How API Integration Works
1. Get API Credentials
Most APIs require authentication:- API Key — A secret string identifying your app
- OAuth — User-authorized access (for user data)
2. Configure in App
Tell Nativeline about the API:3. Make Requests
The AI handles the technical details. You describe what you want:API Security
Nativeline Security
Nativeline stores API keys securely:- Encrypted in macOS Keychain
- Not committed to source code
- Not visible in compiled app (properly)
Best Practices
- Use environment variables when possible
- Rotate keys if exposed
- Set spending limits in API dashboards
- Consider server-side proxies for production
Common API Patterns
Request-Response
Most APIs follow this pattern:Handling Errors
APIs can fail — handle errors gracefully:Loading States
Show progress while waiting for responses:Free vs Paid APIs
Typically Free
- Apple Maps (built-in)
- WeatherKit (with Apple Developer account)
- Many APIs have free tiers
Typically Paid (with free tiers)
| API | Free Tier |
|---|---|
| OpenAI | $5 credit for new accounts |
| Stripe | Free until you process payments |
| Google Maps | $200/month credit |
| OpenWeather | 1,000 calls/day |
Cost Considerations
- Monitor usage in API dashboards
- Set spending limits
- Cache responses to reduce calls
- Use rate limiting in your app