Class: Pinterest::Keywords

Inherits:
Object
  • Object
show all
Defined in:
lib/pinterest/keywords.rb

Instance Method Summary collapse

Constructor Details

#initialize(client: nil) ⇒ Keywords

Returns a new instance of Keywords.



3
4
5
# File 'lib/pinterest/keywords.rb', line 3

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

Instance Method Details

#create_keywords(ad_account_id:, parameters: {}) ⇒ Object



11
12
13
# File 'lib/pinterest/keywords.rb', line 11

def create_keywords(ad_account_id:, parameters: {})
  @client.json_post(path: "/ad_accounts/#{}/keywords", parameters: parameters)
end

#get_country_keyword_metrics(ad_account_id:, country_code:, keywords:, parameters: {}) ⇒ Object



19
20
21
# File 'lib/pinterest/keywords.rb', line 19

def get_country_keyword_metrics(ad_account_id:, country_code:, keywords:, parameters: {})
  @client.get(path: "/ad_accounts/#{}/keywords/metrics?country_code=#{country_code}&keywords=#{keywords}", parameters: parameters)
end

#get_keywords(ad_account_id:, parameters: {}) ⇒ Object



7
8
9
# File 'lib/pinterest/keywords.rb', line 7

def get_keywords(ad_account_id:, parameters: {})
  @client.get(path: "/ad_accounts/#{}/keywords", parameters: parameters)
end

Region list: “US” “CA” “DE” “FR” “ES” “IT” “DE+AT+CH” “GB+IE” “IT+ES+PT+GR+MT” “PL+RO+HU+SK+CZ” “SE+DK+FI+NO” “NL+BE+LU” “AR” “BR” “CO” “MX” “MX+AR+CO+CL” “AU+NZ” trend_type: “growing” “monthly” “yearly” “seasonal” interest: “animals” “architecture” “art” “beauty” “childrens_fashion” “design” “diy_and_crafts” “education” “electronics” “entertainment” “event_planning” “finance” “food_and_drinks” “gardening” “health” “home_decor” “mens_fashion” “parenting” “quotes” “sport” “travel” “vehicles” “wedding” “womens_fashion” genders: “female” “male” “unknown” ages: “18-24” “25-34” “35-44” “45-49” “50-54” “55-64” “65+” normalize_against_group (boolean): false (default) limit [1-50] developer.pinterest.com/docs/api/v5/#operation/trending_keywords/list



32
33
34
# File 'lib/pinterest/keywords.rb', line 32

def list_trending_keywords(region:, trend_type:, interest:, gender:, ages:, normalize_against_group:, limit:, parameters: {})
  @client.get(path: "/trends/keywords/#{region}/top/#{trend_type}?interest=#{interest}&gender=#{gender}&ages=#{ages}&normalize_against_group=#{normalize_against_group}&limit=#{limit}", parameters: parameters)
end

#update_keywords(ad_account_id:, parameters: {}) ⇒ Object



15
16
17
# File 'lib/pinterest/keywords.rb', line 15

def update_keywords(ad_account_id:, parameters: {})
  @client.patch(path: "/ad_accounts/#{}/keywords", parameters: parameters)
end