Quick Start Guide

Getting Started

Your journey to simplified API integration starts here. Learn how to get up and running with macro_api in minutes.

What is macro_api?

macro_api is a comprehensive TypeScript/JavaScript library that provides unified, production-ready wrappers for popular APIs. Instead of learning different SDK patterns for each service, you get a consistent interface across all integrations.

Why Choose macro_api?

Unified Interface

Consistent API patterns across all services. Learn once, use everywhere.

Production Ready

Built-in error handling, retry logic, and circuit breaker patterns.

High Performance

Intelligent caching, request batching, and optimized for speed.

TypeScript First

Full type safety with comprehensive TypeScript definitions.

Supported Services

Communication & Collaboration

Slack - Team communication and workflow automation
SendGrid - Transactional email delivery
Discord - Community management (via webhooks)

AI & Machine Learning

OpenAI/ChatGPT - Advanced language models
DeepSeek - Code generation and AI assistance

Payment Processing

Stripe - Complete payment infrastructure
PayPal - Global payment solutions

Development & Deployment

GitHub - Version control and repository management
Vercel - Frontend deployment and hosting
Docker Hub - Container registry management

Entertainment & Media

Spotify - Music streaming and playlist management
YouTube - Video notifications and monitoring

More Services

AWS S3 - Object storage and file management
Notion - Workspace and note management
Football API - Sports data and statistics

Quick Installation

Choose your package manager

# Using npm
npm install macro_api

# Using yarn
yarn add macro_api

# Using pnpm
pnpm add macro_api
TypeScript
Syntax highlighted
8 lines

Your First API Call

Let's start with a simple example using the ChatGPT API to show you how easy it is to get started:

Hello World with ChatGPT

import { ChatGPT } from 'macro_api';

// Initialize the client
const gpt = new ChatGPT({
  apiKey: process.env.OPENAI_API_KEY
});

// Make your first API call
async function firstApiCall() {
  try {
    const response = await gpt.chat(
      'Explain APIs in simple terms',
      'You are a helpful programming tutor'
    );
    
    console.log('AI Response:', response);
  } catch (error) {
    console.error('Error:', error);
  }
}

firstApiCall();
TypeScript
Syntax highlighted
22 lines

Environment Variables

Always store your API keys in environment variables, never in your source code. Create a `.env` file in your project root and add your keys there.

Environment Setup

Create a `.env` file in your project root to securely store your API keys:

Environment variables setup

# .env file
OPENAI_API_KEY=sk-your-openai-key-here
SPOTIFY_CLIENT_ID=your-spotify-client-id
SPOTIFY_CLIENT_SECRET=your-spotify-client-secret
STRIPE_SECRET_KEY=sk_test_your-stripe-key
SLACK_BOT_TOKEN=xoxb-your-slack-bot-token
SENDGRID_API_KEY=SG.your-sendgrid-key
# ... add other API keys as needed
TypeScript
Syntax highlighted
8 lines

Ready to Build!

You're all set! macro_api is designed to grow with your needs - start simple and add more services as your application evolves.

Need Help?

Documentation

Browse the complete API reference for each service

GitHub Issues

Report bugs and request features

Community

Join discussions and get help from other developers

Enterprise

Reach out for enterprise support and custom integrations

Welcome to the macro_api community! 🚀