[PYTHON] I tried to get various information from the codeforces API

Yes. http://codeforces.com/api/help

test.py


#!/usr/bin/python
# -*- coding: UTF-8 -*-

import urllib2
import json

#Go get the data
res=urllib2.urlopen('http://codeforces.com/api/user.info?handles=clarinet758')
#Be able to handle in json format
f=json.load(res)

example.json(Data example returned)


{
    u'status': u'OK',
    u'result': [
        {
            u'registrationTimeSeconds': 1339342427,
            u'rating': 1040,
            u'handle': u'clarinet758',
            u'country': u'Japan',
            u'rank': u'newbie',
            u'maxRank': u'specialist',
            u'lastOnlineTimeSeconds': 1403338836,
            u'contribution': -8,
            u'maxRating': 1414
        }
    ]
}

test.py


#If you simply want to display some data right now, you can output it with print.
#Current rating in this
print f[u'result'][u'rating']

#If the data is between Integers, you can subtract the difference.
#This will show the difference between the highest rating and the current rating.
print f[u'result'][u'maxRating'] - f[u'result'][u'rating']

Is it almost the same as the current personal data and information that can be seen in profile when you hit user.info?

If you hit user.ratedList, you may not have much use for personal use unless you have a purpose such as analyzing something such as user name and rating. References http://tubo028.hatenablog.jp/entry/2014/06/15/134848

Hit user.rating to record the participation in the contest. Probably similar to what you see in Contests on your personal profile. Data will not come out unless it is submitted not only for participation registration

Personal submision history in user.status. "verdict": "OK" is probably AC.

For now, I don't know the number of personally solved problem calls as shown at http://codeforces.com/problemset/standings. If you count OK, it seems that you will count the same problem as using a different language or rewriting it briefly, so I think that you should desperately devise and exclude it, or wait for the API addition release.

Recommended Posts

I tried to get various information from the codeforces API
[Python] I tried to get various information using YouTube Data API!
I tried to get the movie information of TMDb API with Python
I tried to get the location information of Odakyu Bus
I tried to touch the COTOHA API
I tried hitting the Qiita API from go
I tried to touch the API of ebay
I tried to summarize various sentences using the automatic summarization API "summpy"
I tried to detect the iris from the camera image
[Python] I tried to get the type name as a string from the type function
Python programming: I tried to get company information (crawling) from Yahoo Finance in the US using BeautifulSoup4
[First COTOHA API] I tried to summarize the old story
I tried to create Quip API
I tried the Naro novel API 2
I tried to notify the train delay information with LINE Notify
I tried to extract various information of remote PC from Python by WMI Library
I tried to get Web information using "Requests" and "lxml"
I want to get the operation information of yahoo route
I tried to touch Tesla's API
I tried to uniquely determine the malware name from the report information obtained from Virus Total
I tried changing the python script from 2.7.11 to 3.6.0 on windows10
I tried to move the ball
I tried using the checkio API
I tried to estimate the interval.
I tried to get data from AS / 400 quickly using pypyodbc
I tried to get the index of the list using the enumerate function
How to get followers and followers from python using the Mastodon API
I tried to get started with Bitcoin Systre on the weekend
I tried to cut out a still image from the video
I tried to solve the shift scheduling problem by various methods
I tried to get data from AS / 400 quickly using pypyodbc Preparation 1
PhytoMine-I tried to get the genetic information of plants with Python
I tried to summarize the umask command
I tried to recognize the wake word
I tried to get started with Hy
I tried using UnityCloudBuild API from Python
I tried to summarize the graphical modeling.
I tried to estimate the pi stochastically
I tried to make a Web API
I tried using the BigQuery Storage API
I want to get information from fstab at the ssh connection destination and execute a command
I tried to execute SQL from the local environment using Looker SDK
I tried to get the batting results of Hachinai using image processing
I tried calling the prediction API of the machine learning model from WordPress
I tried to extract characters from subtitles (OpenCV: Google Cloud Vision API)
I tried to learn the angle from sin and cos with chainer
I tried to get the RSS of the top song of the iTunes store automatically
Get the song name from the title of the video you tried to sing
I want to connect to PostgreSQL from various languages
I tried web scraping to analyze the lyrics.
I tried to optimize while drying the laundry
I tried to get an image by scraping
I tried to save the data with discord
I tried using the Google Cloud Vision API
I tried to get CloudWatch data with Python
I tried to correct the keystone of the image
Qiita Job I tried to analyze the job offer
LeetCode I tried to summarize the simple ones
I tried to implement the traveling salesman problem
I tried to predict the price of ETF
I tried to vectorize the lyrics of Hinatazaka46!