# FigShare's API

**URL:** https://discourse.julialang.org/t/figshares-api/81987
**Category:** Data
**Tags:** api
**Created:** [May 31, 2022, 1:02pm UTC](https://discourse.julialang.org/t/figshares-api/81987 "2022-05-31T13:02:04Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)
#### Post date: [May 31, 2022, 1:02pm UTC](https://discourse.julialang.org/t/figshares-api/81987/1 "2022-05-31T13:02:05Z")

</div>

Depending on how easy it is, I would like to programmatically upload data to FigShare using their API. They have a Jupyter notebook showing how to do so [here](https://colab.research.google.com/drive/13CAM8mL1u7ZsqNhfZLv7bNb1rdhMI64d?usp=sharing). It looks like they stream the data in chunks.

Has anyone tried this or similar before…?

---

<div class="post-metadata">

### Author: ![quinnj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/quinnj/32/11_2.png) [@quinnj](https://discourse.julialang.org/u/quinnj)
#### Post date: [May 31, 2022, 1:59pm UTC](https://discourse.julialang.org/t/figshares-api/81987/2 "2022-05-31T13:59:34Z")

</div>

Looks like it would be a pretty straightforward translation to Julia using HTTP.jl + Base file methods. Nothing too complicated or fancy.

---

<div class="post-metadata">

### Author: ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)
#### Post date: [May 31, 2022, 2:11pm UTC](https://discourse.julialang.org/t/figshares-api/81987/3 "2022-05-31T14:11:34Z")

</div>

I’ll try to play around with it, see what I get… 😬

The ultimate goal is to generate an `Artifacts.toml` file containing all the artifacts from the uploaded zip files of locally stored raw-data.

---

<div class="post-metadata">

### Author: ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)
#### Post date: [May 31, 2022, 9:11pm UTC](https://discourse.julialang.org/t/figshares-api/81987/4 "2022-05-31T21:11:46Z")

</div>

Not figshare, but openscienceframework ([osf.io](http://osf.io)): see my [Alexander Plavin / OpenScienceFramework.jl · GitLab](https://gitlab.com/aplavin/OpenScienceFramework.jl) package. It provides filesystem-like highlevel API (`readdir`, `write`, `read`, …) to remote files, and an automated way to create & upload Julia artifacts. The latter isn’t really documented, but see an example in tests: [test/runtests.jl · master · Alexander Plavin / OpenScienceFramework.jl · GitLab](https://gitlab.com/aplavin/OpenScienceFramework.jl/-/blob/master/test/runtests.jl#L20-26).

---

<div class="post-metadata">

### Author: ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)
#### Post date: [June 1, 2022, 9:14am UTC](https://discourse.julialang.org/t/figshares-api/81987/5 "2022-06-01T09:14:54Z")

</div>

Wow, OSF looks very cool. But unless I misunderstood, they don’t offer hosting the data themselves, instead, they connect between all the different (current) services involved in collaborative research and publication.

One of the points behind services like FigShare (and others) is to promise that the versioned data will be there “forever”. So a link to the data will “always” work and point to that specific (version of the) data. This way a committed version of the code (what with a Manifest file etc) will always successfully work with the linked raw-data.

`OpenScienceFramework.jl` looks very comprehensive. Thanks for sharing. I think my aim is a lot more modest.

---

<div class="post-metadata">

### Author: ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)
#### Post date: [June 1, 2022, 12:22pm UTC](https://discourse.julialang.org/t/figshares-api/81987/6 "2022-06-01T12:22:38Z")

</div>

> [@yakir12](#):
>
> But unless I misunderstood, they don’t offer hosting the data themselves, instead, they connect between all the different (current) services involved in collaborative research and publication.

I think there is indeed this possibility to host data somewhere else, but I never used it myself. Actually, I only use OSF as a place to host versioned datasets. A nice feature is that it can provide direct download links for private files as well (a code is included in the URL).

> [@yakir12](#):
>
> One of the points behind services like FigShare (and others) is to promise that the versioned data will be there “forever”. So a link to the data will “always” work and point to that specific (version of the) data. This way a committed version of the code (what with a Manifest file etc) will always successfully work with the linked raw-data.

That’s exactly my usecase for OSF. Files can be deleted, of course, but old versions cannot be replaced with different content.  
Add Julia artifacts system, and you get reproducibility “forever”.

---

<div class="post-metadata">

### Author: ![oxinabox](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oxinabox/32/206603_2.png) [@oxinabox](https://discourse.julialang.org/u/oxinabox)
#### Post date: [June 1, 2022, 12:55pm UTC](https://discourse.julialang.org/t/figshares-api/81987/7 "2022-06-01T12:55:39Z")

</div>

I think we hit FigShare’s API in DataDepsGenerators.jl

> <https://github.com/oxinabox/DataDepsGenerators.jl/blob/master/src/APIs/Figshare.jl>

When querying for URL to download from and other metadata.

> <https://github.com/oxinabox/DataDepsGenerators.jl/blob/master/src/APIs/JSONLD/JSONLD.jl>

If i recall correctly figshare embeds JSON-LD on their pages.  
Which we also hit in DataDepsGenerators.jl

> <https://github.com/oxinabox/DataDepsGenerators.jl/blob/master/src/APIs/JSONLD/JSONLD.jl>

Depending on your use case you could potentially use DataDepsGenerators.jl + DataDeps.jl for the download.  
Else feel free to browse that could and steal things.
