Skip to main content

Before You Begin

Make sure you have:
Your API key from the dashboard
A tool to make HTTP requests (curl, Postman, or your preferred language)

Step 1: Set Up Your Environment

Store your API key as an environment variable:
export PRICINGSAAS_API_KEY="your_api_key_here"
Using environment variables keeps your API key secure and out of your code.

Step 2: Make a Simple Request

Let’s fetch a list of companies from the API:
curl -X GET "https://api.pricingsaas.com/functions/v1/api/companies?limit=5" \
  -H "Authorization: Bearer $PRICINGSAAS_API_KEY"

Step 3: Understand the Response

You should see a JSON response like this:
{
  "data": [
    {
      "id": 1,
      "name": "Slack",
      "slug": "slack",
      "category": "Communication",
      "employees": "10000+",
      "url": "https://slack.com",
      "created_at": "2024-01-01T00:00:00Z"
    },
    {
      "id": 2,
      "name": "Notion",
      "slug": "notion",
      "category": "Productivity",
      "employees": "1000-5000",
      "url": "https://notion.so",
      "created_at": "2024-01-01T00:00:00Z"
    }
  ],
  "pagination": {
    "total": 1500,
    "page": 1,
    "limit": 5,
    "has_more": true
  }
}

Response Structure

data
array
Array of company objects matching your query
pagination
object
Pagination metadata for navigating results

Step 4: Try Different Queries

Now that you’ve made your first request, try these variations:

Search by Name

Find companies by name:
curl -X GET "https://api.pricingsaas.com/functions/v1/api/companies?search=slack" \
  -H "Authorization: Bearer $PRICINGSAAS_API_KEY"

Filter by Category

Get only communication tools:
curl -X GET "https://api.pricingsaas.com/functions/v1/api/companies?category=Communication" \
  -H "Authorization: Bearer $PRICINGSAAS_API_KEY"

Filter by Company Size

Find large companies (10000+ employees):
curl -X GET "https://api.pricingsaas.com/functions/v1/api/companies?employees=10000%2B" \
  -H "Authorization: Bearer $PRICINGSAAS_API_KEY"
URL encode special characters like + as %2B

Combine Multiple Filters

curl -X GET "https://api.pricingsaas.com/functions/v1/api/companies?category=Productivity&employees=1000-5000&limit=10" \
  -H "Authorization: Bearer $PRICINGSAAS_API_KEY"

Step 5: Get a Specific Company

Retrieve detailed information about a single company using its slug:
curl -X GET "https://api.pricingsaas.com/functions/v1/api/companies/slack" \
  -H "Authorization: Bearer $PRICINGSAAS_API_KEY"
Response:
{
  "id": 1,
  "name": "Slack",
  "slug": "slack",
  "category": "Communication",
  "employees": "10000+",
  "url": "https://slack.com",
  "created_at": "2024-01-01T00:00:00Z",
  "updated_at": "2024-01-15T10:30:00Z"
}

Step 6: Use in Your Application

Here’s how to use the API in different programming languages:
const API_KEY = process.env.PRICINGSAAS_API_KEY;

async function getCompanies() {
  try {
    const response = await fetch(
      'https://api.pricingsaas.com/functions/v1/api/companies?limit=10',
      {
        headers: {
          'Authorization': `Bearer ${API_KEY}`
        }
      }
    );

    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }

    const data = await response.json();
    console.log(`Found ${data.pagination.total} companies`);
    console.log('First 10:', data.data);

    return data;
  } catch (error) {
    console.error('Error fetching companies:', error);
    throw error;
  }
}

getCompanies();

Troubleshooting

Problem: Your API key is missing or invalidSolution:
  • Check that you’re including the Authorization header
  • Verify your API key is correct
  • Make sure you’re using Bearer scheme: Bearer YOUR_KEY
# Correct
-H "Authorization: Bearer sk_abc123..."

# Incorrect
-H "Authorization: sk_abc123..."
Problem: You’ve exceeded your hourly rate limitSolution:
  • Wait for your rate limit to reset (check X-RateLimit-Reset header)
  • Implement caching to reduce requests
  • Upgrade to Pro tier for higher limits
See Rate Limits for more details.
Problem: Your query returns no resultsSolution:
  • Check your filter parameters
  • Try a broader search
  • Verify the category/employee range exists
# Too restrictive
?category=NonExistentCategory

# Try listing all categories first
?limit=100

Next Steps