First API Call
Learn how to make your first API call to Pullbay and understand the response structure. This hands-on guide shows you real code examples and explains every step.
Prerequisites
Before making your first API call, ensure you have:
A Pullbay account (sign up at https://dashboard.pullbay.com)
Your API key copied from the API Keys section of your dashboard
A tool for making HTTP requests (cURL, Postman, programming language, etc.)
Basic familiarity with JSON responses
The Example Request
We'll fetch App Store reviews for Facebook (App Store ID: 284882215) to demonstrate a real API call.
Endpoint:
GET https://api.pullbay.com/appstore/reviewsParameters:
appId=284882215(Facebook's iOS App Store ID)Authentication: Header
Authorization: Bearer YOUR_API_KEY
Replace YOUR_API_KEY with your actual API key.
curl -X GET "https://api.pullbay.com/appstore/reviews?appId=284882215" \
-H "Authorization: Bearer YOUR_API_KEY"import requests
api_key = "YOUR_API_KEY"
url = "https://api.pullbay.com/appstore/reviews"
params = {"appId": "284882215"}
headers = {"Authorization": f"Bearer {api_key}"}
response = requests.get(url, params=params, headers=headers)
data = response.json()
print(data)const axios = require('axios');
const apiKey = 'YOUR_API_KEY';
const url = 'https://api.pullbay.com/appstore/reviews';
const params = { appId: '284882215' };
const headers = { 'Authorization': `Bearer ${apiKey}` };
async function getReviews() {
try {
const response = await axios.get(url, { params, headers });
console.log(response.data);
} catch (error) {
console.error('Error:', error.response.data);
}
}
getReviews();Understanding the Response
Here's what a successful response from this API call looks like:
Response Field Explanations
The response contains a top-level envelope plus data, pagination, and pricing.
Top level
requestId
String
Unique identifier for this request (useful for debugging and support)
status
Integer
HTTP status code
message
String
Human-readable status message
success
Boolean
Whether the request succeeded
data (Array)
Each review object has these fields:
id
String
Unique identifier for this review
date
ISO 8601
Timestamp when the review was posted
userName
String
Username or display name of the reviewer
userUrl
String
URL to the reviewer's profile
version
String
App version the reviewer was using
score
Integer
Star rating given by the reviewer (1–5)
title
String
Review title or headline
text
String
Full text of the review
url
String
URL to the review
country
String
Country code of the review
pagination (Object)
page
Integer
Current page number
hasNextPage
Boolean
true if more pages are available
cursor / offset
String
Used only by cursor-/offset-paginated services (e.g. Google Maps); null for App Store
pricing (Object)
creditsCharged
Integer
API credits consumed by this request (1 per request + 1 per item returned)
Fetching More Pages
When pagination.hasNextPage is true, fetch the next page by incrementing page:
Alternatively, use maxItems instead of page to pull a larger set in a single call (the two are mutually exclusive).
Check Your Usage in the Dashboard
Common Errors & Troubleshooting
All errors return the standard envelope with success: false and an error object:
400 Bad Request — Invalid or missing parameters. Verify required parameters are included (e.g. appId or bundleId) and values are correct (app IDs are numeric strings, 8–12 digits).
402 Insufficient Credits — You've used all your available credits. Check your remaining credits in the Overview, then purchase more or upgrade your plan.
404 Not Found — The requested resource (e.g. an app or developer ID) couldn't be found. Verify the identifier.
401 Unauthorized — Your API key is missing, invalid, or expired. Verify it's copied correctly and sent as Authorization: Bearer YOUR_API_KEY. If compromised, revoke it and create a new one.
429 Too Many Requests — You've hit a rate limit. Wait before retrying and implement exponential backoff.
500 / 503 Server Error — A server-side error or temporary unavailability. Retry after a few seconds; if it persists, contact support with your requestId.
Error Reference Table
400
Bad request
Verify request parameters
402
Insufficient credits
Purchase more credits
404
Not found
Verify the identifier
401
Unauthorized
Check your API key
429
Too many requests
Wait and retry with backoff
500 / 503
Server error / unavailable
Retry or contact support
Next Steps
Congratulations on making your first Pullbay API call! Here's what to explore next:
Pagination Guide
Page-based pagination and bulk pulls with maxItems
Authentication Guide
API keys and security best practices
App Store API Reference
Explore all available endpoints and parameters
Error Handling
Implement robust error handling in your application
FAQ
Last updated