https://github.com/testorg0373/t-omdb
Unofficial Dart library for interacting with OMDb API
https://github.com/testorg0373/t-omdb
Last synced: 6 months ago
JSON representation
Unofficial Dart library for interacting with OMDb API
- Host: GitHub
- URL: https://github.com/testorg0373/t-omdb
- Owner: TestOrg0373
- License: bsd-3-clause
- Created: 2023-04-22T06:45:56.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-22T11:26:27.000Z (about 3 years ago)
- Last Synced: 2025-03-25T01:03:24.078Z (over 1 year ago)
- Language: Dart
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Unofficial Dart library for interacting with OMDb API
For questions or help ask here. File issues here and see pub.dev page here.
## Todo list
- Posters API
- Tests
## Getting started
### Add dependency
```
$ dart pub add t_omdb
```
or add it manually to your `pubspec.yaml` file:
```yaml
dependencies:
t_omdb: ^replace-with-latest-version
```
### Example usage:
```dart
import 'package:t_omdb/t_omdb.dart';
void main() async {
final omdb = OmdbApi('your-api-key');
// Search for "guardians of the galaxy" by it's imdb id
final String? byId = await omdb.searchById('tt3896198');
// Search specifically for "guardians of the galaxy" by title (returns the first result)
final String? byTitle = await omdb.searchByTitle('guardians of the galaxy');
// Search for "guardians of the galaxy" by query (returns multiple results that match the query)
final String? byQuery = await omdb.searchByQuery('guardians of the galaxy', type: OmdbType.movie, year: '2017', responseType: OmdbResponseType.json);
print(byId);
print(byTitle);
print(byQuery);
}
```
## Parameters
### By ID or Title
*Please note either i or t is required*
| Parameter | Required | Valid options | Description |
| --------- | -------- |------------------------| ----------- |
| i | Optional*| | A valid IMDb ID (e.g. tt1285016) |
| t | Optional*| | Movie title to search for. |
| type | No | movie, series, episode | Type of result to return. |
| y | No | | Year of release. |
| plot | No | short, full | Return short or full plot. |
| r | No | json, xml | The data type to return. |
### By Search
| Parameter | Required | Valid options | Default Value | Description |
| --------- |----------|----------------------| ------------- | ----------- |
| s | Yes | | | Movie title to search for. |
| type | No | movie, series, episode | | Type of result to return. |
| y | No | | | Year of release. |
| r | No | json, xml | json | The data type to return. |
| page | No | 1 - 100 | 1 | Page number to return. |