SDKs overview
Software Development Kits (SDKs) and libraries for uNoGS enable developers to integrate uNoGS data programmatically into their applications. These tools abstract the underlying API calls, managing authentication, request formatting, and response parsing. By using an SDK, developers can interact with the uNoGS API using native language constructs, reducing boilerplate code and potential errors associated with direct HTTP communication. The uNoGS platform provides data for identifying streaming content availability, tracking content by region, and determining VPN-friendly content (uNoGS Homepage). This page details the officially supported SDKs and notable community-contributed libraries, providing installation instructions and code examples.
The core functionality exposed by uNoGS SDKs typically includes methods for searching content, retrieving regional availability, and filtering by various criteria supported by the uNoGS API. Developers aiming to build applications that leverage streaming content metadata can utilize these SDKs to fetch timely and accurate information without needing to manage the intricacies of RESTful API interactions (Mozilla Developer Network on REST). The availability of both official and community-driven libraries supports a broad range of development environments and preferences.
Official SDKs by language
uNoGS provides official SDKs to facilitate integration in common programming languages. These SDKs are maintained by the uNoGS team and are designed to offer stable and up-to-date access to the platform's API functionalities. The primary languages covered are Python and JavaScript, reflecting common choices for web development and data scripting.
| Language | Package Name | Install Command | Maturity |
|---|---|---|---|
| Python | unogs-api |
pip install unogs-api |
Stable |
| JavaScript | unogs-js |
npm install unogs-js |
Stable |
The Python SDK, unogs-api, is suitable for backend applications, data analysis scripts, and command-line tools. It provides an object-oriented interface to interact with the uNoGS API, making it straightforward to retrieve content information, search for titles, and manage regional data queries. Similarly, the JavaScript SDK, unogs-js, is designed for both Node.js environments and client-side web applications, offering asynchronous methods ideal for dynamic content loading and user interfaces.
Installation
Installing uNoGS SDKs typically involves using the respective language's package manager. Detailed instructions are provided below for Python and JavaScript environments.
Python (unogs-api)
To install the Python SDK, ensure you have Python and pip installed on your system. Open your terminal or command prompt and execute the following command:
pip install unogs-api
This command downloads and installs the unogs-api library and its dependencies from the Python Package Index (PyPI).
JavaScript (unogs-js)
For JavaScript projects, you will need Node.js and npm installed. Navigate to your project directory in the terminal and run:
npm install unogs-js
This command adds the unogs-js package to your project's node_modules directory and updates your package.json file.
Quickstart example
The following examples demonstrate how to make a basic API call using both the Python and JavaScript SDKs to retrieve popular titles available on Netflix.
Python example
This Python snippet demonstrates how to initialize the uNoGS API client and fetch a list of popular titles. Replace "YOUR_API_KEY" with your actual uNoGS API key, which can be obtained from the uNoGS dashboard API section.
from unogs_api import UnogsAPI
# Initialize the UnogsAPI client with your API key
api = UnogsAPI(api_key="YOUR_API_KEY")
# Fetch popular titles
try:
# Example: Get 10 popular titles available in the US
popular_titles = api.get_popular_titles(country_id=23, limit=10)
for title in popular_titles:
print(f"Title: {title.get('title')}, Netflix ID: {title.get('netflixid')}")
except Exception as e:
print(f"An error occurred: {e}")
This code initializes the API client and then calls get_popular_titles, specifying a country ID (23 for the United States) and a limit of 10 results. The output will list the titles and their Netflix IDs.
JavaScript example
This JavaScript quickstart shows how to use the unogs-js library to perform a similar operation. This example is suitable for a Node.js environment. Remember to replace "YOUR_API_KEY" with your actual uNoGS API key from the dashboard uNoGS API key page.
const { UnogsAPI } = require('unogs-js');
// Initialize the UnogsAPI client with your API key
const api = new UnogsAPI('YOUR_API_KEY');
// Fetch popular titles asynchronously
async function getAndLogPopularTitles() {
try {
// Example: Get 10 popular titles available in the US
const popularTitles = await api.getPopularTitles({ countryId: 23, limit: 10 });
popularTitles.forEach(title => {
console.log(`Title: ${title.title}, Netflix ID: ${title.netflixid}`);
});
} catch (error) {
console.error(`An error occurred: ${error.message}`);
}
}
getAndLogPopularTitles();
This asynchronous function calls the getPopularTitles method, passing an object with configuration for countryId and limit. It then iterates through the results and logs the title and Netflix ID for each entry.
Community libraries
Beyond the official SDKs, the developer community often creates and maintains libraries that extend functionality or provide API access in other programming languages or frameworks. While not officially supported by uNoGS, these community contributions can offer flexibility and address specific use cases not covered by the official offerings. Developers should review the documentation and community support for these libraries before integrating them into production environments.
As of late 2024, prominent community contributions have often emerged in areas such as:
- PHP clients: Libraries that wrap the uNoGS REST API for PHP-based web applications, often found on platforms like GitHub.
- Go wrappers: Unofficial Go language bindings for developers building high-performance backend services or microservices.
- Ruby gems: Community-developed Ruby gems for integrating uNoGS data into Ruby on Rails or other Ruby applications.
- Desktop application integrations: Libraries or modules designed to fetch uNoGS data for specific desktop frameworks (e.g., Electron, PyQt).
When considering a community library, it is advisable to check:
- Active maintenance: Is the library regularly updated to match API changes or bug fixes?
- Documentation: Is there clear and comprehensive documentation for installation and usage?
- Community support: Is there an active community (e.g., GitHub issues, forums) for troubleshooting and assistance?
- License: Does the library's license permit its use in your project (e.g., MIT, Apache 2.0)? Information on common open source licenses can be found on the AWS Open Source Licensing guide.
Searching platforms like GitHub or package managers specific to your language (e.g., Packagist for PHP, RubyGems for Ruby) using terms like "unogs API" or "Netflix availability API" can help identify relevant community projects.