Peekio API Documentation

Peekio API Version 2.71
Last updated 17.02.2022 by Pikalugia

Introduction

Before we dive in, thank you so much for showing interest in our API. You are awesome!

This documentation exists to help you utilize our API. Please go through the documentation carefully to understand how it's structured. You will require basic knowledge in fetching json information.

What is an API, anyway?

API is short for ‘Application Programming Interface’ . An API is a set of rules that lets programs talk to each other, exposing data and functionality across the Internet in a consistent format.

These URLs represent various resources — any information or content accessed at that location, which can be returned as JSON, XML, VDF, HTML, audio files, images and more. Often resources have one or more methods that can be performed on them over HTTP, like GET, POST, PUT, and DELETE.

GET is used to fetch/get the information.
POST is used to create information.
PUT is used to update the information.
DELETE is used to... do I even need to tell you?

Example JSON

This is an example of how our JSON API is formatted. If you GET the string "newsTitle_1" you'll fetch "Welcome to Stallion Squad" in return which you can display anywhere - and it updates whenever we update our API! Cool right?

{
   "newsTitle_1": "Welcome to Stallion Squad",
   "newsDesc_1": "Thanks for playing!",
   "newsImage_1": "https://www.peekio.no/assets/n14.png",
}  

Mmm... gotta love JSON.

Requirements

All you really need is a software, website or server where you can display the fetched information. In Stallion Squad we're displaying it in-game using the VaRest plugin for Unreal Engine. If you're in a terminal you could use Curl to make REST API requests directly. Example below!

curl -G api.peekio.no/GetItemDefs.php

Query Strings

Please note that some API requests might require you to add values to a query string. A query string is an additional request that is added after a URL. In the User Inventory API you're required to add your 64-bit Steam ID at the end of a query string called ?steamid=. Query strings are a way for the API to understand what you're requesting.

Stallion Squad

The Stallion Squad API gains you access to the same tools we use at Peekio to obtain Stallion Squad values like item definitions (full list of all items in the game) and the item shop (to know what's currently being sold).

Some API endpoints might have a "key" query string. You can obtain these from Steam here.

GET

Item Definitions

Raw values for all Stallion Squad steam items. Includes names, descriptions, tags, type, rarities, colors, images, recipes, tradeable/marketable.

Query String

Type

Description

modifiedsince

string

Updates since given time

itemdefids

uint64

Fetch only specific itemdefs

GET

Leaderboard

Raw values for all users currently on the desired leaderboard. Includes Steam ID, score and rank.

Query String

Type

Description

type

string

Leaderboard type

rangestart

int32

range start or 0

rangeend

int32

range end or max LB entries

datarequest

uint32

The request to make

GET

User Inventory

Raw values displaying info about Stallion Squad items the specified user has in their steam inventory.

Query String

Type

Description

steamid

uint64

64-bit Steam ID of the user

GET

Achievements

Raw values displaying information about Steam achievements earnt by the specified user.

Query String

Type

Description

key

string

Steam API user auth key

steamid

uint64

SteamID of user

GET

🛒 Item Shop

Raw values for everything currently available in the in-game Stallion Squad Item Shop. Includes Steam item definitions, prices and URLs.

.JSON

GET

🎨 Fan Art

Raw values for all fan art currently being displayed on the in-game hub billboard. Includes images and creator names.

.JSON

GET

📰 News Widget

Raw values for all news currently being displayed in the in-game Stallion Squad news widget. Includes titles, descriptions, URLs and images.

.JSON

GET

⚠️ Peekio Update

Raw values for currently displayed announcement in-game. Includes boolean for show warning and string description.

.JSON

Peekio Connect

Embed Widgets

Peekio Connect is built up by a ton of seperate widgets which you can embed on your own website or application. We use embed widgets in our Peekio android app using the WebView feature in Android Studio. You could use HTML iframe tags to embed these widgets on a website as well.

Components

Each widget is made up of components. Here is an example of the homepage with all components enabled:

https://connect.peekio.no/embed/home?components=menu,sidebar,input,feed

You can see that this link has the components "menu", "sidebar", "input" and "feed" enabled. You can add or remove these from the link (after ?components=). Combining components together can make for some interesting results and is a way for you to integrate Peekio Connect neatly into your design. Choose the components that work for you and voilà.

Game Feed Widget

The game feed widget displays different components of a game including breadcrumb, header, suggestions, feed, input, and sidebar.
connect.peekio.no/embed/topic/{topic_name}

Group Feed Widget

The group widget displays different components of a group including header, banner, breadcrumb, input, feed, and members.
connect.peekio.no/embed/group/{group_name}

Post Feed Widget

This widget displays a particular post including post, topics, share and responses.
connect.peekio.no/embed/post/{post_name}

User Widget

The user widget displays different components of a user profile including header, menu, and main.
connect.peekio.no/embed/user/{user_name}

Notification Widget

Displays a list of logged in user’s notifications. Requires user to be logged in. connect.peekio.no/embed/notifications

Question Widget

This widget displays different components of a particular question including question, answers, stats, relatedQuestions, share, and topics.
connect.peekio.no/embed/question/{question_ID}

Answer Widget

This widget displays components of a particular answer including answer, and more.
connect.peekio.no/embed/question/{question_ID}/answer/{answer_ID}

Home Widget

The home widget displays the entire Peekio Connect feed. It includes the feed, input, menu, and sidebar.
https://connect.peekio.no/embed/home

RSS Feed

The Peekio Connect RSS Feed is a web feed that allows users and applications to access updates in a standardized, computer-readable format. These feeds can, for example, allow a user to keep track of many different websites in a single news aggregator.