Class: GfApi

GfApi(apiKey, secret, options)

new GfApi(apiKey, secret, options)

Create GfApi client

Parameters:
Name Type Description
apiKey string

API Key, eg test-0123456789abcde

secret hash

TOTP secret, eg {secret: 'your secret', algorithm: 'SHA1', digits: 6, period: 30}

options hash

Options, eg {loglevel: 'trace'}

  • logLevel: trace (logs HTTP requests/responses), debug (logs HTTP requests), info, warn, error, or fatal
Source:

Methods

bulk_get(bulk) → {hash}

Get bulk object.

Parameters:
Name Type Description
bulk uuid

id

Source:
Returns:

Sample result

{
  "id": "b4ef3e91-dca9-46ea-8e4b-5f38062fb26d",
  "owner": "us-east-1:ab36c6a0-2cb6-476c-809c-77a08908499f",
  "offer_key": "Ol4YAU5g-l0w",
  "status": "listed",
  "num_listed": 2,
  "listings": [
    {
       "id": "f005c650-567c-4494-85ef-57cc567d27cc",
       "status": "draft"
    }, {
       "id": "555f8301-2f3f-451d-b69f-7a2fe0241016",
       "status": "draft"
    }],
  "updated": "2017-01-21T02:29:53.511Z",
  "created": "2017-01-21T02:03:56.164Z"
}

bulk.status

  •                 +-- steam_escrow --+
                    |                  v
      start <-> receive_pending --> received -----> listed
                                       |               ^
                                       +-> trade_hold -+
    
- *start*: initial state
- *receive_pending*: trade offer made
- *steam_escrow*: trade offer accepted but held by STEAM
- *received*: trade offer accepted and item received by bot
- *trade_hold*: item received by bot, but trade hold on item (e.g., Just Survive)
- *listed*: listings and escrows created (search index may still be pending)
Type
hash

bulk_mine_get(Query)

Query your bulk object (subset of data fields) by status

Parameters:
Name Type Description
Query hash

options. Warning: modified by callee.

  • status: Either 'start', 'receive_pending', 'received', 'listed', 'steam_escrow', or 'trade_hold'.
  • limit # of entries to get (default: 20, max: 100)
Source:
Returns:

Array of bulks (subset of data fields) or null if none left

bulk_post() → {hash}

Create bulk object

Source:
Returns:

Sample result

{
  "id": "b4ef3e91-dca9-46ea-8e4b-5f38062fb26d",
  "owner": "us-east-1:ab36c6a0-2cb6-476c-809c-77a08908499f",
  "offer_key": "Ol4YAU5g-l0w",
  "status": "start",
  "updated": "2017-01-21T02:29:53.511Z",
  "created": "2017-01-21T02:03:56.164Z"
}

The main field you are concerned about is 'id'.

Type
hash

bulk_put(id, data) → {hash}

Initiate trade offer or gets latest bulk object (if data parameter not specified).

Parameters:
Name Type Default Description
id uuid

Bulk ID from bulk_post()

data hash null

Optional. If specified, create offer for items specified:

[{
   id: item.asset_id,
   appid: item.appid,
   price: priceInCents,
   market_hash_name: item.market_hash_name
}, {
   ...
}]

If not specified, updates and returns latest bulk object.

Source:
Returns:

bulk data

Type
hash

check_trade_ban()

Check if you have a Steam trade ban or hold

Source:
Throws:

UnprocessableEntityError you have trade ban or hold

digital_goods_get(listing)

Get digital goods from listing if any available. This method will retrieve, decrypt, and return the digital goods.

Parameters:
Name Type Description
listing string

id

Source:
Returns:

digital content previously stored for the listing

digital_goods_put()

Put digital goods/content for digital listing

Source:

escrow_get(listing) → {hash}

Get escrow data, if exists, for given listing id. Caller must own listing.

Parameters:
Name Type Description
listing uuid

id

Source:
Returns:

escrow data escrow.status

received <--> deliver_pending --> delivered ^ | +----> return_pending -----> returned ```

  • received: trade offer accepted and item received by bot
  • deliver_pending: trade offer made to buyer but not accepted
  • delivered: trade offer accepted by buyer. Initiate listing completion.
  • return_pending: trade offer made to seller to return item
  • return: trade offer accepted and seller has item
Type
hash

escrow_mine_get(Query)

Query your escrows (subset of data fields) by status

Parameters:
Name Type Description
Query hash

options. Warning: modified by callee. status Either 'received' (default), 'delivered', 'returned'. limit # of entries to get (default: 20, max: 100)

Source:
Returns:

Array of escrows (subset of data fields) or null if none left

Search exchanges (purchases or sold listings).

Source:
Returns:

the search result which also contains an array of exchanges owned by the API key owner

(async) listing_delete(id)

Delete a single listing by id.

Parameters:
Name Type Description
id

list id

Source:
Returns:

result

listing_get(id)

Get a single listing by id. The listing owner can view any listing they own. Anyone else may only view listings that are publicly viewable or get an error.

Parameters:
Name Type Description
id

list id

Source:
Returns:

listing

listing_of(owner)

Get a user's listings.

Parameters:
Name Type Description
owner

of the user.

Source:
Returns:

listings

listing_patch(Query)

Update a listing with new or updated properties.

Parameters:
Name Type Description
Query hash

options.

Source:
Returns:

listing

listing_post()

Create a blank listing to be edited and posted.

Source:
Returns:

listing

Search listings.

Source:
Returns:

Array of listings or null if none left

listing_status(id, status)

Change a listing's status.

Parameters:
Name Type Description
id string
status enum
Source:
Returns:

listing

product_get(id)

Get a single product by id.

Parameters:
Name Type Description
id

product id

Source:
Returns:

product

Search the product catalog.

Source:
Returns:

Array of products or null if none found

profile_get()

Get profile

Source:
Returns:

profile

steam_inventory_get(profileId, appId, query)

Get public steam inventory. This is not part of the Gameflip API and is an unsupported helper function.

Parameters:
Name Type Description
profileId string

Profile ID of Steam User

appId string

APP ID of game inventory to retrieve (such as, GfApi.STEAM.APP_ID.CS2)

query hash

parameters including l= and count=

Source:

(async) upload_photo(listing_id, url, display_order) → {object}

Upload an online image to Gameflip for use as the listing's photo.

Parameters:
Name Type Description
listing_id string

to update the listing

url string

of the photo

display_order int

for multiple photos. If not provided then it is a cover photo and is shown on the search pages (should be lower res). If provided then it is a listing page photo (should be higher res), and the number is its order in the photo carousel.

Source:
Returns:

photo object with url

Type
object

wallet_get(owner, options)

Get wallet balance and transaction history/ledger NOTE: the balance amount is the lowest possible unit for that currency. Ex: cents for USD and atto (10e-18) for FLP)

Parameters:
Name Type Description
owner

the user's owner/user id

options

Options for data return

  • balance_only: Return only the wallet balance without any recent history (without ledger)
  • flp: Return with the "balance" property to be a map showing the balance for each currency supported
  • pending: Also include pending transactions
  • held: Also include held transactions
  • year_month (yyyy-mm): The year and month in which the transactions took place. When not provided, the current month is used
Source:
Returns:

wallet information