Skip to content
lingfeishengtian edited this page Mar 23, 2020 · 2 revisions

Welcome to SkyScrapeAPI

SkyScrapeAPI is an unofficial dart API for Skyward that allows you to retrieve grades, assignments, assignment info, old grades, messages from the district or teachers, and student info.

The packages depend on the following packages:

  • http: for accessing the interwebs
  • html: for parsing the html taken from the interwebs

Getting Started

The starting class of the library is SkyCore. This class contains one static method that allows you to create a User object which then you can perform more actions.

  • async Future login(String username, String pass, String url, {refreshTimes: 10, shouldRefreshWhenFailedLogin: true, ignoreExceptions: true});
    Login using the credentials of the user and URL of the district skyward by verifying credentials with the Skyward server and storing session variables. If the credentials given are invalid or the server is unavailable, an error will be thrown that the consumer will have to handle properly. If the user is a parent account, extra steps will be taken in order to retrieve children IDs, this process will take a little longer.
    • refreshTimes allows you to change how many times a method is allowed to try again before throwing an error. It is recommended to keep this at least 3. If an error occurs, SkyScrapeAPI will try to fix it itself. If it doesn't succeed, then it will try again, keep this at a limit so your program doesn't run into an infinite loop.
    • shouldRefreshWhenFailedLogin allows you to enable or disable the self-fixing feature described earlier.
    • ignoreExceptions will ignore errors that occur when SkyScrapeAPI tries to fix itself. This is automatically set to true to inform the consumer when an exception occurs and how the API fixed it.
      Returns a User object that contains and can perform Skyward actions.

Using the method login is extremely important. The returned type User cannot and should not be instantiated by itself. Make sure you store the returned User type in a variable

Skyward Actions

Here are some very useful functions you can use to retrieve things such as terms, grades, assignments, etc.

  • async Future getName();
    Retrieves the name of the user logged in. If you are a parent, this process will take a shorter time because the user was already initialized to retrieve children account IDs. However, it will take longer for Students because to save time, the initialize user method was never called.
    Returns the current user's name.

  • async Future<List> getMessages({timesRan = 0});
    Gets the teacher and district messages. This method takes a long time because it loops through every last message in the list to retrieve the next two messages. It is best if this method is called without await to let it run asynchronously. Do not waste your user's time on this one method.

    • timesRan allows you to restrict the amount of times this method is allowed to run. The method will stop when timesRan < refreshTimes. You can manually set this method, for example, to 7 (assuming refreshTimes is 10) to force the method to only run 3 times.
      Returns a list of Message
Clone this wiki locally