SDKs
Official SDKs for integrating TryAPI into your applications.
Python
tryapi
Installation
pip install tryapiQuick Example
from tryapi import TryAPI
client = TryAPI(api_key="your_api_key")
# Create a playground
playground = client.playgrounds.create(
name="My API",
curl_command="curl https://api.example.com/users"
)
# Execute a test
result = client.tests.execute(
playground_id=playground.id
)JavaScript/Node.js
@tryapi/sdk
Installation
npm install @tryapi/sdkQuick Example
import TryAPI from '@tryapi/sdk';
const client = new TryAPI({ apiKey: 'your_api_key' });
// Create a playground
const playground = await client.playgrounds.create({
name: 'My API',
curlCommand: 'curl https://api.example.com/users'
});
// Execute a test
const result = await client.tests.execute({
playgroundId: playground.id
});Go
github.com/tryapi/go-sdk
Installation
go get github.com/tryapi/go-sdkQuick Example
import "github.com/tryapi/go-sdk"
client := tryapi.NewClient("your_api_key")
// Create a playground
playground, _ := client.Playgrounds.Create(&tryapi.PlaygroundInput{
Name: "My API",
CurlCommand: "curl https://api.example.com/users",
})
// Execute a test
result, _ := client.Tests.Execute(playground.ID)Ruby
tryapi
Installation
gem install tryapiQuick Example
require 'tryapi'
client = TryAPI::Client.new(api_key: 'your_api_key')
# Create a playground
playground = client.playgrounds.create(
name: 'My API',
curl_command: 'curl https://api.example.com/users'
)
# Execute a test
result = client.tests.execute(playground_id: playground.id)More SDKs Coming Soon
We're working on SDKs for PHP, Java, C#, and Rust. In the meantime, you can use our REST API directly.