{"id":18464626,"url":"https://github.com/moebits/deviantart.ts","last_synced_at":"2025-06-26T10:03:02.663Z","repository":{"id":35201572,"uuid":"215583549","full_name":"Moebits/deviantart.ts","owner":"Moebits","description":"Wrapper for DeviantArt API with typings","archived":false,"fork":false,"pushed_at":"2024-08-09T03:31:46.000Z","size":7730,"stargazers_count":6,"open_issues_count":18,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-08T08:44:53.935Z","etag":null,"topics":["deviantart","hacktoberfest","wrapper"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Moebits.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-16T15:34:22.000Z","updated_at":"2024-10-22T23:50:34.000Z","dependencies_parsed_at":"2024-08-08T23:21:00.238Z","dependency_job_id":null,"html_url":"https://github.com/Moebits/deviantart.ts","commit_stats":{"total_commits":58,"total_committers":2,"mean_commits":29.0,"dds":"0.12068965517241381","last_synced_commit":"1fbc03952f18c8dcb7479bb7fc3d75c8c50e14e5"},"previous_names":["moebits/deviantart.ts"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Moebits/deviantart.ts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moebits%2Fdeviantart.ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moebits%2Fdeviantart.ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moebits%2Fdeviantart.ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moebits%2Fdeviantart.ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Moebits","download_url":"https://codeload.github.com/Moebits/deviantart.ts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moebits%2Fdeviantart.ts/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262044399,"owners_count":23249745,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deviantart","hacktoberfest","wrapper"],"created_at":"2024-11-06T09:10:33.937Z","updated_at":"2025-06-26T10:03:02.644Z","avatar_url":"https://github.com/Moebits.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"left\"\u003e\n  \u003cp\u003e\n    \u003ca href=\"https://moebits.github.io/deviantart.ts/\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/Moebits/deviantart.ts/master/images/deviantart.tslogo.gif\" width=\"500\" /\u003e\u003c/a\u003e\n  \u003c/p\u003e\n  \u003cp\u003e\n    \u003ca href=\"https://nodei.co/npm/deviantart.ts/\"\u003e\u003cimg src=\"https://nodei.co/npm/deviantart.ts.png\" /\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n### About\nThis is a wrapper for the DeviantArt API that covers all of the public endpoints, includes typings, and various utility functions to make finding deviations easier. \n\n### Insall\n```ts\nnpm install deviantart.ts\n```\n\n### Getting Started\nRegister an app at [**DeviantArt Developers**](https://www.deviantart.com/developers/) in order to receive a **client id** and a **client secret**. You will need these credentials in order to receive an **access token** from the DeviantArt API. Read the official api [**documentation**](https://www.deviantart.com/developers/http/v1/20160316) for information on all of the endpoints, the parameters that they take, and the responses that they send. This library only covers the client credentials endpoints.\n\n### Useful Links\n\n- [**Official DeviantArt Documentation**](https://www.deviantart.com/developers/http/v1/20160316)\n- [**DeviantArt.ts Documentation**](https://moebits.github.io/deviantart.ts/)\n\n#### Searching for Deviations\n```ts\nimport DeviantArt from \"deviantart.ts\"\n\nasync function useAPI() {\n    /*Since all API calls return a Promise, we must instantiate the class using an asynchronous method. Don't use\n    the constructor, all of the properties will be undefined!*/\n    const deviantArt = await DeviantArt.login(process.env.DEVIANTART_CLIENT_ID, process.env.DEVIANTART_CLIENT_SECRET)\n\n    /*It is much, much faster to use the RSS API.\n    This gets a single deviation by URL or by query.*/\n    const deviation = await deviantArt.rss.get(\"https://www.deviantart.com/fhilippe124/art/Sagiri-Izumi-Eromanga-sensei-fanart-678288299\")\n\n    /*To search for multiple, use search instead. The second parameter is \n    the limit, the third is the sort method (\"popular\" or \"newest\").*/\n    const deviations = await deviantArt.rss.search(\"Eromanga Sensei\", 50, \"popular\")\n\n    /*The painfully slow alternative using the regular API is to \n    iterate through all of a user's deviations to find the one that matches the URL.\n    But you can only get the deviation id through the api, so use this instead if you need it.*/\n    const verySlow = await deviantArt.findByIteration(\"https://www.deviantart.com/fhilippe124/art/Yamada-Elf-Eromanga-sensei-fanart-678701561\")\n\n    /*The browse endpoint offers searches for popular, newest, hot, undiscovered, etc. deviations.*/\n    const popular = await deviantArt.browse.popular({q: \"anime\"})\n    const hot = await deviantArt.browse.hot({category_path: \"manga\"})\n    //The date is in yyyy-mm-dd format!\n    const daily = await deviantArt.browse.daily({date: 2019-07-03})\n    const tag = await deviantArt.browse.tag({tag: \"cute\"})\n    const undiscovered = await deviantArt.browse.undiscovered({mature_content: true})\n\n    /*In order to use the deviation endpoint, you must \n    have the deviation id. In this case, findByIteration()\n    is very useful.*/\n    const deviationByID = await deviantArt.deviation.get({deviationid: \"1FA35A6D-E2CD-3CDF-1A65-410AB577BF10\"})\n\n    /*The moreLikeThis endpoint takes a deviationid (which is called a seed in the api for some reason).*/\n    const moreLikeThis = await deviantArt.browse.moreLikeThis({seed: \"1FA35A6D-E2CD-3CDF-1A65-410AB577BF10\"})\n\n}\nuseAPI()\n```\n#### Searching for Users and Folders\n```ts\nasync function useAPI() {\n    /*Search for a user's profile*/\n    const user = await deviantArt.user.get({username: \"myname\"})\n\n    /*Get all of a user's deviations.*/\n    const userDeviations = await deviantArt.gallery.all({username: \"myname\"})\n\n    /*Get all of their statuses*/\n    const statuses = await deviantArt.user.statuses({username: \"myname\"})\n\n    /*Get all of their profile comments*/\n    const profileComments = await deviantArt.comments.profile({username: \"myname\"})\n\n    /*Get all of a user's folders*/\n    const folders = await deviantArt.collections.folders({username: \"fhilippe124\"})\n\n    /*Get all deviations in the folder. You must have the folder id, which you can get from the api call above.\n    The username parameter is only optional if you are searching your own folders.*/\n    const folderDeviations = await deviantArt.collections.get({folderid: \"79216EF7-CED7-6973-DD90-6793348AD2A4\", username: \"fhilippe124\"})\n}\n```\n#### Searching for Comments and Tags\n```ts\nasync function useAPI() {\n    /*Note that the deviation id is required for this endpoint.*/\n    const comments = await deviantArt.comments.deviation({deviationid: \"1FA35A6D-E2CD-3CDF-1A65-410AB577BF10\"})\n\n    /*To get sibling comments, you must have the comment id, which you can get from the api call above.*/\n    const userDeviations = await deviantArt.comments.siblings({commentid: \"FE5A83B8-0495-9E1D-3A54-864D943D579C\"})\n\n    /*To search for tags, you can use the browse endpoint.*/\n    const tagSearch = await deviantArt.browse.tagSearch({tag_name: \"kawaii\"})\n}\n```\n#### Other endpoints and parameters\nThere are many more less commonly used endpoints such as **Curated**, **Stash**, and **Data**. For a more complete documentation please read the [**api documentation**](https://www.deviantart.com/developers/http/v1/20160316) on DeviantArt.\n##### Common Parameters:\n- `mature_content` - set to true to include mature results.\n- `expand` - Expands the response objects, such as including `user.details` in a `DeviantArtUser` object. You may need to use type assertions if you use.\n- `offset` - Returns results starting from the offset\n- `limit` - Returns a certain amount of results\n- `deviationid` - The deviation id. All id's look like: `1FA35A6D-E2CD-3CDF-1A65-410AB577BF10`.\n- `userid` - The user id. \n- `commentid` - The comment id. \n- `folderid` - The folder id.\n- `statusid` - The status id.\n- `category_path` - The category path to search.\n- `q` - The query to search.\n- `timerange` - Timerange to search Ex. `(8hr, 5days, 2weeks, alltime)`\n- `date` - The date in `yyyy-mm-dd` format\n\n#### Common Types\n\u003cdetails\u003e\n\u003csummary\u003eDeviantArtDeviation\u003c/summary\u003e\n    \n```ts\nexport interface DeviantArtDeviation {\n    deviationid: string\n    printid: string | null\n    url?: string\n    title?: string\n    category?: string\n    category_path?: string\n    is_favourited?: boolean\n    is_deleted?: boolean\n    author?: DeviantArtUser\n    stats?: {\n        comments: number\n        favourites: number\n    }\n    published_time?: string\n    allows_comments?: boolean\n    preview?: {\n        src: string\n        height: number\n        width: number\n        transparency: boolean\n    }\n    content?: {\n        src: string\n        height: number\n        width: number\n        transparency: boolean\n        filesize: number\n    }\n    thumbs?: Array\u003c{\n        src: string\n        height: number\n        width: number\n        transparency: boolean\n    }\u003e\n    videos?: Array\u003c{\n        src: string\n        quality: string\n        filesize: number\n        duration: number\n    }\u003e\n    flash?: {\n        src: string\n        height: number\n        width: number\n    }\n    daily_deviation?: {\n        body: string\n        time: string\n        giver: DeviantArtUser\n        suggester?: DeviantArtUser\n    }\n    excerpt?: string\n    is_mature?: boolean\n    is_downloadable?: boolean\n    download_filesize?: number\n    challenge?: {\n        type: string[]\n        completed: boolean\n        tags: string[]\n        locked?: boolean\n        credit_deviation: string | null\n        media: string[]\n        level_label?: string\n        time_limit?: number\n        levels?: string[]\n    }\n    challenge_entry?: {\n        challengeid: string\n        challenge_title: string\n        challenge?: DeviantArtDeviation\n        timed_duration: number\n        submission_time: string\n    }\n    motion_book?: {\n        embed_url: string\n    }\n}\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eDeviantArtUser\u003c/summary\u003e\n    \n```ts\nexport interface DeviantArtUser {\n    userid: string\n    username: string\n    usericon: string\n    type: string\n    is_watching?: boolean\n    details?: {\n        sex: string | null\n        age: number | null\n        joinDate: string\n    }\n    geo?: {\n        country: string\n        countryid: number\n        timezone: string\n    }\n    profile?: {\n        user_is_artist: boolean\n        artist_level: string | null\n        artist_specialty: string | null\n        real_name: string\n        tagline: string\n        website: string\n        cover_photo: string\n        profile_pic: DeviantArtDeviation\n    }\n    stats?: {\n        watchers: number\n        friends: number\n    }\n}\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eDeviantArtUserProfile\u003c/summary\u003e\n\n```ts\nexport interface DeviantArtUserProfile {\n    user: DeviantArtUser\n    is_watching: boolean\n    profile_url: string\n    user_is_artist: boolean\n    artist_level: string | null\n    artist_specialty: string | null\n    real_name: string\n    tagline: string\n    countryid: number\n    country: string\n    website: string\n    bio: string\n    cover_photo: string | null\n    profile_pic: DeviantArtDeviation | null\n    last_status: DeviantArtStatus | null\n    stats: {\n        user_deviations: number\n        user_favourites: number\n        user_comments: number\n        profile_pageviews: number\n        profile_comments: number\n    }\n    collections?: Array\u003c{\n        folderid: string\n        name: string\n    }\u003e\n    galleries?: Array\u003c{\n        folderid: string\n        parent: string | null\n        name: string\n    }\u003e\n}\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eDeviantArtComment\u003c/summary\u003e\n    \n```ts\nexport interface DeviantArtComment {\n    commentid: string\n    parentid: string | null\n    posted: string\n    replies: number\n    hidden: string | null\n    body: string\n    user: DeviantArtUser\n}\n```\n\u003c/details\u003e\n\n#### Extending Deviations\nThe API Deviation object and the RSS Deviation object are missing a couple properties from each other, \nmost notably the deviation description and the author's profile info respectively. There are some extending\nfunctions that will extend the objects to add these missing properties.\n```ts\nasync function useAPI() {\n    const deviation = await deviantArt.deviation.get({deviationid: \"1FA35A6D-E2CD-3CDF-1A65-410AB577BF10\"})\n    /*Takes an array of DeviantArtDeviation objects*/\n    const extendedAPIDeviations = await deviantArt.extendDeviations([deviation])\n    //It now has a description!\n    extendedAPIDeviations[0].description\n\n    const deviationsRSS = await deviantArt.rss.search(\"anime\", 10, \"popular\")\n    const extendedRSSDeviations = await deviantArt.extendRSSDeviations(deviationsRSS)\n    //It now has the author's profile info, such as profile picture and cover photo!\n    extendedRSSDeviations[0].author.profile_pic\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoebits%2Fdeviantart.ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoebits%2Fdeviantart.ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoebits%2Fdeviantart.ts/lists"}