Getting started overview
Integrating Irisnet into an application involves a few key steps: creating an account, generating API credentials, and making an initial request. The Irisnet API is designed for automated content moderation, enabling the detection of various types of illicit or unwanted content in images and videos. This guide will walk through the process to help you execute your first successful API call.
The following table provides a quick reference for the steps involved in getting started:
| Step | What to Do | Where |
|---|---|---|
| 1. Account Creation | Register on the Irisnet platform. | Irisnet homepage |
| 2. API Key Generation | Locate and copy your API key from the dashboard. | Irisnet dashboard (after login) |
| 3. Make First Request | Send an image URL or base64 encoded image to the API. | API endpoint (e.g., https://api.irisnet.de/v1/analyze) |
| 4. Interpret Response | Understand the JSON output from the API. | Irisnet API documentation |
Create an account and get keys
To begin using Irisnet, you must first create an account on their platform. This process typically involves providing an email address and setting a password. Upon successful registration, you will gain access to the Irisnet dashboard.
- Navigate to the Irisnet homepage: Go to www.irisnet.de.
- Sign Up: Look for a 'Sign Up' or 'Register' button, usually located in the top right corner of the page.
- Complete Registration: Follow the prompts to enter your details. Irisnet offers a free tier that includes 100 credits, allowing you to test the service without immediate cost.
- Access Dashboard: After registration and email verification (if required), log in to access your personal dashboard.
Once logged into your dashboard, you will need to locate your API key. This key is essential for authenticating your requests to the Irisnet API. API keys are unique identifiers that grant access to specific API functionalities and are crucial for securing your interactions with the service, as detailed in general API security practices on developer platforms like Google's.
- Locate API Key: Within your Irisnet dashboard, navigate to a section typically labeled 'API Keys', 'Settings', or 'Developer'.
- Copy Key: Your API key will be displayed there. Copy this key securely. It acts as a bearer token for authentication with the Irisnet API.
It is critical to keep your API key confidential to prevent unauthorized use of your account and credits. Do not embed it directly into client-side code or publicly accessible repositories. For server-side applications, use environment variables or a secure configuration management system to store the key.
Your first request
After obtaining your API key, you can make your first request to the Irisnet API. The primary endpoint for content analysis is https://api.irisnet.de/v1/analyze. This endpoint accepts either a publicly accessible image URL or a base64 encoded image as input.
The Irisnet API uses a RESTful architecture, typically expecting JSON payloads and returning JSON responses. For detailed API specifications, refer to the official Irisnet documentation. The API supports various HTTP methods, with POST being common for sending data to be analyzed.
Example Request (cURL)
This example demonstrates how to send an image URL for analysis using cURL. Replace YOUR_API_KEY with your actual API key and YOUR_IMAGE_URL with the URL of the image you wish to analyze.
curl -X POST \ 'https://api.irisnet.de/v1/analyze' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer YOUR_API_KEY' \ -d '{ "url": "YOUR_IMAGE_URL" }'
Example Request (Python)
Here's a Python example using the requests library to achieve the same:
import requests
import json
api_key = "YOUR_API_KEY"
image_url = "YOUR_IMAGE_URL" # e.g., "https://example.com/image.jpg"
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {api_key}"
}
payload = {
"url": image_url
}
try:
response = requests.post("https://api.irisnet.de/v1/analyze", headers=headers, data=json.dumps(payload))
response.raise_for_status() # Raise an exception for HTTP errors (4xx or 5xx)
print(json.dumps(response.json(), indent=2))
except requests.exceptions.RequestException as e:
print(f"An error occurred: {e}")
Interpreting the Response
A successful response from the Irisnet API will be a JSON object containing analysis results. The structure of this object will vary based on the specific moderation models applied, but generally includes fields indicating detected categories, scores, and potential violations.
For instance, a response might look like this (simplified):
{
"status": "success",
"data": {
"moderation_results": [
{
"category": "nudity",
"score": 0.98,
"decision": "reject"
},
{
"category": "violence",
"score": 0.05,
"decision": "approve"
}
],
"overall_decision": "reject"
}
}
The decision field indicates Irisnet's recommendation (e.g., reject, approve, review) based on the detected content and configured thresholds. The score provides a confidence level for each category. For detailed explanations of all possible response fields and their meanings, consult the Irisnet API reference documentation.
Common next steps
After successfully making your first API call, you can explore more advanced features and integrations:
- Explore different moderation models: Irisnet offers various models for different types of content, such as graphic material, nudity, or hate speech. Review the documentation to understand how to specify and utilize these.
- Integrate with your application: Incorporate the API calls into your backend logic to automate content moderation workflows for user-generated content, image uploads, or video streams.
- Handle webhooks: For asynchronous processing, especially with video analysis, Irisnet may offer webhook capabilities. Configuring webhooks allows Irisnet to notify your application when analysis is complete, rather than requiring polling. This is a common pattern for event-driven architectures, as described in AWS EventBridge documentation.
- Monitor usage and optimize costs: Regularly check your credit usage in the Irisnet dashboard. Based on your needs, consider upgrading your plan from the free tier to a paid subscription like the 'Small' plan for 2500 credits, or a custom enterprise plan to manage costs effectively.
- Implement error handling: Build robust error handling into your application to gracefully manage API rate limits, invalid requests, or service unavailability.
- Review SDKs and client libraries: Check if Irisnet provides official SDKs for your preferred programming language. These often simplify API interaction by abstracting HTTP requests and JSON parsing.
Troubleshooting the first call
If your first API call does not return the expected results, consider the following common issues:
- Incorrect API Key: Double-check that you have copied the API key correctly and included it in the
Authorization: Bearer YOUR_API_KEYheader. An invalid key will typically result in a401 Unauthorizederror. - Missing or Incorrect Headers: Ensure that the
Content-Type: application/jsonheader is present for JSON payloads. Incorrect headers can lead to400 Bad Requesterrors. - Invalid JSON Payload: Verify that your request body is valid JSON. Syntax errors in the JSON payload (e.g., missing commas, unquoted keys) can cause parsing failures on the API side.
- Unreachable Image URL: If you're providing an image URL, ensure it is publicly accessible and correct. The Irisnet API must be able to fetch the image. Test the URL directly in a browser or with a tool like
curlto confirm its availability. - Rate Limiting: If you make too many requests in a short period, you might hit API rate limits. The API will typically respond with a
429 Too Many Requestsstatus code. Implement exponential backoff or manage your request frequency. - Network Issues: Check your internet connection and any proxy settings that might interfere with outgoing HTTP requests.
- Endpoint URL Mismatch: Confirm that the API endpoint URL (
https://api.irisnet.de/v1/analyze) is spelled correctly and matches the one specified in the Irisnet documentation. - Insufficient Credits: If your free credits are exhausted, subsequent calls may fail or return specific error messages. Check your dashboard for credit balance.
For persistent issues, consult the Irisnet support resources or community forums, if available. Providing specific error messages and request details will help in diagnosing the problem more quickly.