A NodeJS Replit API package wrapped around GraphQL, returning JSON data for easy use.

Overview

Documentation Status

repl-api.js

A NodeJS Replit API package wrapped around GraphQL, returning JSON data for easy use.

Contents:

About

The Replit API has always been changing and hard to keep up with. Due to this, many API's such as Ray's have been depreciated. However, our goal is to keep up with the API, and maintain repl-api.js. Replit's API allows lots of data to be accessed, and this is the objective for repl-api.js - to return data while keeping up with the latest updates of Replit. Queries available are:

  • User queries: General user data, user posts, user comments, etc.
  • Repl queries: General repl data, repl comments, etc.
  • Talk queries (otherwise known as Community): Top posts, new posts, etc.
  • And even more!

repl-api.js was developed in NodeJS, with only ESM imports available. It was also built using classes, making data easy to retrieve.

Quickstart

Pre-installation

In order to use repl-api.js, npm must be installed before using it:

npm install npm@latest -g

Installation

To install the package, use npm to install it:

npm install repl-api

Then, import it with the following code:

import Replapi from 'repl-api';

Finally, startup the package:

const replapi = Replapi();
const user = replapi.User("JBloves27");

Examples

Simple cycles data:

import Replapi from 'repl-api';

const replapi = Replapi();
const user = replapi.User("JBloves27");

let data = await user.userFull(true);

console.log(data.karma);

For more examples, go to the docs.

Usage

Now that we have everything ready, it's time to actually use the package! For example, for full user data, we can use the following code:

import Replapi from 'repl-api';

const replapi = Replapi();
const user = replapi.User("JBloves27");

let data = await user.userFull(true);

console.log(data);

The following code should output something like this:

{
  bio: 'full-stack nodejs dev | developing a package: https://github.com/kokonut27/repl-api.js/',
  displayName: 'koko/emerald',
  firstName: 'koko/emerald',
  fullName: 'koko/emerald',
  id: 3282411,
  image: 'https://storage.googleapis.com/replit/images/1651630189148_ec097c1c5fabeddb8b257d786e732cdb.jpeg',
  isHacker: false,
  isLoggedIn: false,
  isSubscribed: false,
  isVerified: true,
  karma: 2186,
  lastName: null,
  timeCreated: '2020-05-01T16:19:41.685Z',
  url: 'https://replit.com/@JBloves27',
  username: 'JBloves27',
  roles: [
    {
      id: '3282411:self_learner',
      name: 'self learner',
      key: 'SELF_LEARNER',
      tagline: null
    },
    {
      id: '3282411:explorer',
      name: 'explorer',
      key: 'EXPLORER',
      tagline: 'Helps test Replit beta features'
    }
  ],
  languages: [
    {
      id: 'python3',
      displayName: 'Python',
      key: 'python3',
      category: 'Practical',
      tagline: 'A dynamic language emphasizing readability.',
      icon: 'https://replit.com/public/images/languages/python.svg',
      isNew: false
    },
    {
      id: 'bash',
      displayName: 'Bash',
      key: 'bash',
      category: 'Practical',
      tagline: 'The classic Unix shell',
      icon: 'https://icons.util.repl.co/bash.svg',
      isNew: false
    },
    {
      id: 'html',
      displayName: 'HTML, CSS, JS',
      key: 'html',
      category: 'Web',
      tagline: 'The languages that make up the web.',
      ic: '/public/images/languages/web_project.svg',
          isNew: false
    },
    {
      id: 'nodejs',
      displayName: 'Node.js',
      key: 'nodejs',
      category: 'Practical',
      tagline: 'Evented I/O for V8 JavaScript.',
      icon: 'https://replit.com/public/images/languages/nodejs.svg',
      isNew: false
    },
    {
      id: 'nix',
      displayName: 'Nix (beta)',
      key: 'nix',
      category: 'Practical',
      tagline: 'A base repl for building anything you want in any language.',
      icon: 'https://icons.util.repl.co/bash.svg',
      isNew: false
    },
    {
      id: 'cpp',
      displayName: 'C++',
      key: 'cpp',
      category: 'Practical',
      tagline: 'A general purpose system programming language.',
      icon: 'https://replit.com/public/images/languages/cpp.svg',
      isNew: false
    },
    {
      id: 'swift',
      displayName: 'Swift',
      key: 'swift',
      category: 'Practical',
      tagline: 'A modern general-purpose programming language from Apple.',
      icon: 'https://replit.com/public/images/languages/swift.svg',
      isNew: false
    },
    {
      id: 'c',
      displayName: 'C',
      key: 'c',
      category: 'Practical',
      tagline: 'Low-level and cross-platform imperative language.',
      icon: 'https://replit.com/public/images/languages/c.svg',
      isNew: false
    },
    {
      id: 'scheme',
      displayName: 'Scheme',
      key: 'scheme',
      category: 'Practical',
      tagline: 'An elegant dynamic dialect of Lisp.',
      icon: '/public/images/languages/scheme.svg',
      isNew: false
    },
    {
      id: 'java10',
      displayName: 'Java',
      key: 'java10',
      category: 'Practical',
      tagline: 'A concurrent, class-based, statically typed object-oriented language.',
      icon: 'https://replit.com/public/images/languages/java.svg',
      isNew: false
    }
  ]
}

Find more API functions here.

Contributing

Either leave a Pull Request, an Issue, or contact me at here.

License

MIT

Changelog

View more of the specifics at repl-api.js/releases.

0.0.0

Initial Commit: currently holds basic User constructor functions and is expected to have many bugs.

  • Partially finished User constructor
  • Base setup functions
  • Fully working data retriever (thanks to darkdarcool)
You might also like...

✏️ A small jQuery extension to turn a static HTML table into an editable one. For quickly populating a small table with JSON data, letting the user modify it with validation, and then getting JSON data back out.

jquery-editable-table A small jQuery extension to turn an HTML table editable for fast data entry and validation Demo 👉 https://jsfiddle.net/torrobin

Jul 31, 2022

Api for playing around with dummy data. Feel free to use it in your demo projects, tutorials, or testing tasks.

dummy-api Api similar to dummy-api Api for playing around with dummy data. Feel free to use it in your demo projects, tutorials, or testing tasks. All

Jan 7, 2023

JCS (JSON Canonicalization Scheme), JSON digests, and JSON Merkle hashes

JSON Hash This package contains the following JSON utilties for Deno: digest.ts provides cryptographic hash digests of JSON trees. It guarantee that d

Sep 2, 2022

A high-resolution local database that uses precise algorithms to easily record data in local files within a project with persistent JSON and YAML support designed to be easy to set up and use

A high-resolution local database that uses precise algorithms to easily record data in local files within a project with persistent JSON and YAML support designed to be easy to set up and use

About A high-resolution local database that uses precise algorithms to easily record data in local files within a project with persistent JSON and YML

Dec 28, 2022

Multi-platform node package bundle to a package.json.

dmpc Multi-platform node package bundle to a package.json. install ### npm mode npm i -g @kingsword/dmpc ### yarn mode yarn global add @kingsword/dmp

Oct 16, 2022

next-graphql-server is a library for building production-grade GraphQL servers using Next.js with API Routes

next-graphql-server next-graphql-server is an easy to use Next.js library for creating performant GraphQL endpoints on top of Next.js API Routes. Star

Nov 21, 2022

Pretty-print-json - 🦋 Pretty-print JSON data into HTML to indent and colorize (written in TypeScript)

Pretty-print-json - 🦋 Pretty-print JSON data into HTML to indent and colorize (written in TypeScript)

pretty-print-json Pretty-print JSON data into HTML to indent and colorize (written in TypeScript) 1) Try It Out Interactive online tool to format JSON

Dec 30, 2022

This package generates a GraphQL API from a directory of Markdown files

This package generates a GraphQL API from a directory of Markdown files. Additional metadata like tags, descriptions, or custom fields can be added to the Markdown files in the form of YAML front matter, a simple schema at the top of each file. These fields will be indexed and available to query and filter by in the GraphQL API.

Dec 29, 2022

A simple nodejs module which is wrapper around solc that allows you to compile Solidity code

A simple nodejs module which is wrapper around solc that allows you to compile Solidity code

Simple Solidity Compiler It's a simple nodejs module which is wrapper around solc that allows you to compile Solidity code and get the abi and bytecod

Feb 21, 2022
Comments
  • chore(deps-dev): bump jest from 28.1.3 to 29.0.0

    chore(deps-dev): bump jest from 28.1.3 to 29.0.0

    Bumps jest from 28.1.3 to 29.0.0.

    Release notes

    Sourced from jest's releases.

    v29.0.0

    Blog post: https://jestjs.io/blog/2022/08/25/jest-29

    Features

    • [expect] [BREAKING] Differentiate between MatcherContext MatcherUtils and MatcherState types (#13141)
    • [jest-circus] Add support for test.failing.each (#13142)
    • [jest-config] [BREAKING] Make snapshotFormat default to escapeString: false and printBasicPrototype: false (#13036)
    • [jest-config] [BREAKING] Remove undocumented collectCoverageOnlyFrom option (#13156)
    • [jest-environment-jsdom] [BREAKING] Upgrade to jsdom@20 (#13037, #13058)
    • [@jest/globals] Add jest.Mocked, jest.MockedClass, jest.MockedFunction and jest.MockedObject utility types (#12727)
    • [jest-mock] [BREAKING] Refactor Mocked* utility types. MaybeMockedDeep and MaybeMocked became Mocked and MockedShallow respectively; only deep mocked variants of MockedClass, MockedFunction and MockedObject are exported (#13123, #13124)
    • [jest-mock] [BREAKING] Change the default jest.mocked helper’s behavior to deep mocked (#13125)
    • [jest-snapshot] [BREAKING] Let babel find config when updating inline snapshots (#13150)
    • [@jest/test-result, @jest/types] [BREAKING] Replace Bytes and Milliseconds types with number (#13155)
    • [jest-worker] Adds workerIdleMemoryLimit option which is used as a check for worker memory leaks >= Node 16.11.0 and recycles child workers as required (#13056, #13105, #13106, #13107)
    • [pretty-format] [BREAKING] Remove ConvertAnsi plugin in favour of jest-serializer-ansi-escapes (#13040)
    • [pretty-format] Allow to opt out from sorting object keys with compareKeys: null (#12443)

    Fixes

    • [jest-config] Fix testing multiple projects with TypeScript config files (#13099)
    • [@jest/expect-utils] Fix deep equality of ImmutableJS Record (#13055)
    • [jest-haste-map] Increase the maximum possible file size that jest-haste-map can handle (#13094)
    • [jest-runtime] Properly support CJS re-exports from dual packages (#13170)
    • [jest-snapshot] Make prettierPath optional in SnapshotState (#13149)
    • [jest-snapshot] Fix parsing error from inline snapshot files with JSX (#12760)
    • [jest-worker] When a process runs out of memory worker exits correctly and doesn't spin indefinitely (#13054)

    Chore & Maintenance

    • [*] [BREAKING] Drop support for Node v12 and v17 (#13033)
    • [docs] Fix webpack name (#13049)
    • [docs] Explicit how to set n for --bail (#13128)
    • [docs] Update Enzyme URL (#13166)
    • [jest-leak-detector] Remove support for weak-napi (#13035)
    • [jest-snapshot] [BREAKING] Require rootDir as argument to SnapshotState (#13150)

    New Contributors

    ... (truncated)

    Changelog

    Sourced from jest's changelog.

    29.0.0

    Features

    • [expect] [BREAKING] Differentiate between MatcherContext MatcherUtils and MatcherState types (#13141)
    • [jest-circus] Add support for test.failing.each (#13142)
    • [jest-config] [BREAKING] Make snapshotFormat default to escapeString: false and printBasicPrototype: false (#13036)
    • [jest-config] [BREAKING] Remove undocumented collectCoverageOnlyFrom option (#13156)
    • [jest-environment-jsdom] [BREAKING] Upgrade to jsdom@20 (#13037, #13058)
    • [@jest/globals] Add jest.Mocked, jest.MockedClass, jest.MockedFunction and jest.MockedObject utility types (#12727)
    • [jest-mock] [BREAKING] Refactor Mocked* utility types. MaybeMockedDeep and MaybeMocked became Mocked and MockedShallow respectively; only deep mocked variants of MockedClass, MockedFunction and MockedObject are exported (#13123, #13124)
    • [jest-mock] [BREAKING] Change the default jest.mocked helper’s behavior to deep mocked (#13125)
    • [jest-snapshot] [BREAKING] Let babel find config when updating inline snapshots (#13150)
    • [@jest/test-result, @jest/types] [BREAKING] Replace Bytes and Milliseconds types with number (#13155)
    • [jest-worker] Adds workerIdleMemoryLimit option which is used as a check for worker memory leaks >= Node 16.11.0 and recycles child workers as required (#13056, #13105, #13106, #13107)
    • [pretty-format] [BREAKING] Remove ConvertAnsi plugin in favour of jest-serializer-ansi-escapes (#13040)
    • [pretty-format] Allow to opt out from sorting object keys with compareKeys: null (#12443)

    Fixes

    • [jest-config] Fix testing multiple projects with TypeScript config files (#13099)
    • [@jest/expect-utils] Fix deep equality of ImmutableJS Record (#13055)
    • [jest-haste-map] Increase the maximum possible file size that jest-haste-map can handle (#13094)
    • [jest-runtime] Properly support CJS re-exports from dual packages (#13170)
    • [jest-snapshot] Make prettierPath optional in SnapshotState (#13149)
    • [jest-snapshot] Fix parsing error from inline snapshot files with JSX (#12760)
    • [jest-worker] When a process runs out of memory worker exits correctly and doesn't spin indefinitely (#13054)

    Chore & Maintenance

    • [*] [BREAKING] Drop support for Node v12 and v17 (#13033)
    • [docs] Fix webpack name (#13049)
    • [docs] Explicit how to set n for --bail (#13128)
    • [docs] Update Enzyme URL (#13166)
    • [jest-leak-detector] Remove support for weak-napi (#13035)
    • [jest-snapshot] [BREAKING] Require rootDir as argument to SnapshotState (#13150)
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • chore(deps): bump node-fetch from 3.2.3 to 3.2.4

    chore(deps): bump node-fetch from 3.2.3 to 3.2.4

    Bumps node-fetch from 3.2.3 to 3.2.4.

    Release notes

    Sourced from node-fetch's releases.

    v3.2.4

    3.2.4 (2022-04-28)

    Bug Fixes

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • chore(deps): bump node-libcurl from 2.3.4 to 3.0.0

    chore(deps): bump node-libcurl from 2.3.4 to 3.0.0

    Bumps node-libcurl from 2.3.4 to 3.0.0.

    Release notes

    Sourced from node-libcurl's releases.

    v3.0.0

    Breaking Change

    • The supported engines of Node.js were bumped to: ^14.14 || >=16.
    • The supported versions of Electron now are: v21, v20, v19, v18, and v17.
    • The node-gyp package has been bumped, which means Python 3.0 is now required to build from source.
    • Minimum c++ version your compiler needs to support is now c++17.
    • The minimum macOS version is now Big Sur (11.6)
    • The prebuilt binaries on glibc Linux are now built on Ubuntu 20.04.
    • The prebuilt binaries on musl Linux (Alpine) are now built on Alpine 3.16.
    • The prebuilt binaries on Windows are now built with Visual Studio 2019.
    • There are no prebuilt binaries for NW.js anymore. This is because nw-gyp does not support Python 3 currently.
    • Option types for CURLOPT_FTP_RESPONSE_TIMEOUT has been removed, since libcurl 7.20 it was the same as CURLOPT_SERVER_RESPONSE_TIMEOUT.

    Added

    Changed

    • Upgraded prebuild binaries to use libcurl 7.86.0. On Windows, OpenSSL 3.0.7 will be used.

    https://github.com/JCMais/node-libcurl/compare/v2.3.4...v3.0.0

    v3.0.0-0

    No release notes provided.

    Changelog

    Sourced from node-libcurl's changelog.

    [3.0.0] - 2022-11-17

    Breaking Change

    • The supported engines of Node.js were bumped to: ^14.14 || >=16.
    • The supported versions of Electron now are: v21, v20, v19, v18, and v17.
    • The node-gyp package has been bumped, which means Python 3.0 is now required to build from source.
    • Minimum c++ version your compiler needs to support is now c++17.
    • The minimum macOS version is now Big Sur (11.6)
    • The prebuilt binaries on glibc Linux are now built on Ubuntu 20.04.
    • The prebuilt binaries on musl Linux (Alpine) are now built on Alpine 3.16.
    • The prebuilt binaries on Windows are now built with Visual Studio 2019.
    • There are no prebuilt binaries for NW.js anymore. This is because nw-gyp does not support Python 3 currently.
    • Option types for CURLOPT_FTP_RESPONSE_TIMEOUT has been removed, since libcurl 7.20 it was the same as CURLOPT_SERVER_RESPONSE_TIMEOUT.

    Added

    Changed

    • Upgraded prebuild binaries to use libcurl 7.86.0. On Windows, OpenSSL 3.0.7 will be used.
    Commits
    • ec5c0e8 v3.0.0
    • f2d764d docs: fix changelog [skip ci]
    • 51379dc docs: fix changelog [skip ci]
    • 470dca5 v3.0.0-0
    • 0d3533f chore: bump np package
    • d02a3fe docs: update changelog
    • 203d48c build: use libcurl 7.86.0 on Windows
    • e7fa0da ci: build against openssl v3.0.7
    • 57806b2 chore: bump deps/curl-for-windows to 7.86.0
    • a043b80 docs: update changelog with the options that were added
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
Releases(0.0.0)
  • 0.0.0(May 27, 2022)

    Contents:

    Initial Commit: currently holds basic User constructor functions, Community, Post, and Repls - and is expected to have many bugs.

    • Finished base User constructor
    • Finished base Community constructor
    • Partially finished Post constructor
    • Partially finished Repls constructor
    • Base setup functions
    • Fully working data retriever (thanks to darkdarcool)

    What's Changed

    • chore(deps): bump node-fetch from 3.2.3 to 3.2.4 by @dependabot in https://github.com/kokonut27/repl-api.js/pull/2
    • Added what JB couldn't by @darkdarcool in https://github.com/kokonut27/repl-api.js/pull/3

    New Contributors

    • @dependabot made their first contribution in https://github.com/kokonut27/repl-api.js/pull/2
    • @darkdarcool made their first contribution in https://github.com/kokonut27/repl-api.js/pull/3

    Full Changelog: https://github.com/kokonut27/repl-api.js/commits/0.0.0

    Source code(tar.gz)
    Source code(zip)
Owner
kokonut
Full-stack developer who loves anime and semi-colons :P
kokonut
An abstraction layer on top of @replit/crosis that makes Repl connection management and operations so easy, a Furret could do it! 🎉

Crosis4Furrets An abstraction layer on top of @replit/crosis that makes Repl connection management and operations so easy, a Furret could do it! ?? In

Ray 18 Dec 29, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
JSON Visio is data visualization tool for your json data which seamlessly illustrates your data on graphs without having to restructure anything, paste directly or import file.

JSON Visio is data visualization tool for your json data which seamlessly illustrates your data on graphs without having to restructure anything, paste directly or import file.

Aykut Saraç 20.6k Jan 4, 2023
Debounce promise-returning & async functions.

perfect-debounce An improved debounce function with Promise support. Well tested debounce implementation Native Promise support Avoid duplicate calls

unjs 55 Jan 2, 2023
This is an IFC wrapped on Three js based viewer, I think..

ifc-three-js-viewer Project description: This is an IFC wrapped on Three js based viewer, I think.. Features & Screenshots: A simple viewer for render

Oussama Bonnor 4 Dec 14, 2022
Deploy a local project to Replit, in seconds!

mvrepl A tool to deploy a local project to replit, in seconds! Requirements: latest version of Node.js (https://nodejs.org/) latest version of npm (ht

grr 5 Jun 18, 2022
Authenticate your Replit Users without ReplAuth.

Replit Login An unofficial way to authenticate your Replit users Authenticate Replit users in your projects without ReplAuth. This uses the actual Rep

Ray 8 Aug 11, 2022
A community-led token scanner for Replit utilizing its own APIs.

Replit Token Scanner A community-led project that aims to scan published Repls to find secrets and invalidate them. Usage This repo contains the scann

Ray 18 Nov 6, 2022