Giter Site home page Giter Site logo

fakeinfo's Introduction

Fakeinfo API

This is a Python API built with Flask that provides fake information for testing and development purposes. It offers endpoints to retrieve and manipulate fake posts, comments, users, jobs, and generate image placeholders.

Options

There are two options, you can install this project and run it locally, or access the online API at FakeInfo. Docs on how to use it will be found there. If you want to run it locally, you can continue to the installation and usage guides.

Installation

  1. Clone the repository:

    git clone https://github.com/1Mr-Newton/fakeinfo.git
  2. Change to the project directory:

    cd fakeinfo
  3. Install the required dependencies:

    pip install -r requirements.txt

Usage

To start the API, run the following command:

python app.py

The API will start running on http://localhost:5000/.

Endpoints

Home

  • GET /api
  • GET /api/v1

Returns a welcome message and the status of the API.

Posts

  • GET /api/v1/posts
  • GET /api/v1/posts/paginate
  • GET /api/v1/post/<int:id>

Retrieves posts, paginated posts, or a single post by its ID.

Comments

  • GET /api/v1/comments
  • GET /api/v1/comments/paginate
  • GET /api/v1/comment/<int:id>

Retrieves comments, paginated comments, or a single comment by its ID.

Users

  • GET /api/v1/users
  • GET /api/v1/users/paginate
  • GET /api/v1/user/<int:id>

Retrieves users, paginated users, or a single user by their ID.

Jobs

  • GET /api/v1/jobs
  • GET /api/v1/jobs/paginate
  • GET /api/v1/job/<int:id>

Retrieves jobs, paginated jobs, or a single job by its ID.

Image Placeholder

  • GET /api/v1/imageplaceholder

Generates a placeholder image with 400x200 dimensions.

  • GET /api/v1/imageplaceholder?width=<width>&height=<height>

Generates a placeholder image with specified dimensions. Default: 400x200

Error Handling

If any error occurs during the API request processing, a JSON response with the following structure will be returned:

{
  "status": "failed",
  "message": "Error message"
}

The error message will provide details about the encountered issue.

Contributing

Contributions to the Fakeinfo API are welcome! If you find a bug or have a suggestion, please open an issue or submit a pull request.

Disclaimer

This API is intended for testing and development purposes only. The data provided is randomly generated and should not be used for any real-world scenarios.

License

The Fakeinfo API is released under the MIT License. Feel free to modify and use it as needed.

fakeinfo's People

Contributors

1mr-newton avatar

Watchers

 avatar

Forkers

kawsar992

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.