Class: Anego::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/anego/client.rb

Constant Summary collapse

API_ENDPOINT =
"https://api.appannie.com/v1.2"

Instance Method Summary collapse

Constructor Details

#initialize(api_key: nil) ⇒ Client

Returns a new instance of Client.



5
6
7
# File 'lib/anego/client.rb', line 5

def initialize(api_key: nil)
  @api_key = api_key
end

Instance Method Details

#accountsObject



9
10
11
# File 'lib/anego/client.rb', line 9

def accounts
  request :get, "/accounts"
end

#product_details(market, product_id) ⇒ Object



17
18
19
# File 'lib/anego/client.rb', line 17

def product_details(market, product_id)
  request :get, "/apps/#{market}/app/#{product_id}/details"
end

#product_ranks(market, product_id, start_date, end_date, country, category, feed) ⇒ Object



33
34
35
36
37
38
39
40
41
# File 'lib/anego/client.rb', line 33

def product_ranks(market, product_id, start_date, end_date, country, category, feed)
  request :get, "/apps/#{market}/app/#{product_id}/ranks", {
    start_date: start_date,
    end_date: end_date,
    countries: country,
    category: category,
    feed: feed
  }
end

#product_ratings(market, product_id) ⇒ Object



21
22
23
# File 'lib/anego/client.rb', line 21

def product_ratings(market, product_id)
  request :get, "/apps/#{market}/app/#{product_id}/ratings"
end

#product_reviews(market, product_id, start_date, end_date, country) ⇒ Object



25
26
27
28
29
30
31
# File 'lib/anego/client.rb', line 25

def product_reviews(market, product_id, start_date, end_date, country)
  request :get, "/apps/#{market}/app/#{product_id}/reviews", {
    start_date: start_date,
    end_date: end_date,
    countries: country
  }
end

#products(account_id) ⇒ Object



13
14
15
# File 'lib/anego/client.rb', line 13

def products()
  request :get, "/accounts/#{account_id}/products"
end