Getting Started
1. Get Your API Key
API keys are provisioned manually during onboarding. To get your key:
- Sign up at gridbank.io or contact hello@gridbank.io
- The GridBank team will issue your API key (starts with
apik_) and send it to you directly - Keep this key secure; never commit it to version control
2. Choose Your SDK
GridBank provides official SDKs for Python and JavaScript:
bash
pip install gridbank-api
Works with Python 3.9+
bash
npm install @gridbank/api-js
Requires Node.js 14+ or modern browser with ES2020 support
3. Make Your First Request
```python from gridbank_api import GridbankClient
Initialize client
client = GridbankClient(api_key="apik_your_key_here")
Search for videos
results = client.search_videos(q="nature", per_page=5)
for video in results.videos: print(f"{video.title} ({video.duration}s)") ```
```javascript import { GridbankClient } from '@gridbank/api-js';
// Initialize client const client = new GridbankClient({ apiKey: 'apik_your_key_here' });
// Search for videos const results = await client.searchVideos({ q: 'nature', perPage: 5 });
results.videos.forEach(video => {
console.log(${video.title} (${video.duration}s));
});
```
4. Handle Errors
All SDK methods raise exceptions on non-2xx responses. Always wrap API calls in try-catch:
```python from gridbank_api import GridbankClient, GridbankAPIError
client = GridbankClient(api_key="apik_...")
try: results = client.search_videos(q="test") except GridbankAPIError as e: print(f"Error {e.code}: {e.message}") if e.details: print(f"Details: {e.details}") ```
```javascript const client = new GridbankClient({ apiKey: 'apik_...' });
try {
const results = await client.searchVideos({ q: 'test' });
} catch (error) {
if (error.code) {
console.error(Error ${error.code}: ${error.message});
} else {
console.error('Unexpected error:', error);
}
}
```
5. Check Your Usage
Monitor your subscription tier and remaining quota:
python
usage = client.usage_summary()
print(f"Tier: {usage.tier}")
print(f"Downloads used: {usage.downloads_this_period}")
print(f"Period ends: {usage.lease_period_end}")
javascript
const usage = await client.usageSummary();
console.log(`Tier: ${usage.tier}`);
console.log(`Downloads used: ${usage.downloads_this_period}`);
console.log(`Period ends: ${usage.lease_period_end}`);
Subscription Tiers
| Tier | Description |
|---|---|
| Starter | Entry-level tier for development and testing |
| Growth | Mid-tier for scaling applications |
| Scale | High-volume tier for production use |
| Enterprise | Custom limits and dedicated support |
Next Steps
- Explore the Python SDK or JavaScript SDK
- Check the API Reference for endpoint details
- Review Error Handling for common issues
Support
Stuck? Reach out:
- Email: hello@gridbank.io
- Status Page: gridbank.io
- GitHub Issues: gridbank/gridbank-external-api/issues