{"id":18749001,"url":"https://github.com/skadizz/angular2-swapi","last_synced_at":"2026-04-18T17:33:51.528Z","repository":{"id":57179738,"uuid":"142583095","full_name":"SKaDiZZ/angular2-swapi","owner":"SKaDiZZ","description":"Angular client library for Star Wars API","archived":false,"fork":false,"pushed_at":"2018-07-27T14:19:18.000Z","size":211,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-27T22:50:30.075Z","etag":null,"topics":["angular","api","client","ionic-framework","library","npm-package","starwars","swapi"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SKaDiZZ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-27T13:51:46.000Z","updated_at":"2024-01-05T16:48:58.000Z","dependencies_parsed_at":"2022-09-26T16:51:11.251Z","dependency_job_id":null,"html_url":"https://github.com/SKaDiZZ/angular2-swapi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SKaDiZZ/angular2-swapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SKaDiZZ%2Fangular2-swapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SKaDiZZ%2Fangular2-swapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SKaDiZZ%2Fangular2-swapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SKaDiZZ%2Fangular2-swapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SKaDiZZ","download_url":"https://codeload.github.com/SKaDiZZ/angular2-swapi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SKaDiZZ%2Fangular2-swapi/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269366853,"owners_count":24405250,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-08T02:00:09.200Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","api","client","ionic-framework","library","npm-package","starwars","swapi"],"created_at":"2024-11-07T17:05:44.305Z","updated_at":"2026-04-18T17:33:51.518Z","avatar_url":"https://github.com/SKaDiZZ.png","language":"TypeScript","readme":"\u003cdiv align=\"center\"\u003e\n\n![angular swapi](https://github.com/SKaDiZZ/angular2-swapi/blob/master/docs/virtuwars.png?raw=true)\n\n\u003c/div\u003e\n\n# angular2-swapi \nAngular2Swapi library will help developers building angular and ionic applications which are using data from **StarWars API**.\n\n# Installation\nTo install this library run:\n```bash\nnpm install angular2-swapi --save\n```\n# Bootstrap\nImport Angular2SwapiModule in your app.module.ts file and add it into imports array:\n```typescript\nimport { BrowserModule } from '@angular/platform-browser';\nimport { NgModule } from '@angular/core';\n\nimport { Angular2SwapiModule } from 'angular2-swapi';\n\nimport { AppComponent } from './app.component';\n\n@NgModule({\n  declarations: [\n    AppComponent\n  ],\n  imports: [\n    BrowserModule,\n    Angular2SwapiModule\n  ],\n  providers: [],\n  bootstrap: [AppComponent]\n})\nexport class AppModule { }\n```\n# Angular2SwapiService\n**angular2-swapi** is actually service library providing methods to call https://swapi.co and return resources based on your query. You can say it is HTTP client for StarWars API.\n\n## List of available methods\n### People\nMethod | Parameters | Return | Description\n-------|------------|--------|------------\ngetPeople() | page?: number | Observable\u003cPeople[]\u003e | Returns list of people as Observable\ngetPeopleById(id) | id: number | Observable\u003c People \u003e | Returns character by id\nsearchPeople(name) | name: string | Observable\u003cPeople[]\u003e | Search people by name\n### Films\nMethod | Parameters | Return | Description\n-------|------------|--------|------------\ngetFilms() | page?: number | Observable\u003cFilm[]\u003e | Returns list of films as Observable\ngetFilm(id) | id: number | Observable \u003c Film \u003e | Returns film by id\nsearchFilms(title) | title: string | Observable\u003cFilm[]\u003e | Search films by title\n### Starships\nMethod | Parameters | Return | Description\n-------|------------|--------|------------\ngetStarships(page) | page?: number | Observable\u003cStarship[]\u003e | Return list of starships as Observable\ngetStarship(id) | id: number | Observable\u003c Starship \u003e | Return starship by id\nsearchStarships(name) | name: string | Observable\u003cStarship[]\u003e | Search starships by name or model\n### Vehicles\nMethod | Parameters | Return | Description\n-------|------------|--------|------------\ngetVehicles(page) | page?: number | Observable\u003cVehicle[]\u003e | Return list of vehicles as Observable\ngetVehicle(id) | id: number | Observable\u003c Vehicle \u003e | Returns vehicle by id\nsearchVehicles(name) | name: string | Observable\u003cVehicle[]\u003e | Search vehicles by name or model\n### Species\nMethod | Parameters | Return | Description\n-------|------------|--------|------------\ngetSpecies(page) | page?: number | Observable\u003cSpecies[]\u003e | Return list of species as Observable\ngetSpeciesById(id) | id: number | Observable\u003c Species \u003e | Returns species by id\nsearchSpecies(name) | name: string | Observable\u003cSpecies[]\u003e | Search species by name\n### Planets\nMethod | Parameters | Return | Description\n-------|------------|--------|------------\ngetPlanets(page) | page?: number | Observable\u003cPlanet[]\u003e | Return list of planets as Observable\ngetPlanet(id) | id: number | Observable\u003c Planet \u003e | Returns planet by id\nsearchPlanets(name) | name: string | Observable\u003cPlanet[]\u003e | Search planets by name\n\n## Using Angular2SwapiService\nGet list of films and display data:\n```typescript\nimport { Component, OnInit } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { Angular2SwapiService, Film } from 'angular2-swapi';\n\n@Component({\n  selector: 'app-root',\n  template: `\n    \u003cli *ngFor=\"let film of film$ | async\"\u003e\n      \u003ch1\u003e{{ film.title }}\u003c/h1\u003e\n      \u003ch3\u003e{{ film.release_date | date }}\u003c/h3\u003e\n      \u003cp\u003e{{ film.opening_crawl }}\u003c/p\u003e\n    \u003c/li\u003e\n  `,\n  styles: []\n})\nexport class AppComponent implements OnInit {\n\n  film$: Observable\u003cFilm[]\u003e;\n\n  constructor(private _swapi: Angular2SwapiService) {}\n\n  ngOnInit() {\n    // Get list of films you can specify page\n   this.film$ = this._swapi.getFilms();\n  }\n\n}\n```\nSearch films by title:\n```typescript\nimport { Component, OnInit } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { Angular2SwapiService, Film } from 'angular2-swapi';\n\n@Component({\n  selector: 'app-root',\n  template: `\n    \u003cli *ngFor=\"let film of film$ | async\"\u003e\n      \u003ch1\u003e{{ film.title }}\u003c/h1\u003e\n      \u003ch3\u003e{{ film.release_date | date }}\u003c/h3\u003e\n      \u003cp\u003e{{ film.opening_crawl }}\u003c/p\u003e\n    \u003c/li\u003e\n  `,\n  styles: []\n})\nexport class AppComponent implements OnInit {\n\n  film$: Observable\u003cFilm[]\u003e;\n\n  constructor(private _swapi: Angular2SwapiService) {}\n\n  ngOnInit() {\n    // Search films by title\n   this.film$ = this._swapi.searchFilms('menace');\n  }\n\n}\n```\nGet film by id:\n```typescript\nimport { Component, OnInit } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { Angular2SwapiService, Film } from 'angular2-swapi';\n\n@Component({\n  selector: 'app-root',\n  template: `\n    \u003cli *ngIf=\"film$ | async as film\"\u003e\n      \u003ch1\u003e{{ film.title }}\u003c/h1\u003e\n      \u003ch3\u003e{{ film.release_date | date }}\u003c/h3\u003e\n      \u003cp\u003e{{ film.opening_crawl }}\u003c/p\u003e\n    \u003c/li\u003e\n  `,\n  styles: []\n})\nexport class AppComponent implements OnInit {\n\n  film$: Observable\u003cFilm\u003e;\n\n  constructor(private _swapi: Angular2SwapiService) {}\n\n  ngOnInit() {\n    // Get film with id=2\n   this.film$ = this._swapi.getFilm(2);\n  }\n\n}\n```\nYou can use the same pattern to get all the other resources from Star Wars API and display them in your application.\n\n## Where is Wookiee?\nI don't speak wookie, do you? Still working on it.\n\n## StarWars API Resources\nPlease check full Star Wars API documentation by Paul Hallet at https://swapi.co/documentation\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskadizz%2Fangular2-swapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskadizz%2Fangular2-swapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskadizz%2Fangular2-swapi/lists"}