API Integration Showcase
Explore powerful API documentation and integration tools for your developer documentation.
๐ OpenAPI/Swagger Documentationโ
API Endpoint Documentationโ
Multiple API Methodsโ
๐ท GraphQL Explorerโ
https://api.proper-labs.io/graphql
Query
query GetUserContracts($userId: ID!) {
user(id: $userId) {
id
address
contracts {
id
address
type
deployedAt
transactions {
hash
value
status
}
}
}
}
Variables
{
"userId": "usr_123456789"
}
Response
{
"data": {
"user": {
"id": "usr_123456789",
"address": "0x742d35Cc...",
"contracts": [
{
"id": "con_abc123",
"address": "0x123...",
"type": "ERC20",
"deployedAt": "2024-01-15T10:30:00Z",
"transactions": [
{
"hash": "0xabc...",
"value": "1000000000000000000",
"status": "SUCCESS"
}
]
}
]
}
}
}
GraphQL Schema Documentationโ
type User {
id: ID!
address: String!
contracts: [Contract!]!
transactions: [Transaction!]!
createdAt: DateTime!
}
type Contract {
id: ID!
address: String!
type: ContractType!
owner: User!
deployedAt: DateTime!
transactions: [Transaction!]!
metadata: ContractMetadata
}
type Transaction {
hash: String!
from: String!
to: String!
value: String!
gasUsed: String!
status: TransactionStatus!
timestamp: DateTime!
}
enum ContractType {
ERC20
ERC721
ERC1155
CUSTOM
}
enum TransactionStatus {
PENDING
SUCCESS
FAILED
}
๐ ๏ธ SDK Code Generationโ
TypeScript SDK Exampleโ
- Generated Types
- Generated Client
generated/types.ts
// Auto-generated TypeScript types from OpenAPI spec
export interface Contract {
id: string;
address: string;
type: 'ERC20' | 'ERC721' | 'ERC1155' | 'CUSTOM';
owner: string;
deployedAt: string;
metadata?: ContractMetadata;
}
export interface Transaction {
hash: string;
from: string;
to: string;
value: string;
gasUsed: string;
status: 'PENDING' | 'SUCCESS' | 'FAILED';
timestamp: string;
}
export interface DeployContractRequest {
network: string;
contractType: string;
parameters: Record<string, any>;
gasOptions?: GasOptions;
}
export interface DeployContractResponse {
success: boolean;
contractAddress: string;
transactionHash: string;
blockNumber: number;
gasUsed: string;
}
generated/client.ts
// Auto-generated API client from OpenAPI spec
import axios, { AxiosInstance } from 'axios';
import { Contract, Transaction, DeployContractRequest, DeployContractResponse } from './types';
export class ProperLabsAPIClient {
private client: AxiosInstance;
constructor(apiKey: string, baseURL = 'https://api.proper-labs.io') {
this.client = axios.create({
baseURL,
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
}
});
}
async deployContract(request: DeployContractRequest): Promise<DeployContractResponse> {
const response = await this.client.post('/api/v1/contracts/deploy', request);
return response.data;
}
async getContract(address: string): Promise<Contract> {
const response = await this.client.get(`/api/v1/contracts/${address}`);
return response.data;
}
async getTransactions(contractAddress: string): Promise<Transaction[]> {
const response = await this.client.get(`/api/v1/contracts/${contractAddress}/transactions`);
return response.data;
}
}
๐งช API Testing Interfaceโ
Try It Outโ
Response
{ "success": true, "message": "Test response - API playground demo" }
๐ API Analytics Dashboardโ
API Usage Statisticsโ
1.2M
Total API Calls
99.9%
Uptime
45ms
Avg Response Time
5.2K
Active Developers
Popular Endpointsโ
Endpoint | Calls/Day | Avg Response | Success Rate |
---|---|---|---|
/contracts/deploy | 15.2K | 125ms | 98.5% |
/transactions/send | 48.3K | 45ms | 99.2% |
/user/balance | 125.6K | 12ms | 99.9% |
/contracts/query | 67.8K | 23ms | 99.7% |
๐ Authentication Examplesโ
- Bearer Token
- OAuth 2.0
- API Key
curl -X POST https://api.proper-labs.io/api/v1/contracts/deploy \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"network": "ethereum",
"contractType": "ERC20"
}'
// OAuth 2.0 flow
const oauth = new OAuth2Client({
clientId: 'YOUR_CLIENT_ID',
clientSecret: 'YOUR_CLIENT_SECRET',
redirectUri: 'https://your-app.com/callback'
});
// Get authorization URL
const authUrl = oauth.generateAuthUrl({
scope: ['contracts:read', 'contracts:write'],
state: 'random-state-string'
});
// Exchange code for token
const tokens = await oauth.getToken(code);
import requests
headers = {
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
}
response = requests.post(
'https://api.proper-labs.io/api/v1/contracts/deploy',
headers=headers,
json={
'network': 'ethereum',
'contractType': 'ERC20'
}
)
๐ Webhook Configurationโ
Event Subscriptionsโ
Webhook Payload Exampleโ
{
"event": "contract.deployed",
"timestamp": "2024-01-15T10:30:00Z",
"data": {
"contractAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb7",
"transactionHash": "0x9fc76417374aa880d4449a1f7f31ec597f00b2f3",
"network": "ethereum",
"gasUsed": "2458963"
},
"metadata": {
"userId": "usr_123456789",
"projectId": "prj_987654321"
}
}
๐ฆ Rate Limitingโ
API Rate Limits
Tier | Requests/Hour | Requests/Day | Burst Rate |
---|---|---|---|
Free | 100 | 1,000 | 10/min |
Starter | 1,000 | 10,000 | 50/min |
Pro | 10,000 | 100,000 | 200/min |
Enterprise | Unlimited | Unlimited | Custom |
Rate Limit Headers
HTTP/1.1 200 OK
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1642329600
API Integration Best Practices
- Document all endpoints with clear examples
- Provide interactive testing interfaces
- Generate SDK code for multiple languages
- Include authentication examples
- Show rate limiting information
- Document webhooks and events
- Provide error handling examples
- Include versioning strategies