Skip to content

REST APIs & Networking

You can ask Primio to integrate with any REST API — weather data, payment processing, social platforms, your own backend, or any service that speaks HTTP.

The key is being specific. Give the AI three things: the endpoint, what data to expect, and where to show it.

Good prompt — specific and complete:

“Fetch the current weather from OpenWeatherMap API at https://api.openweathermap.org/data/2.5/weather?q=London&appid=[your-key]. Display the temperature in Celsius, weather conditions, and the weather icon on the home screen.”

Weak prompt — too vague:

“Add weather to my app.”

The more detail you provide about the API response format and desired UI, the better the result. If the API has documentation, mention the key fields you need.

More examples:

  • “Connect to my backend API at https://api.myapp.com/products. Fetch the product list and display it in a grid with images, names, and prices.”
  • “Use the Unsplash API to search for photos. Show results in a grid. When the user taps a photo, show it full screen.”
  • “Fetch news headlines from NewsAPI and show them in a scrollable list with title, source, and published date.”

Low-risk keys (public data APIs, weather, news):

  • Including these directly in the app code is acceptable
  • The worst case is someone making requests with your key, which may cost you API quota
  • Most of these APIs have rate limits that protect you

High-risk keys (Stripe, database admin, payment processing):

  • Never put these in client-side code
  • Use a backend service as a proxy: Supabase Edge Functions, Firebase Cloud Functions, or your own server
  • Your app calls your backend, which calls the external API with the secret key
  • The secret never leaves your server

Data feeds (weather, news, stocks):

  • Fetch and display public API data
  • Usually low-risk API keys
  • Consider caching responses to reduce API calls

Payment processing (Stripe, RevenueCat):

  • Always use a backend proxy — never put payment secrets in the app
  • Consider using Supabase Edge Functions or Firebase Cloud Functions as the proxy layer

Maps and location (Google Maps, Mapbox):

  • “Add a Google Map to the screen showing the user’s current location”
  • Requires location permissions — the AI will set these up

Push notifications (Firebase Cloud Messaging, OneSignal):

  • “Add push notifications using Firebase Cloud Messaging”
  • Requires backend setup for sending notifications

Social login (Google, Apple, Facebook):

APIs fail. Networks drop. Servers go down. Ask the AI to handle these cases:

  • “Show a ‘No internet connection’ message if the API call fails”
  • “Add a retry button when the data fails to load”
  • “Cache the last successful response so the app works offline”
  • “Show a loading spinner while fetching data”

These small additions make a big difference in how polished your app feels.

Firebase Setup

Firebase provides analytics, auth, database, and more as a complete backend.

Supabase Setup

Supabase gives you PostgreSQL, auth, and storage — a strong open-source backend option.