GithubHelp home page GithubHelp logo

shanemaglangit / axie-graphql-documentation Goto Github PK

View Code? Open in Web Editor NEW
100.0 6.0 27.0 429 KB

Unofficial API Documentation for the Axie Infinity's GraphQL Endpoint.

Home Page: https://axie-graphql.web.app

License: MIT License

JavaScript 100.00%
axie-infinity graphql gatsby

axie-graphql-documentation's Introduction

An image of @shanemaglangit's Holopin badges, which is a link to view their full Holopin profile

shanemaglangit.com Linkedin GitLab Twitter

axie-graphql-documentation's People

Contributors

jclutch avatar shanemaglangit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

axie-graphql-documentation's Issues

API crashed?

Hello guys, the API crashed? All my request attempts to most endpoints are giving error:
"errors": [ { "message": "502: Bad Gateway" }

Spelling error in response for abilities description for Nile Strike, "Appy Speed- to target for 2 rounds."

The response of the following request has a spelling error:

{
  "operationName": "GetAxieDetail",
  "variables": {
    "axieId": "2623939"
  },
  "query": "query GetAxieDetail($axieId: ID!) {\n  axie(axieId: $axieId) {\n    ...AxieDetail\n    __typename\n  }\n}\n\nfragment AxieDetail on Axie {\n  id\n  image\n  class\n  chain\n  name\n  genes\n  owner\n  birthDate\n  bodyShape\n  class\n  sireId\n  sireClass\n  matronId\n  matronClass\n  stage\n  title\n  breedCount\n  level\n  figure {\n    atlas\n    model\n    image\n    __typename\n  }\n  parts {\n    ...AxiePart\n    __typename\n  }\n  stats {\n    ...AxieStats\n    __typename\n  }\n  auction {\n    ...AxieAuction\n    __typename\n  }\n  ownerProfile {\n    name\n    __typename\n  }\n  battleInfo {\n    ...AxieBattleInfo\n    __typename\n  }\n  children {\n    id\n    name\n    class\n    image\n    title\n    stage\n    __typename\n  }\n  __typename\n}\n\nfragment AxieBattleInfo on AxieBattleInfo {\n  banned\n  banUntil\n  level\n  __typename\n}\n\nfragment AxiePart on AxiePart {\n  id\n  name\n  class\n  type\n  specialGenes\n  stage\n  abilities {\n    ...AxieCardAbility\n    __typename\n  }\n  __typename\n}\n\nfragment AxieCardAbility on AxieCardAbility {\n  id\n  name\n  attack\n  defense\n  energy\n  description\n  backgroundUrl\n  effectIconUrl\n  __typename\n}\n\nfragment AxieStats on AxieStats {\n  hp\n  speed\n  skill\n  morale\n  __typename\n}\n\nfragment AxieAuction on Auction {\n  startingPrice\n  endingPrice\n  startingTimestamp\n  endingTimestamp\n  duration\n  timeLeft\n  currentPrice\n  currentPriceUSD\n  suggestedPrice\n  seller\n  listingIndex\n  state\n  __typename\n}\n"
}

Response:

...

 {
                    "id": "back-croc",
                    "name": "Croc",
                    "class": "Reptile",
                    "type": "Back",
                    "specialGenes": null,
                    "stage": 1,
                    "abilities": [
                        {
                            "id": "reptile-back-12",
                            "name": "Nile Strike",
                            "attack": 90,
                            "defense": 60,
                            "energy": 1,
                            "description": "Appy Speed- to target for 2 rounds.",
                            "backgroundUrl": "https://storage.googleapis.com/axie-cdn/game/cards/base/reptile-back-12.png",
                            "effectIconUrl": "https://storage.googleapis.com/axie-cdn/game/cards/effect-icons/speed-down.png",
                            "__typename": "AxieCardAbility"
                        }
                    ],
                    "__typename": "AxiePart"
                },
...

"description": "Appy Speed- to target for 2 rounds.",

should be

"description": "Apply Speed- to target for 2 rounds.",

Issue with GetRecentlyAxiesSold not working correctly.

Sending a get/post request to the "GetRecentlyAxiesSold" operation always SAYS that it's returning 100 results but only ACTUALLY returns 20 results always starting from 0 no matter what the "size" and "from" variables are set to.

I wrote a test in python that I simplified to 43 lines to test if the API behaves as I expected it to from reading the documentation. I could be misunderstanding the documentation but if that is the case; then I have no idea what the "from" and "size" variables are supposed to do.

Here are my tests. Please let me know if I am misunderstanding something about how the API is supposed to work and this isn't an actual issue.

import requests
import json


def getRequest( frm=0, size=20 ):
    url = 'https://graphql-gateway.axieinfinity.com/graphql'
    return requests.get( url, params = {
      "operationName": "GetRecentlyAxiesSold",
      "variables": {
        "from": frm,
        "size": size
      },
      "query": '''
        query GetRecentlyAxiesSold($from: Int, $size: Int) {
            settledAuctions {
                axies(from: $from, size: $size) {
                    total
                    results {
                        ...AxieSettledBrief
                    }
                }
            }
        }
        
        fragment AxieSettledBrief on Axie {
            id
        }'''})

x, y = [ getRequest(frm = 40, size = 5), getRequest(frm = 0, size = 5) ]
    
json_data_x = json.loads(x.text)["data"]["settledAuctions"]["axies"]
json_data_y = json.loads(y.text)["data"]["settledAuctions"]["axies"]
    
total = int(json_data_x["total"])
results_x, results_y = [ json_data_x["results"], json_data_y["results"] ]

#Size Test
assert ( total == 5 )
assert ( len(results_x) <= 5 )

#From Test
id_x, id_y = [ results_x[0]['id'], results_y[0]['id'] ]
assert ( id_x != id_y )

Get list of all abilities

Is there a way to get a list of all possible abilities?

With GetAxieDetail you can get the parts abilities for a specific axie, but I would like to get all possible abilities.

Ever had to deal with 403 Forbidden response?

Hi,

First of all, thank you for this amazing documentation. It surely is helping a lot of developers like me. I know this is not an issue with your package but there's no information available about this error on the internet, so I've ran out of options.

Back to the point, did you ever had problems with 403 Forbidden responses? I've developed an app to notify people about new axies on the market and while in my local computer the API responses are fine, when I run the very same code on a VPS (DigitalOcean), all API responses are 403 Forbidden. I've tried to append ?r=myapp to the end of the GraphQL endpoint, but of course nothing changed. I also tried switching the VPS to get a new IP (maybe that IP was blacklisted for some reason?), but no success.

I think requests are delayed enough (20 secs), so I don't think it's a rate limiting problem or something like that. Any ideas?

Thanks.

Minimal queries

I'm trying to write a C++ program to query the Axie server, and I don't know GraphQL. All the attempted queries I've sent result in "Bad Request". Could you post a minimal query for each operation? For instance, for GetAxieDetail, you could ask for only the back of one specific Axie.

Also is the \n in the queries supposed to be sent as \n or as a linefeed?

GetRecentlySold params seem to have no effect?

Hey was playing around with this end point to see if I could get more results of recently sold axies to look/search through but I noticed no matter how much I changed the parameters I could only get back 20 at a time and the "from" parameter I thought was a pointer for pagination but seem to have no effect at all

    iterator = 0
    axies_list = []
    while iterator < 100:
        print(iterator)
        body = {
        "operationName": "GetRecentlyAxiesSold",
        "variables": {
        "from": iterator,
        "size": 100
        },
        "query": "query GetRecentlyAxiesSold($from: Int, $size: Int) {\n  settledAuctions {\n    axies(from: $from, size: $size) {\n      total\n      results {\n        ...AxieSettledBrief\n        transferHistory {\n          ...TransferHistoryInSettledAuction\n          __typename\n        }\n        __typename\n      }\n      __typename\n    }\n    __typename\n  }\n}\n\nfragment AxieSettledBrief on Axie {\n  id\n  name\n  image\n  class\n  breedCount\n  __typename\n}\n\nfragment TransferHistoryInSettledAuction on TransferRecords {\n  total\n  results {\n    ...TransferRecordInSettledAuction\n    __typename\n  }\n  __typename\n}\n\nfragment TransferRecordInSettledAuction on TransferRecord {\n  from\n  to\n  txHash\n  timestamp\n  withPrice\n  withPriceUsd\n  fromProfile {\n    name\n    __typename\n  }\n  toProfile {\n    name\n    __typename\n  }\n  __typename\n}\n"
        }
        r = requests.post('https://axieinfinity.com/graphql-server-v2/graphql', data=body)
        iterator += 20
        axies_list.extend(r.json()['data']['settledAuctions']['axies']['results'])
    count = {}
    for axie in axies_list:
        if axie['id'] in count:
            count[axie['id']] = count[axie['id']] + 1
        else: 
            count[axie['id']] = 1
    return count

Attached the results and as you can see despite iterating it just gets the same 20 back. Am I missing something or do they seem to be disabled?
Screen Shot 2021-07-21 at 3 00 12 PM

Authentication failure

When using the GetActivityLog, the response is Unauthenticated. How do I authenticate?

POST request also possible or not ?

Hi,
Sorry that's not an issue on the code itself but I can't find a way to contact you.

Is there a way to also POST on this API ?

For example claiming SLP or morphing ?

(nothing forbidden by the ToS of course, just simple stuff like that)

GetAxieBriefList auction value?

Hey, thanks for the repository! I'm trying to use the GetAxieBriefList endpoint using python3 requests library. I do receive the list with the specified search criteria but in the auction key field the value is always 'Null'. I was able to generate the authentication token and attach it to the header but nothing seems to change. Am I missing something?

Multiple IDS on Graphql API

Does anyone know if it is possible to send multiple Axie IDs to the API to get axle details rather than looping through one at a time?

Thanks,

Dex

GetAxieDetail Query

Hello! I would like to check for the getting the price of an axie, i noticed there are two values, one is currentPrice and the other one is currentPriceUSD. I assumed the currentPrice was supposed to be current price of axie in ETH but the numbers are huge, for example if axie is 0.091 then its showing me currentPrice = 91000000000000000.

Basically what i want to ask is what is this currentPrice referring to? and is it possible to get currentPrice in ETH

Question: Was looking for a way to query recent sales by some form of criteria

Hey, really enjoying the documentation!

Was wondering if you knew of a way to search for recently sold axies by criteria?

i.e. I'd like to get an idea of what axies are actually selling for that have Christmas Parts or 0 breed aquas. From what I can tell the recently sold search query doesn't appear to take criteria. One work around is to just call for latest sold and filter out based on criteria on my end BUT I don't know what the size limit is or call volume limit is so would like to try and use something more built in if it's available.

Thank you!

Authentication

Hey man, I wanted to ask you if you know how to currently generate a valid JWT token for authenticated requests.
I found a couple interesting endpoints, but I can only get my info using my own JWT token from the client.

Any idea how to implement other users' log in so that I can authenticate their requests? Or is that totally unsafe?

Number of returns

Hello, when I use the GetAxieBriefList query, it is said that there are 647729 in total, but I when I set "from" larger than 10000, it just returned nothing. So I can only fetch thousands of data? What is the maximum number of data lists that I can get?

GetAxieBriefList Operation

I was trying to filter axies using this operation, however, the size is limited to 100 even after i tried to input a size more than 100, is there any way to query a larger size?

Pagination issue

Hi, using the following query/body on postman I can fetch 100 axies ordered by id starting from the n'th, this seems to work perfectly for smaller values, and "total" shows over 10 million items, but for some reason after the 10k mark I start seeing an empty result, is this a bug or am I missing something ?

method: POST
query: https://graphql-gateway.axieinfinity.com/graphql
body (raw, json):
{ "operationName": "GetAxieBriefList", "variables": { "from": n, "size": 100, "sort": "IdAsc", "auctionType": "All" }, "query": "query GetAxieBriefList($auctionType: AuctionType, $criteria: AxieSearchCriteria, $from: Int, $sort: SortBy, $size: Int, $owner: String) {\n axies(auctionType: $auctionType, criteria: $criteria, from: $from, sort: $sort, size: $size, owner: $owner) {\n total\n results {\n ...AxieBrief\n }\n }\n}\n\nfragment AxieBrief on Axie {\n id\n name \n}\n" }

result for n === 10000:
{ "data": { "axies": { "total": 0, "results": [] } } }

SLP?

Can I get how much SLP I have in game?
With what Full GraphQL Query Schema?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.