Skip to content

Data API

Note

This article refers to the legacy FraudScore interface. See more details here.

To get data from FraudScore platform you can use our Data API.

Specs

You can find interactive help using your personal link:

https://api.fraudscore.ai/<CHANNEL_ID>/help?key=<USER_KEY>

Simply put your <CHANNEL_ID> and <USER_KEY> (you can find them on the "Data API help" page of your integration channel) and follow the instructions.

Examples

Always make sure you know your API key.

Events List Request Example

#!/usr/bin/env python3
# coding: utf8

import json
import requests

# Your channel id.
CHANNEL = 'channel_id'

# Your user key.
USER_KEY = 'user_key'

# Event type.
# Possible values:
# install, click, impression, custom.
EVENT = 'install'

# This is how URL looks like.
url = f'https://get.fraudscore.ai/{CHANNEL}/{EVENT}'

# Initialize request parameters.
# User key required.
params = dict(key = USER_KEY)

# List of fields we need.
# String or list of strings.
params['field'] = ['datetime', 'offer_id', 'affiliate_id', 'ipv4_str', 'ua']

# Optional filter expression.
# String (JSON).
# Expression format: ["operator", operand, operand, ...]
# Operand format: ["field", "value"]
# Nested expressions are supported. Example:
# `date > "2019-01-01" AND date < "2019-06-01" AND (offer_id = "id1" OR offer_id = "id2")`
params['filter'] = json.dumps([
    "AND",
    ["date_gt", "2019-01-01"],
    ["date_lt", "2019-06-01"],
    [ # Nested expression.
        "OR",
        ["offer_id", "id1"],
        ["offer_id", "id2"],
        # More operands here...
    ],
    # More operands here...
])
# Optional sorting.
# String or list of strings.
params['sort'] = [
    'offer_id_asc',  # sort by id ascending
    'datetime_desc', # then by datetime descending
]

# Optional page number.
# Default 1.
params['page'] = 1

# Optional page size.
# Maximum 1000000.
# Default 100.
params['page_size'] = 100

# Perform GET request.
# Stream mode recommended.
r = requests.get(url, params, stream = True)
print('Request URL', r.url)

# `https://get.fraudscore.ai/channel_id/install?key=user_key&field=datetime&field=offer_id&field=affiliate_id&field=ipv4_str&field=ua&filter=%5B%22AND%22%2C+%5B%22date_gt%22%2C+%222019-01-01%22%5D%2C+%5B%22date_lt%22%2C+%222019-06-01%22%5D%2C+%5B%22OR%22%2C+%5B%22offer_id%22%2C+%22id1%22%5D%2C+%5B%22offer_id%22%2C+%22id2%22%5D%5D%5D&sort=offer_id_asc&sort=datetime_desc&page=1&page_size=100`
print('Total count of events found', r.headers['fraudscore-count'])

# Response format is JSON lines. Read it line by line.
# That's why we passed `stream = True` above.
for line in r.iter_lines():
    # Each line is JSON.
    # Decode it and have fun!
    data = json.loads(line)

Events Grouping Request Example

#!/usr/bin/env python3
# coding: utf8

import json
import requests

# Your channel id.
CHANNEL = 'channel_id'

# Your user key.
USER_KEY = 'user_key'

# Event type.
# Possible values:
# install, click, impression, custom.
EVENT = 'install'

# This is how URL looks like.
url = f'https://get.fraudscore.ai/{CHANNEL}/{EVENT}/groups'

# Initialize request parameters.
# User key required.
params = dict(key = USER_KEY)

# List of fields to group.
# String or list of strings.
params['group'] = [
    'date',
    'ipv4_str',
]

# List of special group fields we need.
# String or list of strings.
params['field'] = [
    'any_offer_name',
    'any_affiliate_name',
]

# Optional filter expression.
# String (JSON).
# Expression format: ["operator", operand, operand, ...]
# Operand format: ["field", "value"]
# Nested expressions are supported. Example:
# `date > "2019-01-01" AND date < "2019-06-01" AND (offer_id = "id1" OR offer_id = "id2")`
params['filter'] = json.dumps([
    "AND",
    ["date_gt", "2019-01-01"],
    ["date_lt", "2019-06-01"],
    [ # Nested expression.
        "OR",
        ["offer_id", "id1"],
        ["offer_id", "id2"],
        # More operands here...
    ],
    # More operands here...
])

# Optional filter after grouping.
# Works the same way as `filter` param.
# Example: return groups where count >= 10
params['having'] = json.dumps(
    ["count_ge", "10"]
)

# Optional sorting.
# String or list of strings.
params['sort'] = [
    'any_offer_name_asc', # sort by offer_name ascending
    'any_affiliate_name_desc', # then by affiliate_name descending
]

# Optional page number.
# Default 1.
params['page'] = 1

# Optional page size.
# Maximum 1000000.
# Default 100.
params['page_size'] = 100

# Perform GET request.
# Stream mode recommended.
r = requests.get(url, params, stream = True)
print('Request URL', r.url)

# https://get.fraudscore.ai/channel_id/install/groups?key=user_key&group=date&group=ipv4_str&field=any_offer_name&field=any_affiliate_name&filter=%5B%22AND%22%2C+%5B%22date_gt%22%2C+%222019-01-01%22%5D%2C+%5B%22date_lt%22%2C+%222019-06-01%22%5D%2C+%5B%22OR%22%2C+%5B%22offer_id%22%2C+%22id1%22%5D%2C+%5B%22offer_id%22%2C+%22id2%22%5D%5D%5D&having=%5B%22count_gt%22%2C+%2210%22%5D&sort=any_offer_name_asc&sort=any_affiliate_name_desc&page=1&page_size=100
print('Total count of groups', r.headers['fraudscore-count'])
# Response format is JSON lines. Read it line by line.
# That's why we passed `stream = True` above.
for line in r.iter_lines():
    # Each line is JSON.
    # Decode it and have fun!
    data = json.loads(line)

Discovery

This is a special method to retrieve list of available fields.

#!/usr/bin/env python3
# coding: utf8

import json
import requests

# Your channel id.
CHANNEL = 'channel_id'

# Your user key.
USER_KEY = 'user_key'

# This is how URL looks like.
url = f'https://get.fraudscore.ai/{CHANNEL}/discovery/fields'

# Initialize request parameters.
# User key required.
params = dict(key = USER_KEY)

# Optional list of tags.
# String or list of strings.
# Possible values:
# - install (event type)
# - click (event type)
# - custom (event type)
# - impression (event type)
params['tag'] = [
    'install',
]
# Perform GET request.
r = requests.get(url, params)
print('Request URL', r.url)

# https://get.fraudscore.ai/channel_id/discovery/fields?key=user_key&tag=install
# Response format is JSON.
data = r.json()
print('Event fields:', data['fields'])
print('Aggregate fields (grouping only):', data['aggregate'])
print('Grouping fields:', data['group'])
print('Filter fields:', data['filter'])

feb 27, 2026