ipoalerts Logoipoalerts
Quick Start Examples

cURL Examples

Command-line examples for integrating with the API using cURL

This page provides practical command-line examples for integrating with the API using cURL.

Get Upcoming IPOs

curl -H "x-api-key: YOUR_API_KEY" \
     "https://api.ipoalerts.in/ipos?status=upcoming&type=EQ&page=1&limit=10"

Get Open IPOs

curl -H "x-api-key: YOUR_API_KEY" \
     "https://api.ipoalerts.in/ipos?status=open&page=1&limit=10"

Get Listed IPOs

curl -H "x-api-key: YOUR_API_KEY" \
     "https://api.ipoalerts.in/ipos?status=listed&page=1&limit=10"

Get Specific IPO by ID

curl -H "x-api-key: YOUR_API_KEY" \
     "https://api.ipoalerts.in/ipos/ipo-123"

Get Specific IPO by Symbol

curl -H "x-api-key: YOUR_API_KEY" \
     "https://api.ipoalerts.in/ipos/TECHCORP"

Get Specific IPO by Slug

curl -H "x-api-key: YOUR_API_KEY" \
     "https://api.ipoalerts.in/ipos/techcorp-limited"

Filter by Type

# Get only Equity IPOs
curl -H "x-api-key: YOUR_API_KEY" \
     "https://api.ipoalerts.in/ipos?status=upcoming&type=EQ&page=1&limit=10"

# Get only SME IPOs
curl -H "x-api-key: YOUR_API_KEY" \
     "https://api.ipoalerts.in/ipos?status=upcoming&type=SME&page=1&limit=10"

# Get only Debt offerings
curl -H "x-api-key: YOUR_API_KEY" \
     "https://api.ipoalerts.in/ipos?status=upcoming&type=DEBT&page=1&limit=10"

Filter by Date Range

# Get IPOs starting from a specific date
curl -H "x-api-key: YOUR_API_KEY" \
     "https://api.ipoalerts.in/ipos?status=upcoming&startDate=2024-03-01&page=1&limit=10"

# Get IPOs ending before a specific date
curl -H "x-api-key: YOUR_API_KEY" \
     "https://api.ipoalerts.in/ipos?status=upcoming&endDate=2024-03-31&page=1&limit=10"

# Get IPOs within a date range
curl -H "x-api-key: YOUR_API_KEY" \
     "https://api.ipoalerts.in/ipos?status=upcoming&startDate=2024-03-01&endDate=2024-03-31&page=1&limit=10"

Filter by Year

# Get IPOs from a specific year
curl -H "x-api-key: YOUR_API_KEY" \
     "https://api.ipoalerts.in/ipos?status=listed&year=2024&page=1&limit=10"

Pagination

# Get page 2 with 5 results per page
curl -H "x-api-key: YOUR_API_KEY" \
     "https://api.ipoalerts.in/ipos?status=upcoming&page=2&limit=5"

# Get page 3 with 20 results per page
curl -H "x-api-key: YOUR_API_KEY" \
     "https://api.ipoalerts.in/ipos?status=upcoming&page=3&limit=20"

Pretty Print JSON Response

# Using jq for pretty printing
curl -H "x-api-key: YOUR_API_KEY" \
     "https://api.ipoalerts.in/ipos?status=upcoming" | jq '.'

# Using python for pretty printing
curl -H "x-api-key: YOUR_API_KEY" \
     "https://api.ipoalerts.in/ipos?status=upcoming" | python -m json.tool

Save Response to File

# Save to file
curl -H "x-api-key: YOUR_API_KEY" \
     "https://api.ipoalerts.in/ipos?status=upcoming" \
     -o upcoming_ipos.json

# Save and pretty print
curl -H "x-api-key: YOUR_API_KEY" \
     "https://api.ipoalerts.in/ipos?status=upcoming" | jq '.' > upcoming_ipos.json

Verbose Output for Debugging

# Show request and response headers
curl -v -H "x-api-key: YOUR_API_KEY" \
     "https://api.ipoalerts.in/ipos?status=upcoming"

Handle Rate Limiting

# Add delay between requests
curl -H "x-api-key: YOUR_API_KEY" \
     "https://api.ipoalerts.in/ipos?status=upcoming" && sleep 10

# Use curl with retry on failure
curl --retry 3 --retry-delay 10 \
     -H "x-api-key: YOUR_API_KEY" \
     "https://api.ipoalerts.in/ipos?status=upcoming"

Environment Variables

# Set API key as environment variable
export IPOALERTS_API_KEY="YOUR_API_KEY"

# Use in curl command
curl -H "x-api-key: $IPOALERTS_API_KEY" \
     "https://api.ipoalerts.in/ipos?status=upcoming"