Giter Club home page Giter Club logo

Comments (1)

muety avatar muety commented on May 29, 2024

Hi @SConaway, thanks for your feedback! I created #40 to to add structured API documentation in the near future.

Unfortunately, while /api/heartbeat is "compatible" with Wakatime's API, the response returned by /api/summary currently looks much different and misses a lot of information that is provided by Wakatime.

Requests like this:

curl -X GET \
  'https://localhost:8080/api/summary?interval=week' \
  -H 'Authorization: Basic GDQ2NDhkMTQtMTVjNS00PDJiLWI5MYEtZmJlZWM3MGQ7Y2FnCr==' 

The auth token in the headers is a Base64-encoded version of your API key, which you get when logging in to the web interface.

Will result in a response like this:

{
    "user_id": "n1try",
    "from": "2020-07-27T00:00:00+02:00",
    "to": "2020-07-29T00:00:00+02:00",
    "projects": [
        {
            "key": "lp-frontend",
            "total": 7756
        },
        {
            "key": "backup",
            "total": 1105
        },
        {
            "key": "web",
            "total": 499
        }
    ],
    "languages": [
        {
            "key": "Vue",
            "total": 5351
        },
        {
            "key": "TypeScript",
            "total": 2135
        },
        {
            "key": "Java",
            "total": 1080
        },
        {
            "key": "JSON",
            "total": 730
        },
        {
            "key": "unknown",
            "total": 405
        },
        {
            "key": "Markdown",
            "total": 139
        },
        {
            "key": "Go",
            "total": 120
        },
        {
            "key": "CSS",
            "total": 47
        },
        {
            "key": "Bash",
            "total": 21
        },
        {
            "key": "Text only",
            "total": 2
        },
        {
            "key": "XML",
            "total": 1
        },
        {
            "key": "YAML",
            "total": 0
        }
    ],
    "editors": [
        {
            "key": "VSCode",
            "total": 8427
        },
        {
            "key": "IntelliJ",
            "total": 1604
        }
    ],
    "operating_systems": [
        {
            "key": "Linux",
            "total": 10031
        }
    ]
}

(I manually removed a few project entries from the above output).

I hope that helps you.

Also, I'm really curious what kind of "Wakatime tools" you are building! 🙂

from wakapi.

Related Issues (20)

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.