# Create graph from public Mastodon data

**URL:** <https://discourse.julialang.org/t/create-graph-from-public-mastodon-data/90637>\
**Category:** Graphs\
**Tags:** graphs, dictionaries\
**Created:** [November 22, 2022, 10:21am UTC](https://discourse.julialang.org/t/create-graph-from-public-mastodon-data/90637 "2022-11-22T10:21:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmeer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mmeer/32/33931_2.png) [@mmeer](https://discourse.julialang.org/u/mmeer)\
**Post date:** [November 22, 2022, 10:21am UTC](https://discourse.julialang.org/t/create-graph-from-public-mastodon-data/90637/1 "2022-11-22T10:21:45Z")

</div>

Hi there,

I have written a script to fetch an [array of accounts](https://docs.joinmastodon.org/methods/accounts/#following) that I follow on Mastodon. Each account is represented by a dictionary with

```julia
KeySet for a Dict{String, Any} with 21 entries. Keys:
  "acct"
  "locked"
  "created_at"
  "fields"
  "username"
  "bot"
  "emojis"
  "id"
  "statuses_count"
  "last_status_at"
  "avatar_static"
  "note"
  "followers_count"
  "header_static"
  "group"
  "url"
  "following_count"
  "header"
  "display_name"
  "discoverable"
  "avatar"

```

I now want to create a graph using [Graphs.jl](https://github.com/JuliaGraphs/Graphs.jl). Is there a straightforward approach to plot a graph based on these dictionaries where I use one key for nodes and another key for edges, etc. ?

---

<div class="post-metadata">

**Author:** ![cchderrick](https://avatars.discourse-cdn.com/v4/letter/c/ecd19e/32.png) [@cchderrick](https://discourse.julialang.org/u/cchderrick)\
**Post date:** [November 23, 2022, 1:33am UTC](https://discourse.julialang.org/t/create-graph-from-public-mastodon-data/90637/2 "2022-11-23T01:33:35Z")

</div>

I actually don’t use Graph.jl

Found this page: [Graph construction · Graphs.jl](https://juliagraphs.org/Graphs.jl/dev/first_steps/construction/)  
From here, it said I have 2 choices, load it from an existing format, using GraphIO, or modify from an empty graph.

Looks like neither you have to convert this dict into some graph format, or iteratively add nodes and edges to an empty graph.

Scanning thru [https://juliagraphs.org/](https://juliagraphs.org/)  
it suggest, [GitHub - JuliaGraphs/GraphPlot.jl: Graph visualization for Julia.](https://github.com/JuliaGraphs/GraphPlot.jl) or [GitHub - JuliaGraphs/NetworkLayout.jl: Layout algorithms for graphs and trees in pure Julia.](https://github.com/JuliaGraphs/NetworkLayout.jl)

---

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [February 8, 2023, 2:33pm UTC](https://discourse.julialang.org/t/create-graph-from-public-mastodon-data/90637/3 "2023-02-08T14:33:31Z")

</div>

Hi! Do you need to use some graph-theoretical algorithms or just plot the network?
