Step 3A: Preparing the Request

All requests to the API have to use HTTP GET. No other HTTP methods are supported and will result in a HTTP Error 404. You provide Fyber with the needed information to send you all offers available to your user with this request.

Offer Type Filter (offer_types)

This parameter allows the filtering of offers based on their type, so that only offers matching one or more of the specified categories will be returned. This parameter is optional. More than one offer type can be given as a parameter, concatenated with a comma. For filtering, they will be combined using logical OR.

Request Result
...&offer_types=112&... The Response will contain all offers marked as ‘Free’.
...&offer_types=101,112&... Response will contain all offers marked as ‘Download’ or marked as ‘Free’.


If you want to request all offers except one or more categories (blacklisting), please use the filter configuration in the Fyber Publisher Control Panel.

A list of all available offer_type IDs to use in the request filter is found below.

Offers sorted by the fact that it costs the user something:

offer_type_id Readable Description
112 Free Free offers
103 Sale Shopping offers

Offer sorted by user action:

offer_type_id Readable Description
100 Mobile Mobile subscription offers
101 Download Download offers (from Apple Store)
102 Trial Trial subscription offers
104 Registration Information request offers
105 Registration Registration offers
108 Registration Data Generation offers
110 Surveys Survey offers
111 Dating Dating offers
113 Video Video offers
114 Rewarded Action Rewarded action offers

Download offers sorted by gaming category (if applicable):

offer_type_id Readable Description
106 Games Gaming offers
107 Games Gambling offers
109 Games Skill Game offers


One offer will match multiple categories, e.g. one offer can be an app to download from the Apple Store as well as a free skill game.

Hashkey Calculation

This hash key must be generated by the device itself and must follow strict rules:

  1. Get all request parameters and their values (except hashkey).
  2. Order theses pairs alphabetically by parameter name.
  3. Concatenate all pairs using = between key and value and & between the pairs.
  4. Concatenate the resulting string with & and the API Key given to you by Fyber.
  5. Hash the whole resulting string, using SHA1. The resulting hashkey is then appended to the request as a separate parameter.

If some parameters must be url-encoded, the entire hash calculation has to be done before this encoding. 


Here's an example of the process:

  1. Gather all request parameters, except the hashkey.

  2. Gather all request parameters:

    • appid = 157
    • google_ad_id=a0b0c0d0-a0b0-c0d0-e0f0-a0b0c0d0e0f0
    • google_ad_id_limited_tracking_enabled=true
    • ip =
    • locale = de
    • page = 2
    • pub0 = campaign2
    • timestamp = 1585187676
    • uid = player1
  3. Concatenate all request parameters.

  • Result Step 3
  1. Concatenate the resulting string with your API Key.

Using your API Key: e95a21621a1865bcbae3bee89c4d4f84

  • Result Step 4
  1. Hash the resulting string using SHA1.
  • Result Step 5


The Mobile Offer API expects the hashkey to be in lower case.

The complete request URL to Fyber’s Mobile Offer API for these parameters would then look like this:


Example implementation of the code in Ruby

  • Ruby
require 'digest/sha1'

api_key = 'e95a21621a1865bcbae3bee89c4d4f84' # your Fyber API key for the application
params = 'appid=157&google_ad_id=a0b0c0d0-a0b0-c0d0-e0f0-a0b0c0d0e0f0&google_ad_id_limited_tracking_enabled=true&ip=' # request params
page = 2

params = params.split('&').each_with_object({}) do |item, memo|
  key, value = item.split('=')
  memo[key] = value

def to_query(hash) { |item| item.join('=') }.join('&')

params['timestamp'] =
params['page'] = page

params = params.sort.to_h # sort by key name
hashkey = Digest::SHA1.hexdigest("#{to_query(params)}&#{api_key}")

url = "{to_query(params)}&hashkey=#{hashkey}"



To avoid displaying potentially expired offers to the user, please try to keep requests as close to realtime as possible.

Improving Response Times

To optimize the communication between servers, dramatically reduce response times and improve the user experience, we recommend the following:

  • Enable Keep-Alive for all requests.
  • Enable compression of the response using Accept-Encoding: gzip headers.

Let's continue to Parse the Response.

Back to Top ⇧