Comments (2)
How To Contribute - Summary
Here's the "how to" guide to adding the endpoints YOU want (because those are the best
https://github.com/jermbo/SampleAPIs/blob/main/CONTRIBUTING.md#example-of-adding-a-new-endpoint
Example of adding a new Endpoint
Our project is all about great data to play with! And I know of no one better than YOU (yes YOU) that knows what data YOU WOULD like to play with.
In this section we'll learn how to add a new dataset (or "endpoint" as we'll call them)
Each endpoint needs three files. Here's a example of a new PR adding just a new endpoint
Adding an Endpoint
Here are the official steps to add an endpoint
- Create a
endpointName.json
file- eg. baseball.json for
sampleapis.com/baseball/api
- The first level keys in the object becoming a "collection" of data. For example
homeruns
orstolen-bases
. - These will translate to
.com/baseball/api/homeruns/ or
.com/baseball/api/stolen-bases`
- eg. baseball.json for
- Create a backup
endpointName.json.backup
file.- This will be used as the basis for when the system resets.
- Update the
src/apiList.js
export array.- This will include your new endpoint in the list on the home page.
Updating the apiList.js
There is a specific format necessary to populate the home page list. Take a look at the example below and update to match your new information.
// example from the RickAndMorty endpoint
{
id: 22, ⬅ //use a new ID
title: "Rick And Morty", ⬅ //Title on top of page
longDesc: "This is t...", ⬅ //Description on the endpoint's page
desc: "AP", ⬅ // description for front page
link: "rickandmorty", ⬅ // endpoint url
graphLink: "rickandmorty/graphql", // graphql endpoint
endPoints: ["characters","episodes","locations"], ⬅ // All collections (or properties) in the endpoint from the endpointName.json file
}
from sampleapis.
Hey @jermbo I was wondering if you could forward me that article you were going off of in todays zoom about web scraping the data of a wiki page with chrome dev tools? It all happened so fast I couldn't screenshot the commands. I definitely want to add my own endpoint and will be working on this tomorrow.
All the best,
Jeremy
from sampleapis.
Related Issues (20)
- API Data Reset
- Docs - What is REST HOT 4
- Docs - What is GraphQL HOT 3
- Docs - How APIs Work HOT 5
- Ensure API list is dynamically generated
- Update Contribution Documents
- Certificate has expired HOT 2
- New Coffees HOT 1
- Site down HOT 4
- Wrong data API coffee HOT 3
- API response includes errant name and rating avg values HOT 1
- website is having issues HOT 1
- APIs are returning 429 "Too many requests" error HOT 2
- Website is having issues HOT 3
- Inappropriate image URL in beers API HOT 1
- Fix API 502 Bad Gateway HOT 2
- API List > Categories HOT 1
- 502 when hitting api.sampleapis.com HOT 1
- Presidents API image for John Adams is outdated and missing HOT 2
- documentation on use of parameter queries incorrect
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sampleapis.