Only this pageAll pages
Powered by GitBook
1 of 4

English

Loading...

API v2 Instruction

Loading...

Loading...

Report API

The usage on report API v2.

Post Drop

POST https://penguin-stats.io/PenguinStats/api/v2/report

This endpoint allows you to submit drop sample.

Request Body

Name
Type
Description

server

string

Indicate the server of this drop sample. We support 4 servers now: "CN", "US", "JP" and "KR".

stageId

string

The stageId of this drop.

drops

array

An array of Drop. Please find its model below.

source

string

The source is used to mark the client sending this request. Equivalent to `User-Agent` presented in the header.

version

string

The version of the source.

{
  "reportHash": "49523605e1ab4774d1058d9caa25879c193226c9effee177fb3571a9f0e83e69"
}

Drop

Model

{
  dropType: string,
  itemId: string,
  quantity: number
}

Properties

dropType should be one of the four following values

  • NORMAL_DROP

  • SPECIAL_DROP

  • EXTRA_DROP

  • FURNITURE.

itemId is the internal id of item. It can be found in this repository.

quantity is the number of item dropped under this drop type. Must be positive.

Examples of Request Body

{
  "drops": [
    {
      "dropType": "SPECIAL_DROP",
      "itemId": "randomMaterial_3",
      "quantity": 1
    },
    {
      "dropType": "EXTRA_DROP",
      "itemId": "30061",
      "quantity": 2
    },
    {
      "dropType": "NORMAL_DROP",
      "itemId": "30013",
      "quantity": 1
    },
    {
      "dropType": "FURNITURE",
      "itemId": "furni",
      "quantity": 1
    }
  ],
  "stageId": "main_04-06",
  "server": "CN",
  "source": "CLIENT_SOURCE",
  "version": "CLIENT_VERSION"
}
{
  "drops": [
    {
      "dropType": "NORMAL_DROP",
      "itemId": "30063",
      "quantity": 1
    }
  ],
  "stageId": "main_06-14",
  "server": "US",
  "source": "CLIENT_SOURCE",
  "version": "CLIENT_VERSION"
}

Welcome!

You can find the API documentations along with their descriptions right here.

Introduction

Penguin Statistics highly welcome any form of API usage but we would like to kindly ask you to obey our data license Attribution-NonCommercial 4.0 International (CC BY-NC 4.0). Although we generally do not provide any form of rate limit (Advanced Query resource, in Penguin Statistics Backend, is the only exception), we still want to ask you to fairly use the service ;)

Contact us

Please do not submit usage issues on GitHub Issues. We use GitHub Issues only for bugs and feature requests.

You could contact us using various methods including:

  1. The support chat window at the bottom right corner located at the homepage of Penguin Statistics.

  2. Discord

  3. E-mail to the webmaster alvissreimu [at] gmail.com

Matrix API

The usage of matrix API v2.

Get Matrix Result

GET https://penguin-stats.io/PenguinStats/api/v2/result/matrix

This endpoint allows you to get matrix result.

Query Parameters

Name
Type
Description

stageFilter

string

Do filter on final result by stage. It should be a list of stageIds separated by commas.

itemFilter

string

Do filter on final result by item. It should be a list of itemIds separated by commas.

server

string

Indicate which server you want to query. We support 4 servers now: "CN", "US", "JP" and "KR". Default value is "CN".

show_closed_zones

boolean

Whether show closed zones and stages or not. Default value is false.

is_personal

boolean

Whether use personal drop data or global one. If the value is true, please make sure userID is set in cookies. Default value is false.

{
  "matrix":[
    {
      "stageId":"main_01-07",
      "itemId":"30012",
      "quantity":164303,
      "times":131916,
      "start":1556676000000,
      "end":1589529600000
    },
    {
      "stageId":"main_01-07",
      "itemId":"30031",
      "quantity":7822,
      "times":131916,
      "start":1556676000000,
      "end":1589529600000
    },
    {
      "stageId":"sub_03-1-2",
      "itemId":"30032",
      "quantity":3162,
      "times":2079,
      "start":1556676000000,
      "end":1589529600000
    },
    {
      "stageId":"sub_03-1-2",
      "itemId":"randomMaterial_2",
      "quantity":20,
      "times":68,
      "start":1581105600000,
      "end":1582315200000
    }
  ]
}

What is Drop Matrix?

Suppose there is a matrix using stageId as row and itemId as column. Each element in the matrix represents the statistical data for that item in the stage. We will have a huge sparse matrix for all the items and stages, and for each server.

Drop Matrix Element

Model

{
  stageId: string,
  itemId: string,
  quantity: number,
  times: number,
  start: number,
  end: number
}

Properties

stageId and itemId are internal ids of stages and items. They can be found in this repository.

start is the left end (inclusive) of the interval. Time unit is millisecond.

end is the right end (exclusive) of the interval. Time unit is millisecond.

quantity means the number of dropped items during the interval.

times means the number of times this stage was played during the interval. The value may be 0, so please be careful when calculating the drop rate.

Interval

Not all submitted drop samples will be used in the calculation of this matrix. As you can see above, each matrix element has its own interval. We design a special mechanism to decide what each interval should be.

Let's take stage main_01-07 as an example. We have four time ranges A to D:

Time Range

Meaning

start

end

A

Arknights CN released ~ Chapter 6 released

1556676000000

1577174400000

B

Chapter 6 released ~ 应急理智小样 event ended

1577174400000

1578340800000

C

应急理智小样 event ended ~ 1st anniversary event started

1578340800000

1589529600000

D

1st anniversary event

1589529600000

1590696000000

Consider the following two items:

  • 30012: Chinese name is "固源岩". It shows up in the drop list of main_01-07 across all time ranges from A to D.

  • ap_supply_lt_010: Chinese name is "应急理智小样". It only shows up in the drop list of main_01-07 during time range B and D.

The calculation is assuming that the drop of ap_supply_lt_010 is independent from other items in main_01-07. The quantity and times of 30012 can be summed up across time range A to D. So the summation interval of 30012 will be A to D, which means [1556676000000, 1590696000000). Here we say all ranges for 30012 in main_01-07is accumulatable. (Maybe we should use the term "accumulable", however in the code and database we are using the former one, so we want to keep it as it is.)

For ap_supply_lt_010, we are not sure if the drop rate in time range D is different from the one in B. Thus, we think that samples from B and D should not be summed up together. We would like to say ap_supply_lt_010 in main_01-07 is non-accumulatable during time range B and D. Our matrix API is designed to reveal the latest drop rates, so the interval of ap_supply_lt_010 in main_01-07 in the matrix will be [1589529600000, 1590696000000).

Although the data of ap_supply_lt_010 in main_01-07 is not showing in the matrix result, you can still use Advanced Query to get them.

The interval may be varies for different items in one stage. That is why we show it using start and end in the drop matrix element.