Skip to content

timwco/swapi.ex

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Elixir Based Star Wars API Wrapper

Build Status Hex.pm Hex.pm

A simple wrapper for the Star Wars API - Swapi Documentation

Installation

The Hex package can be installed as:

  1. Add swapi to your list of dependencies in mix.exs:

    def deps do [{:swapi, "~> 1.0.0"}] end

  2. Ensure swapi is started before your application:

    def application do [applications: [:swapi]] end

Usage

For each below (except root) you can use any of the following:

  • people
  • films
  • starships
  • vehicles
  • species
  • planets

Root

# Get the list of resources
iex> Swapi.root
{:ok, {...}}

Single

# Get all people
iex> Swapi.single("people", 1)
{:ok, {...}}

All

# Get all people
iex> Swapi.all("people")
{:ok, {...}}

Schema

# Get the schema for people
iex> Swapi.schema("people")
{:ok, {...}}

About

πŸš€ Elixir Based Star Wars API Wrapper

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages